You're browsing the old v2.x documentation. This version is no longer maintained. Click here to go the v3.x documentation.

Step 3.3.2: Checking how far we've got

The previous steps must have been pretty boring as we haven't yet had the chance to actually try the game. As we already coded the loop where the pieces are falling down, why not do a little testing?

Click on this link to see the code what we've written so far. Note that I have added some testing code before the loop to initialize some variables with test data. We will remove these lines later:

REM -- For testing purposes only
REM -- TODO remove the bellow lines
CALL clear_playfield
shape_no! = 2
piece_x! = 7
piece_y! = 0
piece_r! = 0
shape = get_shape(shape_no!, piece_r!)
shape_color! = colors![shape_no!]
delay! = 11 - level!
REM -- End of test code

Now let's compile and run the program and see how it works:

Cool, isn't it? The piece is falling down, the program accepts joystick input and collisions are respected! Now delete the test code and move on to the next page where we'll code the game loop.