
 Game description:
 -----------------

Title: "Maze Run 2020"
Platform: MSX
Author: Rodrigo Gonzales
Nick: rodrivas78
Language: MSX-BASIC v1.0
Category: PUR-120


 Files:
 ------

MAZERUN.BAS: BASIC file
MAZERUN.TXT: Code in text format 
mazerun.png: Screenshot 
MazeRun_2020.dsk: Disk image for emulator
readme.txt: Description
------------------------------------------------------

 Links:
 ------

GitHub:
https://github.com/rodrivas78/MSX/tree/master/BASIC_10_Liners/Maze_Run_2020

To play it online:
https://msxpen.com/codes/-M-cP29FZetzv7CoJfpQ


 Game Instructions:
 ------------------

This is a two player race, in which scores whoever crosses the maze and 
first reaches the "end zone" of his own color (on the opposite 
side of the screen). Avoid touching the (white) walls of the maze
or this will cause you to return to the beginning of the path.

  Controls:

 ARROWS (keyboard) to control the GREEN player
 DIRECTIONAL PAD (joystick) to control the RED player

Tips:
  - Play in full screen.
  - Increase the volume (the game has some sounds).


To restart the game press "CTRL + STOP" (on an MSX) or 
"CRTL + PgUp" on an emulator, then press F5 or type RUN and 
press Enter.

-------------------------------------------------------------------

Emulation:
----------

The game should work well on almost any MSX emulator, but I 
would like recommend BlueMSX or openMSX. 

Load Instructions:
1. Start BlueMSX .
2. Drag & drop disk image "MazeRun_2020.dsk" to the BlueMSX main window.
3. Press "play" button (little arow on the top) or  LAlt+F9
4. The game will start automatically
-------------------------------------------------


Curiosities:
------------

Infinite mazes:

Upon reaching one of the "end zones" a new level is opened and a new maze
will be generated. For each level a different maze, never repeating itself.


A little about the code:
------------------------

10 PRINT Mazes:
- The mazes are generated by a single line, a small variation of the 
famous* one-liner: "10 PRINT CHR$ (205.5 + RND (1)):: GOTO 10",  
enshrined by users of Commodore 64. We can find it on line 30:

30 COLOR 15,1: FOR A = 0 TO 511: PRINT#1, CHR$(220.5 + RND(1)); : NEXT

The variation is in the use of a different character: "CHR$(220)", 
which generates "straight" (not diagonal) mazes as seen in the 
classical version.

Collision Detection:

- Collision detection is done by the POINT command (lines 40 and 50),
which returns in the variables "N" and "C" the color values ​​under the 
position coordinates of each player. 

The controls and movements of the players are on lines 60 and 70.

The main Loop of the game occurs between lines 40 and 80.

------------------------------------------------------------------------------
(*)
To learn more about this one-liner I recommend reading the excellent book:
"10 PRINT CHR$(205.5+RND(1));: GOTO 10" - The MIT Press (various authors)
The book can be downloaded for free through the following link:
http://trope-tank.mit.edu/10_PRINT_121114.pdf


All files can also be found on my GitHub:
https://github.com/rodrivas78/MSX/tree/master/BASIC_10_Liners/Maze_Run_2020


Rodrigo Gonzales
e-mail.: rrivas2009@gmail.com


