Hi again,
Some more questions about celestial rift. As a quick and dirty way to get into the language and features I've re-structured and tweaked the Celestial Rift sample. Doing so has left me with some questions I hope somebody out there can answer.
In the game update loops I came across the checks for the various keys the user presses to control the craft and game. :-
Initially I had a very strong urge to turn the whole lot into a select case statement, or at least an if ... then ... elseif ladder, however I'm not certain whether this coding is intentional or not.
If intentional then it would allow the user to press multiple keys per game loop (e.g. fire and accelerate). However if this is the case why is FlushKeys used immediately after each key-press, wouldn't that negate the intention.
If not intentional, then I'll recode it!
I guess I'm asking how blitz interprets multiple key presses (can each and every key pressed be flagged and checked in one game cycle?). Does the flushkeys command really clear the key buffer until the next loop?
Some more questions about celestial rift. As a quick and dirty way to get into the language and features I've re-structured and tweaked the Celestial Rift sample. Doing so has left me with some questions I hope somebody out there can answer.
In the game update loops I came across the checks for the various keys the user presses to control the craft and game. :-
If KeyDown(KEY_FIRE) Then ; FIRE playerActionFire() FlushKeys End If If KeyDown(KEY_HYPER) ; HYPER JUMP playerActionHyper() FlushKeys End If If KeyDown(KEY_CLOCKWISE) ; CLOCKWISE TURN playerActionTurnClock() FlushKeys End If If KeyDown(KEY_ANTICWISE) ; ANTI-CLOCKWISE TURN playerActionTurnAnti() FlushKeys End If If KeyDown(KEY_SPEEDUP) Then ; ACCELERATE FlushKeys playerActionAccelerate() End If If KeyDown(KEY_BOOST) Then ; BOOST FlushKeys playerActionBoost() End If
Initially I had a very strong urge to turn the whole lot into a select case statement, or at least an if ... then ... elseif ladder, however I'm not certain whether this coding is intentional or not.
If intentional then it would allow the user to press multiple keys per game loop (e.g. fire and accelerate). However if this is the case why is FlushKeys used immediately after each key-press, wouldn't that negate the intention.
If not intentional, then I'll recode it!
I guess I'm asking how blitz interprets multiple key presses (can each and every key pressed be flagged and checked in one game cycle?). Does the flushkeys command really clear the key buffer until the next loop?