Last active
August 29, 2015 13:57
-
-
Save joskuijpers/9734243 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Game.init = function() { | |
Screen.drawRect(10,10,Screen.width-20,Screen.height-20,Color.RED); | |
Screen.flip() | |
} | |
Game.loop = function() { | |
// something with statemanager or so | |
} | |
Game.states["load"] = function() { | |
if(Input.Keyboard.getKey() != Input.Keyboard.KEY_NONE) { | |
// Switch state to "menu" | |
} | |
} | |
============================================= | |
game() { | |
put something on screen | |
GetKey(); | |
while(inMenu) { | |
draw menu | |
getkey | |
process key | |
if(key == enter) // enter the game | |
break; | |
} | |
while(1) { | |
process input with isKeyPressed | |
do rendering | |
flip() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment