Skip to content

Instantly share code, notes, and snippets.

@fu-sen fu-sen/giveup.bas
Last active Dec 4, 2019

Embed
What would you like to do?
' GIVE UP! | IchigoJam BASIC
' Copyright (c) 1995-2019 Keiichi SHIGA (BALLOON a.k.a. Fu-sen.)
' The MIT License (MIT) - https://gist.github.com/fu-sen/492b5096aeeeba1f19a35aeccd54d520
5 'GIVE UP!
10 CLS:LET X,0:LET Y,0
20 LOCATE 0,Y:? CHR$(1);
30 LOCATE 31,Y:? CHR$(1);
40 LET Y,Y+1:IF Y<>23 GOTO 20
50 LOCATE X,0:? CHR$(1);
60 LOCATE X,22:? CHR$(1);
70 LET X,X+1:IF X<>32 GOTO 50
80 LET S,0:LET X,16:LET Y,11
90 LET M,0:LET N,1
100 LOCATE X,Y:? CHR$(2);:LET C,0
105 WAIT 5:'IchigoJam BASIC 1.0.0+
110 LET R,RND(29)+1:LET Q,RND(21)+1
120 IF (R>X-3)*(R<X+3) LET C,C+1
130 IF (Q>Y-3)*(Q<Y+3) LET C,C+1
140 IF C==2 GOTO 110
150 LC R,Q:? "+";
160 LET I,INKEY()
170 IF I==28 LET M,-1:LET N,0
180 IF I==29 LET M,1:LET N,0
190 IF I==30 LET M,0:LET N,-1
200 IF I==31 LET M,0:LET N,1
210 LOCATE 0,23:? "SCORE ";S;
220 LET X,X+M:LET Y,Y+N
230 IF SCR(X,Y)<>0 GOTO 250
240 LET S,S+1:GOTO 100
250 LOCATE X,Y:? CHR$(244);
260 LOCATE 10,23:END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.