A downloadable game

Find the Exit Red


Story:

Red is now stuck within a Rectangular grid and has to Find the location of the Exit which has been randomly placed somewhere on the Grid. 

As well as the Exit to Find, Red has to avoid Grumpy whose out to get him, though Red can only Visit a Square Once, so he must be careful not to cut himself off from a Square which is the Exit! 

Like the original there's 5 Levels to get through, with each stage becomming smaller and again Grumpy also moves faster, though this game ends if Level 5 is completed, though returns to Level 1 if Grumpy gets Red.


Controls:

Use Cursor Keys to move Red Left, Right, Up & Down.

Requirements:

An Amstrad CPC Emulator with SOUND capabilities

For Windows:

* Winape 2.0 Alpha 18 or later, though should work on earlier Alpha released

* WinCPC

* CPCE v1.94 

For Mac:

* Retro Virtual Machine 2.0

I have supplied Tape Images (CDT file) as well as an DISC Image (DSK file). I've tested this game with Locomotive BASIC 1.0 using Winape 2.0 Alpha 18 and was working fine with Locomotive BASIC 1.1.


Code Explanation:

1: Set variable to Integer

   Set screen mode 0

   Set INK Colour 0 (Background) to 11 (Sky Blue)

   Set INK Colour 1 (Pen 1) to 0 (Black)

   Set INK Colour 4 (Pen 4) to 3 (Red)

   Select Pen 3 (Bright Red) & Select Paper 4 (Red)

   Redefine Text Matrix to define Red

   Setup variables l,r,t & b for Text Window

   Create a Function 'n', which returns a random number within the range of the window

2: Create another Function 'a', which reads the direction keys defined from k array.

   m = level number

   Clear Screen Mode, this is important for clearing the Board when going to the next level

   Set INK Colour 3 to 6 (Bright Red)

   Set Border Colour to 11 (Sky Blue)

   Set INK Colour 5 to 6 (Bright Red):

     -> this is done so the nasty doesn't real the location of the exit should they move over it.

   PRINT level number

   x = xpos of your character

   y = ypos of your character.

   w = xpos position of the enemy & position calculated is right side of the window.

   z = ypos position of the enemy & position calculated is bottom side of the window.

   c = calculates the size of the window, to quickly print a block

     -> I've modified this calculation from the original

     -> so the WINDOW is larger than the Drawn Grid

     -> and prevents the WINDOW from Rolling when Multicoloured Characters are used.

   r$ = Main Character:

     -> PEN 1 (Black) for Main Body which follows it

     -> Turn on Transparent Mode, followed by Backspace

     -> PEN 11(Pink) for the Face

     -> Turn off Transparent Mode

3: Define 2D Array:

     -> this becomes larger than the Window

     -> so checks with border edge prevent any out of range errors

   Setup Text Window

   PRINT some squares within

   u = FNn - XPOS position of the exit

   v = FNn - YPOS position of the exit

   m(u,v) = holds the position within the array of the exit.

   n = the value held where the nasty is and is restored later on.

   The Keyboard Buffer is flushed if INKEY$ contains something:

     -> this is a friendly way of doing it without any side effects a CALL &BB03 has

     -> and is compatable with all CPCs, though does cost some extra keystorkes.

4: Setup Boundary information to prevent out of range errors.

   DATA consisting of key number, directional value (xpos), directional value (ypos)

5: READ the DATA from Line 4.

   PRINT the main character.

   Play a character placement sound.

   Wait for any Keypress to start game.

6: Main game loop, exit if the enemy reaches you or if you find the exit

   The FOR loop is used:

      -> to read the players movement (4 way movement), 

      -> provided an edge or enemy isn't found.

      -> continue to Line 9 subroutine to move that character.

7: A short delay is added to slow the game slightly

      -> As the character moves over the blocks they change from Bright Red to Dark Red

      -> and your character can no longer move over them

      -> this routine adds the delay, making the game slightly fairer

   o = a counter

   IF 'o' counter reaches value 8 minus 'm' (level) then

      -> o returns to 0

      -> Array m(w,z) equals value previously stored in 'n'

      -> Set either Pen 3 & 5 (Bright Red)

      -> PRINT block

      -> GOSUB 10 where the rest of the enemy movement is handled

8: Main game loop ends here

   Counter returns to 0

   IF m(x,y) equals 2, then the exit is found, though if level is less then 5 then:

      -> reduce the size of the right side of the window 

      -> reduce the size of the bottom side of the window

      -> RESTORE the data for the next level

      -> ERASE the main array, so a new smaller one can be defined

      -> GOTO 2

      -> If exit is found on Level 5, change Border Colour to 3 & 6 and END since game has been completed,

      -> otherwise Enemy has reached you.

9: LOCATE xpos,ypos of character, PEN 4 (Dark Red), Draw Block,

   m(x,y) equals 1 so square cannot be revisited

   Increment/Decrement xpos or ypos based on value found in d(a)/e(a)

   LOCATE xpos,ypos of new position, PRINT main character 

   Play a SOUND based on where the main character is moving.

10: w, y = XPOS/YPOS positon of the enemy, when SGN(x-w) / SGN(y-z) is used:

      -> the enemy can follow based on your position.

    n = the value found at m(w,z) 

      -> prevents exit from being erased if the enemy moves over it.

   LOCATE xpos,ypos of the new enemy position

   m(w,z) equals 1, allowing the main Loop to exit should they land on you.

   PEN 15 = Standard Flashing Grumpy person, then PRINT enemy. 

   Play a Grumpy Note.   



Download

Download
Find The Exit Red.cdt 1 kB
Download
Find the Exit Red.txt 1 kB
Download
Find the Exit Red - Code explaination.txt 4 kB
Download
Find The Exit Red.dsk 190 kB

Install instructions

Loading:

Insert Tape Image or Disc Image using the emulator options (some emulators may not support the Tape CDT file, though DSK should be supported),

For Tape, Type |TAPE if AMSDOS is present, followed by RUN" & Press Play, game will load shortly and RUN immediately, LOAD" can also be used and the game LISTed at the Ready prompt.

For Disc, type RUN"disc, as above LOAD"disc can be used to LIST the game.

Leave a comment

Log in with itch.io to leave a comment.