Welcome to the forum

register! and help us get started! with this new darkgdk forum !


dont forget to introduce yourself Razz

enjoy! and good luck with your programming Smile


Need help :)

Go down

Need help :)

Post  Instinct949 on Sat May 15, 2010 7:16 pm

hey guys desided to redesign my level so heres the screenshot so u know what im talking about Smile abit lazy on the switches lol Razz




okay heres what i need help with

i tryed this but didnt work Sad heres the code




Code:
void door_open1()
{
   int open = 10;

   int switch1;

   int switch2;

   if(dbSpriteCollision(1,6) == 1)
   {
      switch1 = switch1 + 5;
      dbDeleteSprite(6);

      dbSprite(9,70,10,7);
   }

   if(dbSpriteCollision(1,7) == 1)
   {

      switch2 = switch2 + 5;
      dbDeleteSprite(7);

      dbShowSprite(20);
   }

   if(dbSpriteCollision(1,21)  == 1)
   {

      switch1 + switch2;
      if(switch1 && switch2 == open)
      {
      dbMoveSprite(8,2);
      }
   }
}


now it comes up with 3 errors but still runs the program

the errors

Project: newgame, Configuration: Debug Win32 ------
Compiling...
Main.cpp
c:\documents and settings\administrator\my documents\visual studio 2008\projects\newgame\newgame\open.h(13) : warning C4552: '+' : operator has no effect; expected operator with side-effect
c:\documents and settings\administrator\my documents\visual studio 2008\projects\newgame\newgame\open.h(22) : warning C4552: '+' : operator has no effect; expected operator with side-effect
c:\documents and settings\administrator\my documents\visual studio 2008\projects\newgame\newgame\open.h(31) : warning C4552: '+' : operator has no effect; expected operator with side-effect
Linking...
LINK : Debug\newgame.exe not found or not built by the last incremental link; performing full link



so what im trying to do is when the switches turn "active" they add + 5 to switch1 thn same with switch2 when that becomes active

and then it will = to 10 so it will then let u use the switch to open the door


this is probly something pretty basic but just cant figure it out lol Smile

or im just doing somthing slightly wrong Razz


THANKS GUYS

_________________
avatar
Instinct949
Admin

Posts : 21
Join date : 2010-05-05
Age : 23

View user profile

Back to top Go down

Re: Need help :)

Post  pqowieuryt101 on Sat May 15, 2010 8:26 pm

when you put

Code:
int switch1;

  int switch2;

you didn't say what the values actually are so it doesn't know what to add 5 to.

do this:-

Code:
int switch1=0;

  int switch2=0;

hope that helps Smile
avatar
pqowieuryt101
Admin

Posts : 97
Join date : 2010-04-22

View user profile http://darkgdk.forumotion.com

Back to top Go down

Re: Need help :)

Post  Instinct949 on Sat May 15, 2010 10:04 pm

thanks for the help dudee Very Happy

i retyped the bool etc u gave me and it worked for somereason heres a pic Very Happy

of the door opening with the both active switches:




and heres a pic with 1 active and trying to open it Smile


_________________
avatar
Instinct949
Admin

Posts : 21
Join date : 2010-05-05
Age : 23

View user profile

Back to top Go down

Re: Need help :)

Post  pqowieuryt101 on Sat May 15, 2010 10:15 pm

ah that's cool, glad I could help Smile

this project is really coming along Very Happy good job!
avatar
pqowieuryt101
Admin

Posts : 97
Join date : 2010-04-22

View user profile http://darkgdk.forumotion.com

Back to top Go down

Re: Need help :)

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum