Using a Touch Tablet (or alternatively, a pair of paddle controllers), move a blue block around the screen, trying to catch yellow blocks that appear at the bottom, and scroll towards the top.
When you catch a yellow block, you earn a point. (Note: you don't need to be touching it precisely.) If a block hits the top of the screen, you are penalized. Earned points are shown at the very top as a bar that grows from left to right. Penalties are shown just below that as a bar that grows from right to left.
When either bar is full — either you have earned 40 points, or allowed 40 blocks to hit the top of the screen — the game ends, and you are shown your final score.
A perfect score would be 140. Other winning scores would vary between 101 and 139, depending on how many objects you missed.
The game has 10 waves. Each wave begins slowly, and gradually ramps up in speed, until things slow back down when the next wave begins. (The background color is different for each wave.) Each wave has an increasing chance of objects appearing at the bottom at any given moment. So in early levels, objects appear 'every once in a while', and in level 10, new ones appear almost constantly.
Since I own an Atari Touch Tablet, and touchscreen cellphones and tablets are all the rage, I decided to try making a game that used it.
After whipping up code to let me draw pixels on the screen (in the correct positions) when I touched the tablet, I thought for a while about what kind of game to make. "Fruit Ninja" and its ilk have been popular, and though I've never played it (except for a few minutes with the Xbox Kinect version) and knew I could not simulate it in 10-lines of BASIC, it's more-or-less what my goal was.
In the end, the game is kind of similar to "Stampede" for the Atari 2600, in that you are penalized for letting objects get away from you. Less similarly, it's kind of like "Kaboom!".
Unlike my previous 3 games, this one was not difficult to squeeze into 10 lines of code. By squeezing things down a little, I was able to provide a scoring screen (that went beyond simply showing final score and wave; instead, I was able to break the scoring down).
10 GRAPHICS 19:SC=DPEEK(88):Y=3:SZ=SC+30:SPD=3:IT=0:RAT=10:OK=1
SC
)
Y
); we won't necessarily
have any input from the user until they press on the tablet!
SZ
)
(note that since it's a byte, and this is a 4-color graphics mode,
one byte actually spans 4 pixels)
SPD
)
IT
) (not strictly necessary)
RAT
)
OK
)
20 POKE SZ,0:POKE SZ+10,0:Q=Q+1:IF Q>=SPD THEN Q=0:MOVE SC+30,SC+20,220:OK=1:IT=(IT+1) MOD 10:IF IT=0 THEN SPD=SPD-1
SZ
), and on the line below (SZ+10
)
Q
)
SPD
)...
OK
)
IT
), wrapping around when we
hit '10'
SPD
)
30 PX=PADDLE(0):PY=PADDLE(1):IF PX<228 AND PY<228:X=INT(PX/6):Y=22-INT(PY/11):ENDIF :SZ=SC+Y*10+INT(X/4)
PX
and PY
)
X
and Y
)
SZ
)
40 IF PEEK(SZ)+PEEK(SZ+10):V=15:PT=PT+1:COLOR 3:PLOT PT MOD 40,0:ENDIF :COLOR 3:PLOT X,Y
SZ
) or on the line below (SZ+10
)...
V
)
PT
)
X
,Y
)
70 FOR XX=0 TO 9:IF PEEK(SC+20+XX):POKE SC+20+XX,0:BD=BD+1:COLOR 2:PLOT 39-(BD MOD 40),1:SOUND 0,100,12,8:ENDIF :NEXT XX
XX
)...
BD
)
80 IF RAND(RAT)=0 AND OK:COLOR 1:PLOT RAND(30)+5,22:OK=0:ENDIF :IF SPD=0 THEN SPD=3:RAT=RAT-1:POKE 712,(10-RAT)*16:IF RAT<1 THEN RAT=1
RAT
)), and
it's okay to do so (based on whether the screen scrolled since we last
added an object (OK
))...
OK
); this will get cleared when the screen is scrolled up
one line
SPD=0
)...
RAT
)
RAT
goes below 1, set it to 1
90 SOUND 0,255-PT*6,10,V:V=V-1:IF V<0:V=0:ENDIF :IF BD>=40 OR PT>=40:GOTO 1000:ENDIF :GOTO 20
V
)
PT
), or 40 penalties (BD
),
go to the game-over subroutine
1000 GRAPHICS 18:? #6;"hit +";PT:? #6;"miss -";BD:IF BD>=40:? #6;"loss -100":PT=PT-100:ELSE :? #6;"win +100":PT=PT+100:ENDIF
PT
) and penalties
(BD
)
BD=40
)...
1010 ? #6;"total ";PT-BD:SOUND 0,0,0,0:PAUSE 600:RUN
DOS.SYS
, DUP.SYS
)
TBASIC.AR0
)
AUTORUN.BAS
;
except for the filename , same as SLICE.TBS
stand-alone file, above)
Bill Kendrick, 2014,
nbs@sonic.net,
New Breed Software
Other games I wrote for NOMAM 2014