C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 6th, 2005, 09:48 PM
majinchad majinchad is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 3 majinchad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 21 m 58 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old January 8th, 2005, 01:03 PM
XZminX XZminX is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Varaždin, Croatia
Posts: 5 XZminX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to XZminX Send a message via AIM to XZminX Send a message via MSN to XZminX
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??

Reply With Quote
  #3  
Old January 21st, 2005, 08:00 PM
ratmilk ratmilk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 ratmilk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yes

yes because == means "is equal to" but = means "equals"

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > making agame and need some help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway