Spaceboy

Top  Previous  Next

This month's project brings in fresh code for two new and (hopefully) interesting features:

 

1) An entity (our "Spaceboy" robot) that can walk on the floor, walls and ceiling;

2) A treadmill system that allows Spaceboy to run at high speed in levels that can take up to 30 minutes each.

 

The code that allows Spaceboy to walk on walls and ceiling uses c_content; if the robot is very close to the right side wall, its roll angle is set to -90 degrees and so on. Just take a look at these pictures to see Spaceboy in action:

 

aum79_spaceboy1

 

aum79_spaceboy2

 

aum79_spaceboy3

 

aum79_spaceboy4

 

The goal of the game is to make it to the end of the level avoiding the red boxes; use the left and right arrow keys to control the robot. If you collide with a box you will lose health:

 

aum79_spaceboy8

 

If you are lucky (as in random(1) > 0.99) you might encounter a tiny blue health box, which will increase player's health by a random value.

 

aum79_spaceboy5

 

Try to avoid all the boxes; otherwise, you might run into this panel:

 

aum79_spaceboy6

 

On the other hand, if you make it until the end of the level, you will be greeted by this panel:

 

aum79_spaceboy7

 

The treadmill system is simple and effective; it uses ent_create to place level pieces (wmb entities) in front of the player and removes the pieces that can't be seen anymore automatically. I know it's hard to believe it, but the code is very well commented.