A downloadable game

* 10 Line BASIC Challenge    *
* PUR-80 Category submission *
TITLE    : Earth's Last Stand
PLATFORM : Oric Atmos
You are the last remaining defence of Earth against the invading alien hordes!
In your trusty ship, you must shoot the descending aliens and not allow any to
reach the ground. Unfortunately, when an alien is destroyed, another one will
take its place, and even though the end it inevitable, humans will not go down
without a fight.  It is truly Earth's last stand, but let it be a noble one!
When the game is started, aliens will appear near the top of the screen and
start to descend.
Keyboard controls are Z and X keys for left/right and / key to fire your
missile.  When a missile is fired, you cannot fire another one until that
missile has either hit an alien or reached the top of the screen.
An alien is hit, your score is increased by an amount dependend on how close
the alien is to the bottom. A new alien will regenerate, but not as high up
as at the beginning of the game, and typically all aliens will start to descend
more regularly.  This is how the difficulty of the game progresses, and it gets
hard quite quickly!
The game does not end until an alien reaches the same level as your ship, so
keep going and try tactics like hitting the lowest aliens first and moving as
soon as possible to get to the next alien you want to target.
My best score is 665, which I did by initially waiting to hit aliens when they
were in the yellow zone so as to get more points. As the difficulty increases
quite quickly, it's then a case of just trying to get as many as possible and
definitely do not miss in the later stages because the aliens continue to
descend while you are waiting for the next missle to be ready!
Recommend to use an Oric-1 emulator, I have used Oricutron 1.2 which runs fine
on Windows 10.
1. Download the zip file from here:
2. Extract to a folder called Oric or similar
3. Copy the file INVADERS.TAP to the Oric\tapes folder
4. Start the emulator oricutron.exe (will start in Atmos mode by default)
5. Type CLOAD"INVADERS.TAP" and press enter
6. Game will load almost instantly
7. LIST to show the program
8. Type RUN to play the game
9. Keyboard controls: 'Z'=Left, 'X'=Right, '/'=Fire
Oric BASIC only allows less than 80 characters per line hence PUR-80 category.
This uses the standard text mode of the Oric, which is 40 columns by 28 rows
(the very top row is for system use - so 27 user accessible rows).
The background colour is set to green, yellow, red depending on the row, and
the foreground colour is set to blue, with these exceptions:
- Row 0 : Background colour is black
- Row 1 : Foreground colour is green (same as background colour!)
- Row 26: Background colour is black
Row 1 has a special purpose; when the missile is not active, it is still
plotted but at row 1. However it cannot be seen because it is the same colour
as the background! This saves having to make code provision to not process
the missile movement.
Single letter variables are used in place of constants as they are a little
faster to process and take up less code space. A big challenge is avoiding the
use of IF..THEN, so a lot of Boolean logic is utilised (although still had to
use it once).
How does Boolen logic help? A Boolean expression evaluates to -1 for True and
0 for False. These values can be directly used in expressions to update the
positions of player, alien and missle without the usual use of IF to check for
boundary conditions. Another interesting way is that the value is used to
determine whether to jump to a subroutine in line 6 to process an alien being
hit. By inverting so that 1=True, the ON..GOSUB command can be use to only go
to a subroutine if an expression is true and hence avoid IF..THEN!
There was enough space to squeeze in user defined graphics.  There are three
characters re-defined to represent the player's ship, aliens and the missle.
The characters are designed using a 6x8 matrix, which is narrower than the
usual 8x8 found on computers like C64 or Atari.
Good sound effects are possible in such a short program due to Oric BASIC
including single keywords called ZAP, SHOOT and EXPLODE - which do what you
would expect!
0 U=520:W=34:X=20:Y=25:P=X:DIMJ(40):M=123:B=32:A=125:Z=124:O=24:GOSUB7:REPEAT
2 F=-(K=159ANDQ<2):G=-(F=0):P=P*G+X*F:Q=(Q+(Q>1))*G+(Y-1)*F:V=RND(1)-.3<(L/20)
4 L=L+H:I=-(I<w)*(i+4)-4*(i>=W):J=J(I):PLOTI,J,B:J=(J-V)*-(J<y)-2*(j<2):j(i)=j 5="" h="-(Q">1ANDSCRN(I,J)=Z):PLOTI,J,A:ONHGOSUB6:L=L+H:UNTILJ=Y:EXPLODE:END
7 INK4:CLS:POKE#26A,10:FORG=0TO26:F=2*-(G>0ANDG<9)-(G>8ANDG<18)*3-(G>17ANDG<=Y)
9 Q=1:RETURN:DATA0,12,12,45,45,63,63,30,0,8,4,8,4,8,4,0,33,18,30,45,45,63,18,33</y)-2*(j<2):j(i)=j></w)*(i+4)-4*(i>


INVADERS.TAP 674 bytes
readme.txt 5 kB

Development log

Leave a comment

Log in with itch.io to leave a comment.