| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
making agame and need some help
Hey I just just signed on to this site and I was wonding if anyone could help me. I'm trying to build a simple trivia game using C++, Its my first endever at a game. I cant seem to get the game to show the sequence of bitmaps in order, it goes straight to the last one. I want it to print one, then go on to the next one. Well here's the code I'm using (only part of it of course). Oh and I have it to where u get a title screen (that works), when u push spacebar it'll enter the game (thats where I'm having the trouble):
int correct=0; int wrong=0; int question=1; if (KEY_DOWN(VK_SPACE)) { if(question=1) { Load_Bitmap_File(&bitmap16bit, "sw1.BMP"); if(KEY_DOWN(VK_UP)) { correct++; question++; } else { wrong++; question++; } } if(question=2) { Load_Bitmap_File(&bitmap16bit, "sw2.BMP"); if(KEY_DOWN(VK_UP)) { correct++; } else { wrong++; } } } any help will be greatly appreciated |
|
#2
|
|||
|
|||
|
erm...
under if(...) for comparisson use == not = is should be if(question==1) and if(question==2) Didn't compiler report an error on that?? |
|
#3
|
|||
|
|||
|
yes
yes because == means "is equal to" but = means "equals"
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > making agame and need some help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|