Working on a project for the Basic 10-Liner Contest being run on itch.io based on the image of the city from a APF Imagination Machine TS-1000 1970s game console:
Here is the Basic code for the game:
0 D(T)=RND(0):I(T)=RND(31):J(T)=0:IFRND(2)=1THEND(T)=-D(T):I(T)=I(T)+32
1 CLS0:?@320,"€€€€€€€€€€€—’€€€€€€€€€€““’€€€€€€€€€€€€óÿò€‘››€€€€€€£££“›";
2 ?"›š€€€€€€€€óóò€ûúþú•——€ÞÞÞÞÚ««¯›››š€þþþú€€óûûûòûÿýú———’ÞÞÞÞÚ««¯›››š";
3 ?"€þþûú€€ûûûûúûþþú››››ÞÞÞÞÚ««¯›››šóûþûú€®ûûÿüúûþÿÿ›š•—ßÜßÜß««®››žŸþ÷";
4 A=-SGN(PEEK(2)ANDNOTPEEK(16946))+SGN(PEEK(2)ANDNOTPEEK(16948))
5 B=-SGN(PEEK(2)ANDNOTPEEK(16952))+SGN(PEEK(2)ANDNOTPEEK(16947))
6 RESET(X,Y):X=X+A:X=X-(X<0)+(X>63):Y=Y+B:Y=Y-(Y<0)+(Y>19):SET(X,Y,5)
7 IFPOINT(I(T),J(T))=5THENSOUND1,1:S=S+1:GOTO0
8 T=RND(5):I(T)=I(T)+D(T):J(T)=J(T)+1:IFPOINT(I(T),J(T))>1THENH=H+1:GOTO
9 SET(I(T),J(T),0):?@508,H;:ON-(H<10)GOTO4:?"SCORE"S;:INPUT"enter";A:RUN
10 REM 1 2 3 4 5 6 7
11 REM789012345678901234567890123456789012345678901234567890123456789012
12 REM DEFENDER BY JIM GERRIE
12 REM ASCII BASIC GAMER
13 REM 10-LINER CONTEST 2021
14 REM USE A W S AND Z TO
15 REM MOVE WHITE TARGETTING
16 REM CURSOR & PAINT MISSILE
17 REM TO STOP IT. CITY CAN
18 REM ONLY TAKE 10 HITS
You'll notice in line 8 the GOTO has no line number. I'm taking advantage of the fact that if no line number is provided then Basic assumes line 0, which is the line I want it to go to. This keeps me under the 72 character limit.
Lines 1-3 are the ASCII characters in strings for the city. These characters are from the different block characters in the Motorola MC6847 character set, values 128-255.
Line 0 sets random starting points for the incoming missiles.
Lines 4-5 peek the keyboard input buffer so I can get continuous input in 8 directions using the AWSZ keys. If you hold down two at a time, you can get diagonal motion.
Key Input:
AW W WS
\ | /
A + W
/ | \
AZ Z SZ
No comments:
Post a Comment