Red's Hurdles

After escaping the Grumpy Grumbles, Red now has some hurdles to jump (well 36 of them!). It ain't easy either as Red just has enough jumping power to jump the 1st hurdle, though running helps increase that jumping power, but them hurdles have another trick up their sleeve, they'll speed up the more you successfully jump over them. It's your job to jump 36 of them, get the timing right and manage the jumps correctly by not over jumping when not necessary, it's possible. 


Controls:

Jump : Enter/Return Key

Tools: 

Any CPC Emulator with DSK Support should work. I use Winape 2.0 Alpha 18 while coding this program.

Program is compatable with Locomotive BASIC 1.0 and 1.1, so should work on any Amstrad CPC Computer with Disc Drive.

For Loading, insert disk image into emulator, RUN"DISC to load, for which the game will run immediately, alternatively LOAD"DISC to just load the game & RUN game from there.
 
Break-down of the program:

1 - Setup Screen, Initialize Variables, Array, Blank Screen Inks, String Data for Red & Draw Red

2 - Set Screen Inks for Red (Display Red), Use XOR Graphics Write Mode, Draw Hurdles, Setup Variables a = Game Speed, c = colour of hurdle, l = length of jump, g = lives (you only get 1 go!), s = score counter for number of hurdles successfully jumped, r = round number if 3 hurdles are jumped the next new round proceeds.

3 - Main Game Loop, proceeds if s<36 and g=1, Event Driver is initialize with 'a' setting the speed of hurdles, Second Loop proceeds which continues while r<3 and g=1, INKs, delay loop, animate foot movement and sound to produce running sound. length of jump (l) is added during this moment and Enter/Return Keypress Checked to determine if jump (on line 6) is required.

4 - 2nd loop reached, round score added to score and then reset & a is decrease to increase speed. Main Game Loop reached (game either complete or over). REMAIN(1) stops event driver. A While Loop checks if g is not equal to 1, then proceeds to Game Over Sequence by altering Red's Smile and playing disruptive sound with alternating Border Flicker. This check is skipped if g=1, though if true, f=1 to enter, f=0 is used to exit that loop. The last part of line 4 sets up Text Message, pointer variable (p) & col (p)

5 - While loop checks if 36 hurdles have been jumped (s=36) and ensures g=1 in case Red stumbles on Hurdle 36, if both true, Change Red's Hair and eye to Golden Yellow, Print Message (in multicolour) along top portion of screen & play a game complete tune. Exit that loop, any further key returns to BASIC.

6 - Jumping Sequence involves printing a block of lower Leg, Make a jumpy sound, check collisions in case hurdle collision has occurred, WHILE loop counts the delay for the jump, j=1 to say Red's Jumping, INKs 1 & 2 remove the lower legs/feet, p is increase while p is less than length of jump (l). Upon exit Block of lower leg is deleted. Length of Jump is deducted by 25 & Jump (j) = 0, a further check is done to ensure a collision hasn't occurred.

7 - Event Driver routine, A simple INK animating effect, 'c' reflects the colour of each hurdle, this is decreased, though previous colour hurdle INK c,1 is set to 1 to provide animation trick.

8 - Collision Test for when hurdle 12 (c=12) is active, routine checks if jump is in play, but if j=0 then jump is not occurring, g=g-1 to end game, otherwise round score (r) is increased.

9 - WHILE loop to check colour of Hurdle (c=7), this needs to become 15.Loop exits and current Colour of hurdle INK c,26 is displayed.