Skip to main content
gamedev.net
🔒 Locked

ANSWER ME!

Started by Stan100 2 replies 200+ views
Original Post
Stan100
Stan100
I have a program and I want it to check if space was hit. How would I do that? Example: Hit space to see stats Hit ''a'' to see ...... // don''t know what to put here I know I could just use a char but I know there must be a way to do it that way. Like getch() or something? Beatles are the best!
-----If you thought I was helpful, rate me down.If you thought I wasn't helpful, rate me down as well.This idiot didn't read my signature and tried to insult me.
Evil Bill
Evil Bill
Errr what?
Whats wrong with:

      
char c = getch();
switch(c)
{
case ' ': ShowStats(); break;
case 'a': DoSomething(); break;
default: Error(); break;
}





[edited by - Evil Bill on December 19, 2002 5:34:59 PM]
Member of the Unban Mindwipe Society (UMWS)
Zorak
Zorak
Dear original poster aka Stan100,
I would highly recommend this link to you : Good information.. Read it and when you fully understand the content, come back and ask the question again.


I have spoken.
Domine non secundum peccata nostra facias nobis
Oxyacetylene
Oxyacetylene
One tip. If you call your thread something like "ANSWER ME!" you might as well have written "FLAME ME!" People don''t like to be given commands.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.