A downloadable game

Ducky Egg

A PUR-80 10 line BASIC game for the Sharp MZ-80K. Written by Tim Holyoake, @psychotimmy (twitter)

Game Description:

Catch the eggs that the flying ducks lay in a blanket.

Control keys:     4 – Move person to the left. (If person is in column 1, then they reappear in column 40)

               6 – Move person to the right. (If person is in column 40, then they reappear in column 1)

5 – Deploy a piece of blanket to catch the falling eggs.

For every egg you catch, 5 points are scored. For every egg that hits the ground a point is lost. If an egg hits you, seven points are deducted from your score. If your score reaches -10 you lose. If you score 30 or more after the last egg has hit the ground then you win.

An egg hitting the blanket removes the piece of blanket hit and one next to it. (The world wraps around, so the piece of blanket next to the one in column 40 is the one in column one).

   

Line 1 – Sets all variables used to 0, with the exception of :

A = the bottom left screen memory location (minus 1),

D = the initial duck location on the screen (minus 1),

W = screen width

P = initial offset for the person – incremented / decremented as the person moves

X = initial offset for the duck – incremented (modulo 40) as the duck flies from left to right (and back round from the left again)

M = display code of the person character

G = display code of the ground

V = display code of the duck

E = display code of the egg

R = offset (10 lines) for where the blanket appears when deployed

Line 2 – clears the screen, sets the tempo for the music, pokes the ground into existence.

Line 3 – reads the keyboard. Sets H – the offset – for any movement. Decides if the duck is going to drop an egg. Sets F to be one more than the value of any numeric key pressed so that a computed goto can be used to either move the duck on one column (line 8), move the person left or right (line 9) or deploy a new piece of blanket (line 10).

Line 4 – Can only be reached after line 8 is executed. B is set to the position of the duck minus a row of the display screen – but this only matters if C = 1. If C = 0 at the start of the execution, then C will be 1 when the second IF statement on the line is executed – and control returns back to line 3 for keyboard input.

Line 5 – An egg is being dropped if execution reaches this statement. If there’s nothing below the egg, then it drops a further row (U=0) and execution returns to line 3. If something is there, execution passes to line 6.

Line 6 – We’ve hit something. Remove the egg from the display and reset the ‘egg in motion’ variable (C) to zero. If we’ve hit a piece of blanket, increase the score by 5, remove the blanket piece (plus the adjacent piece if it exists), play an “A” and display the updated score.

Line 7 – If it’s not the blanket, then reduce the score by 1 if the egg hit the ground, or by 7 if the egg hit the person. Play an “E” and update the score. Check to see if we’ve won or lost and stop the game if either condition is true.

Line 8 – Duck movement.

Line 9 – Person movement. A random piece of blanket may be removed whenever the person moves.

Line 10 – Deploy a new piece of blanket.

Emulator:

The one available from http://takeda-toshiya.my.coocan.jp/mz80k/index.html is recommended. Follow the link at the top of this page to the common source code project, download and extract the binary archive (for Windows XP/Vista/7/8/8.1/10).

In the emulator directory this process creates, you need to install the MZ-80K European fonts and monitor program. These can be downloaded from:

SP-1002 monitor ROM:                https://original.sharpmz.org/mz-80k/download/80kmoni.zip

MZ-80K fonts (EU):                        https://original.sharpmz.org/mz-80k/download/80kcg.zip

Unzip, and rename the monitor ROM to ipl.rom and the font file to font.rom. Place them in the emulator directory (where the mz80k.exe file will be found)

Next, load a copy of the Sharp SP-5025 BASIC interpreter. The MZ-80K was supplied with BASIC on tape, rather than pre-loaded in ROM.

A copy of the SP-5025 BASIC interpreter can be downloaded from here: https://original.sharpmz.org/download/sp-5025.zip

Unzip the file and load the resulting .mzf file into the emulator by:

  1. Typing LOAD <return> into the emulator window
  2. Selecting CMT -> Play from the emulator menu and selecting the BASIC SP-5025.mzf you have just downloaded.

 

If all is well, the emulator window should now look like this:

 

  1. Select CMT->Eject to remove the BASIC tape from the emulated tape drive
  2. Type LOAD <return> into the emulator window
  3. Select CMT->Play from the emulator menu and select the DUCKY EGG.wav file provided for the contest.

If all is well, typing LIST <return> into the emulator after the program has loaded should result in the program being displayed. (Note – if the program fails to load, try rewinding the tape in the CMT menu and then using the play button it provides. The tape controls are idiosyncratic, to say the least).

You’re now ready to RUN! Enjoy!

Download

Download
DUCKY EGG.wav 1.1 MB
Download
Ducky Egg.docx 160 kB

Development log

Leave a comment

Log in with itch.io to leave a comment.