Computer Science Canada Help Please |
Author: | Shippuo23 [ Thu Apr 09, 2009 9:14 am ] | ||||
Post subject: | Help Please | ||||
I am making a game where i need to make characters go down the screen and I need to push a button before the character hits the bottom of the screen, I have done the characters going down the screen but have no put in any commands for buttons I need help with this please help me This is my program it is in Turing by the way
MODEDIT Remeber your syntax tags!!
|
Author: | DemonWasp [ Thu Apr 09, 2009 10:35 am ] | ||
Post subject: | RE:Help Please | ||
The easiest (and safest) way to design a game is pretty simple. You've sort of got it in your code already. The basic idea is that you will have a game "tick". At every tick, you update the game, then redraw it. On each update, you look for user input, determine what each creature does, move them, attack, whatever. Drawing is simple enough, but has a wrinkle: we'll set it up so that instead of updating the screen after every draw command, you do all the draw commands, then update the screen once. This helps to cut down on flickering. It looks like this:
|