Landing
Rules
Land rocketship safely on moon surface. Engines produce their maximum thrust
when up
arrow is pressed. Watch you fuel -- you have only limited supply.
If landing speed is too high, the rocket will explode
() and if rocket speed is not high enough to
explode, but still high, it will
turn into unusable pile of junk (). In any case
you can hit space key to try again.
Code and comments
Download the LANDING.NSG code.
This is the first game in the series (and the only remaining, if lost
VETKA.NSG is excluded) that works in graphic mode
(SCREEN 2).
There are no breakthrough technologies involved, just several small tricks here and there.
- Extremely powerful and compact DRAW operator draws background
scenery and instrument panel.
- Sprites are used for rocket, engine flames,
explosion and pile of junk.
- Sprite definitions as string are written in most compact form -- as literal
strings. I tried to draw them in a way that they can be encoded with as many
printable characters as possible.
- Fuel bar is 2 pixels wide, but when fuel is used only one PSET
operator is used to update display. This is due to peculiarities of
SCREEN2
graphics.
- Once again, comparison operators are used in arithmetic expressions to reduce IF control structures
- U=SIN(10) acts as a delay -- without it explosion flash happens too fast to be noticed.
- MSX BASIC processes FOR U=0 TO 0 STEP 0 as infinite loop that will run forever.
I really wanted to add a few stars to the background scenery, but there just
wasn't enough room in line 1. There was plenty of room in lines 2 and 3, but
that is not where I needed it. Eventually I decided that it is better without
stars. After all, pictures of lunar surface from Apollo missions also do not
have any stars.
[ MSX BASIC
| << Previous
| Next >>
| Feedback
]