Hey everybody!
Take a look at the code of the day:
Let me explain the new keywords used:
- dim as boolean as const as but with dim we are telling that the label (in our case finish and kescape) will have a variable value. In the case of boolean this value can be false or true.
- do loop until to make a loop that will repeat the code inside the instruction until the condition after until is resolve to true.
- if then else to execute the code inside the instruction if the condition is resolve to true, else to execute an alternate code if the condition is not resolve to true.
- multikey that will return -1 if a concrete keyboard key is pressed. We have to pass to the instruction the scan code of the key we wnat to check, in the our code Esc key is value is 1 as we put in the declarations.
- sleep although we have already see sleep in this case we are using it with two parameters. The first one is the amount of miliseconds that sleep will wait and the second one can be 0 if the wait can be interrupted by a key press or 1 without key interrupt.
And the structure, more accurate every time:
This is enough by now, in the next entry we will try to focus on DRAW part to learn how to control the frame rate and a right way to control the screen when we are drawing, preparing for the moment we are ready to control and move the white square.
- DESCRIPTION
- DECLARATIONS
- INITIALIZATIONS
- GAME LOOP
- INPUT
- DO UPDATE
- DRAW
- FREE UP CPU TIME
- sleep 1,1
- ENDING
This is enough by now, in the next entry we will try to focus on DRAW part to learn how to control the frame rate and a right way to control the screen when we are drawing, preparing for the moment we are ready to control and move the white square.
Contact me for any question, see you!
Go to the next entry
Go to the previous entry
Go to the first entry
Comments
Post a Comment