A downloadable game

--- Amphibian Assault ---

Written by Sander Alsema for the 10-liner competition 2024.

Language: Commodore 64 Basic v2

Category: PUR-80



--- Description & Instructions ---

Where did things go wrong? You just went out to run some errands, and now look what happened. Lost in a swamp somewhere in the middle of the night.

A quite harrowing predicament to be in for a mere firefly. Uneasily you try to find your way back home, but it's no good.

Now your mind is playing tricks on you, you could have sworn something moved in the bushes ahead. From all around you, you start hearing ominous noises. Hungry eyes are leering at you in the dark. Then it begins! Frogs are attacking you from every direction! Escape is definitively out of the question. Being a firefly, you are able to defend yourself, But for how long?

Use your joystick in port II to take out the approaching frogs with fireballs. At first only a couple of them dare to come near. But in no time you are overwhelmed by entire swarms. Try to survive as long as possible, and take out as many frogs as you can, before you get swallowed.

Press any key to play again.


--- Code Explanation ---

Line 0: In a loop read the horizontal and vertical coordinates of the

        starting positions of every frog.

        Also in this loop create a vertical orientation string.

        Also in this loop calculate the horizontal and vertical

        directions of every frog.

        Initialize the variable that will hold the calculated screen

        position of the fireballs to prevent flashing in top left

        corner.

Line 1: Read the string with the frog, and read the string that erases

        the frog.    

        Set the character colour for the entire screen to purple and

        clear the screen.

        Display the firefly.

        Set a variable to screen memory.

        This line also contains data which was read in line 0.

Line 2: Use a variable for the improbability value to reduce code size

        elsewhere.

        Set up a loop to manage all frogs.

        Set the display string to erasure of the frog.

        Set the display repeat boolean to 'true'.

        Display the number of eliminated frogs in the top left corner.

        If a shot is requested and there isn't one in progress, then

        start a shot. Set its horizontal and vertical coordinates to the

        position of the firefly. Set its horizontal and vertical

        directions to the last direction of the joystick.

Line 3: Clear the screen position of the fireball.

        If a frog was activated then display the display string. If an

        activated frog was hit then deactivate it. Set the display

        string to the displaying of the frog.

Line 4: If a frog was hit then cancel the shot.

        If a frog was hit then increase the score.

        If a frog was activated and the display repeat boolean was set

        to 'true' then set it to 'false'. Move the frog in its assigned

        direction. Jump to line 3.

Line 5: Examine the position of the firefly.

        Examine joystick II.

        If a frog was not activated and a random decision says that it

        should be, then activate it by putting it in it's starting

        position.

Line 6: If a shot was fired then move the fireball one position in the

        given direction. Decrease the maximum distance the fireball has

        yet to travel. Calculate the screen position of the fireball.

        Use this to set its colour to yellow. Also use this to display

        the fireball.

        This line also contains data which was read in line 0.

Line 7: Set the background colour to black.

        Determine the vertical and horizontal directions the joystick is

        pointing to.

        If the joystick is pointing in a direction and the fire button

        is pressed, then request a shot.

Line 8: Determine whether a fired shot hit a frog or not.

        Manipulate the counter of the frog managing loop to keep the

        central frog from appearing, and - if a certain frog was hit -

        to make this frog next in line for processing.

        Continue or leave the loop.

        If the firefly is still present in its position, then jump to

        line 2.

Line 9: This line contains data which was read in line 0 and line 1.

        Display the fact that the firefly was "swallowed".

        Clear the keyboard buffer.

        Wait until a key was pressed.

        Restart the game.

---

Download

Download
Amphibian Assault.d64 170 kB
Download
Commentary for Amphibian Assault.txt 5.7 kB

Install instructions

I prefer VICE, but you can use any emulator that works with *.d64 files.

If you haven't installed it yet, it can be downloaded from their website.

Here's how to use it:

 Click : File -> Attach disk image -> Drive 8

 Select: Amphibian Assault.d64

 Click : Attach

Now, just as you would with a normal Commodore 64, you can type:

 LOAD"$",8       (to load the directory)

 LOAD"ASSAULT",8 (to load the game)

 LIST            (to view the directory or game listing)

 RUN             (to run the game)

Be aware that you are now using a virtual Commodore 64 keyboard.

Therefore the keys will differ slightly from your physical keyboard.

Use <SHIFT> '2' to display quotation marks.

To play this game you need a joystick in port II. Here is how to set it

up in VICE:

 Click: Settings -> Joystick settings -> Joystick settings...

You can now enter the keyboard button set you want to use as a joystick.

Although this game would run perfectly well on a real Commodore 64, it is

a bit slow, due to the complexity of the code. In VICE this problem is

easily overcome:

 Click: Settings -> Maximum speed -> Custom

Now you can enter the speed as a percentage of the normal speed.

I recommend at least 300%, but of course you can set it to any speed you

feel comfortable with.

Comments

Log in with itch.io to leave a comment.

Cute text graphics, giving me eyebleed after a few solid rounds - nice work!