A downloadable game

--- Panzerjaeger ---

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

Language: Commodore 64 Basic v2

Category: PUR-80


--- Description & Instructions ---

The days of peace are a distant memory. Intense fighting on both sides has led to a death toll of unprecedented proportions. Somewhere in all this carnage a tank battalion was on manoeuvres. Unfortunately however, during the night it was ambushed and decimated. The few remaining tanks managed to take up defensive positions, but the battle is lost, let there be no doubt about that. Less than a handful of noble heroes are left standing against an overwhelming enemy. Determined to give them a run for their money, it is up to you to take out as many enemy tanks as possible before capitulating.

Move your joystick in port II left and right to move your tank back and forth. Press the fire button to fire a shell.

You've got plenty of shells, but you can fire only one at a time. Whenever you destroy a tank, it will make the others more daring, and they will approach quicker. If a tank reaches your line, then your tank is lost. After losing three tanks you have no option but to surrender.

Press any keyboard key to play again.


--- Code Explanation ---

Line 0: Read string data from somewhere else in the program, namely:

         - Spaces above enemy tank that erase it when moving down.

         - Enemy tank barrel facing right.

         - Enemy tank barrel facing left.

         - Player's tank.

         - Bottom part of enemy tank.

        Set a variable with an often used value to save code space

        elsewhere in the program.

        In a loop build the vertical orientation string and initialize

        the registers of the sound chip.

        Set the horizontal position variable of the player's tank.

        Set the number of player's tanks (lives) to three.


Line 1: Clear the screen, display the score and number of player's tanks.

        Set the horizontal position variable of the enemy tank.

        Set the horizontal destination variable of the enemy tank.

        If all player's tanks are lost then display "SURRENDER", wait

        until a key is pressed and restart the game.


Line 2: Move the enemy tank towards the horizontal destination.

        If the enemy tank was hit or has reached the player's tank then

        decrease number of player's tanks (if enemy reaches player),

        clear the direction variable of the enemy tank, increase the

        score (if enemy was hit), clear the vertical position variable

        of the enemy tank, clear the keyboard buffer, clear the boolean

        tank-was-hit variable, and jump to line 1.


Line 3: If the enemy tank has reached its horizontal destination, then

        calculate a new one with a formula that works like this:

         - Pick a random horizontal position.

         - Determine the difference with the current horizontal position.

         - Divide this by a number greater or equal to one, depending on

           the score.

         - Finally add this to the current horizontal position.

        This will make an enemy tank spend less time moving horizontally,

        as the score increases. Therefore approaching quicker, and making

        the game harder.

        Calculate the new horizontal direction.

        Move enemy tank down.

        Use the string variable of the tank barrel facing right.

        If the horizontal direction is left, then use the string variable

        of the tank barrel facing left.


Line 4: If the vertical position of the shell was set, then erase the

        current position and move the shell up. If the vertical position

        is still set, then display the shell.


Line 5: Display the enemy tank.

        Read the joystick values.

        If the fire button was pressed and the vertical position of the

        shell is clear, then set the vertical and horizontal position

        of the shell to the barrel of the player's tank.


Line 6: Display the player's tank.

        Set the boolean tank-was-hit variable when the character above

        the shell was not space, and the vertical position of the shell

        was not at the top of the screen.

        Set background colour to black or yellow if enemy tank was hit.


Line 7: Use the joystick values to calculate the horizontal direction of

        the player's tank.

        Use this value to calculate the new horizontal position of the

        player's tank.

        If the enemy tank was not hit then jump to line 2.

        This line also contains string data.


Line 8: Clear the vertical position of the shell.

        Set sound chip register to white noise.

        In a loop gradually decrease the volume of the explosion.

        Jump to line 2.

        This line also contains string data.


Line 9: This line only contains string data.

---

Published 5 days ago
StatusReleased
Rating
Rated 4.0 out of 5 stars
(1 total ratings)
AuthorBASIC 10Liner
GenreAction
Tags10liner, 8-Bit, basic, Commodore 64

Download

Download
Panzerjaeger.d64 170 kB
Download
Commentary for Panzerjaeger.txt 5.8 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: Panzerjaeger.d64

 Click : Attach

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

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

 LOAD"PANZERJAEGER",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.

This game makes sounds, so be sure to turn on your loudspeakers!

Comments

Log in with itch.io to leave a comment.

very good