How do you use the spacebar in the game
Author |
Message |
Quakerstate98
|
Posted: Thu Jun 15, 2006 9:32 pm Post subject: How do you use the spacebar in the game |
|
|
I'm making a fighting game, and i wanna use spacebar for block but i can't figure out how, the help says to use (ORD_SPACE) as a int but i don't understand. I get how to use (KEY_DOWN_ARROW) and ('a') and stuff but i can't figure it out can anyone help me out |
|
|
|
|
|
Sponsor Sponsor
|
|
|
TheOneTrueGod
|
Posted: Thu Jun 15, 2006 9:38 pm Post subject: (No subject) |
|
|
(' ') represents space bar. |
|
|
|
|
|
Quakerstate98
|
Posted: Thu Jun 15, 2006 10:07 pm Post subject: Thanks |
|
|
Alright sweet it works, thanks |
|
|
|
|
|
Bored
|
Posted: Fri Jun 16, 2006 8:56 am Post subject: (No subject) |
|
|
ORD_SPACE returns the ASCII value for space and is the same as ord (" "). ord() takes a character and returns the ordinal value. The reverse of this operation is chr, thus chr (ord ('a')) returns 'a'. This means that chr (ord (" ")) is equvilent to chr (ORD_SPACE), and so you could also use chr (ORD_SPACE). That's a little easier to tell what it is but i think having simple " " looks better. But now you know that the ORD constants return ordianl values whereas the KEY constants return the actual character, and thats why keys (ORD_SPACE) would not work. |
|
|
|
|
|
|
|