excelente! uno de mis juegos favoritos de ZX Spectrum! genial!
STOP THE micro EXPRESS by IvanBasic
A downloadable game
STOP THE micro EXPRESS
Game coded in 10 lines of plain Sinclair BASIC.
For the 2022 Homeputerium 10Liner BASIC contest.
Attention: 48K mode only.
A micro version of the game “Stop the ITA Express”, the mission is to reach the locomotive for stopping the express that is running out of control. You must walk and jump over the roof, starting in the last car, the train has 1 locomotive and 19 cars. Knives fly towards you from de back and the front, jump to avoid them; if they touch you, you will fall. Jump between cars for not falling. Falling means end of mission and starting again (there is just one live). If you reach the locomotive, walk to the left to enter, and the train will slow down until being totally stopped, then the mission is accomplished.
O Left – P right – Caps Shift jump. Multiple key pressing. Not redefinable, but if you have even elementary notions of Sinclair Basic (the User´s Manual will help), you can change the keys in the code.
Line 2 – Set up black screen and user defined graphics, with DATA shared between lines 2 and 11 to accomplish the rules (max 256 characters per line).
Line 3 – Set the game variables, string for the train, and numeric for the game control. s – flag for jump (0 no jump, 1 and 2 jump frame)
e – coordinate of the knife.
c – counter for several loops (poles, track sound)
d – direction of knife, -1 to the left, +1 to the right
x – coordinate of our hero in the train (x=1 entering in the locomotive, x=291 end of cars)
b – sprite frame (1 jumping, 2 standing)
f – logical flag depending on jump state
a$ – train attributes for LPRINT
b$ – 15 attributes corresponding to the playing screen, including poles.
c$ – string with ground sequence
Line 4 – Detects if jumping key is pressed.
Line 6 – Detects if moving keys are pressed. Checks if left key is pressed, then moves.
Line 7 – Checks if right key is pressed, then moves.
Line 8 – Moves the knife; updates the pole position, if it is within the screen then makes track sound.
Line 9 – Prints everything in the screen: refresh the train, tracks, and pole; erases the knife and the hero, and prints them in their new position, both in standing or jumping sequence. LPRINT is a special token in Sinclair BASIC, which used in an innovative way makes the screen attributes change very fast, creating the scroll effect of the train and poles.
Line 10 – Checks if the knife touches the hero, or if there is no roof below; in both cases jump must be 0 (s=0). If these happen, it makes the hero fall, the train runs away, and ends with Game Over message. Waiting a pause to start. Line 11 –Loop if you still didn´t reach the locomotive (x is not 1 yet), differentiating to which line go depending on jump flag (s=0 goes to line 4, s=1 or 2 goes to line 6 avoiding checking the jump key). If you have reached the locomotive (x=1), it goes to next line (final sequence). This line has some additional UDG and game controls DATA. Line 12 – Mission accomplished sequence: the train slows down until being stopped, and a congratulation message is displayed. Waiting to a key press to start the game.
Want to change difficulty level? Too easy?
Change in the line 4 the value of s, setting LET s=1 AND… The jump will be shorter, and more accuracy is needed. Too difficult? Change it as LET s=3 AND…, the jump will be longer. (Setting values of s out of range 1 to 3 may cause playing disfunctions). Knives too frequent? Change in line 9 the limits checked by the variable e, below 7 and above 23 respectively. Test different values and look what happens (always respecting 1 to 7 for the left limit, and 23 to 30 for the right).