GLBasic User Manual

Main sections

11 Homework

Tasks for testing what you have learned

That has been quite a lot of information to learn. The coming tasks will give you a good start into your game programming life. You should take a full day for each task and fiddle around with the program after getting it to work.


So enough with the basics. You have learned the command PRINT. Here the syntax again:
PRINT [NUMBER/WORD], X-Pixel to the right, Y-Pixel towards the bottom;

A little test that will prepare you for the next chapter:
You are a teacher and your class contains 4 pupils (2 rows, 2 columns). Since you are such a nice teacher, you want to have a computer program choose a pupil to lead the class each day. The program should give the name and the sitting position of the pupil printed to the screen.
<TR><TD>Row1</TD><TD>Sabine</TD><TD>Manuela </TD></TR></TABLE>

Output e.g.

sitting in:
Row 1
Col 0

-If you don't change the standard font, the chars are 16x16 pixels each.
-A random number will be returned by the function RND(maximum). (Take a look back top)


Write a program that loads 2 sprites and does the following with them:
Move sprite 1 from left to right, then rotate with ROTOSPRITE once, then use ROTOZOOMSPRITE to rotate the sprite once again and zoom it to full screen size. Repeat with the second sprite.
Now the program should load a background image and do the same routines again with an alpha value of -100 for sprite 1, and 100 for sprite 2.

You'll find graphics and a smal project for this task in the projects folder.

See also...