Created
September 1, 2018 00:20
-
-
Save scruss/f5a8eb83f28b85d6399142cac460c806 to your computer and use it in GitHub Desktop.
helicopter - Eben's little BBC BASIC game: https://www.raspberrypi.org/blog/learn-to-write-games-for-the-bbc-micro-with-eben/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10MODE 2 | |
20REPEAT | |
30CLS | |
40VDU 23,1,0;0;0;0; | |
50VDU 23,224,0,14,12,104,16,28,8,0 | |
60VDU 23,225,0,112,48,22,8,56,16,0 | |
70VDU 23,226,0,248,32,116,126,116,112,0 | |
80VDU 23,227,0,31,4,46,126,46,14,0 | |
90VDU 23,228,0,102,255,255,255,255,255,255 | |
100VDU 23,229,255,255,0,0,0,0,0,0 | |
110FOR I%=0 TO 19 | |
120PRINT TAB(I%,30) CHR$(228); | |
130NEXT | |
140P%=RND(20)-1 | |
150PRINT TAB(P%,30) CHR$(229); | |
160X%=RND(20)-1:Y%=0:Z%=0 | |
170A%=RND(18):B%=10:C%=RND(2)-1 | |
180REPEAT | |
190PRINT TAB(X%,Y%) " "; | |
200PRINT TAB(A%,B%) " "; | |
210IF INKEY(-98) AND X%>0 THEN X%=X%-1:Z%=0 | |
220IF INKEY(-67) AND X%<19 THEN X%=X%+1:Z%=1 | |
230Y%=Y%+1 | |
240A%=A%+2*C%-1 | |
250IF A%=0 OR A%=19 THEN C%=1-C% | |
260PRINT TAB(X%,Y%) CHR$(226+Z%); | |
270PRINT TAB(A%,B%) CHR$(224+C%); | |
280FOR I%=1 TO 200:NEXT | |
290UNTIL Y%=29 | |
300IF X%=P% PRINT TAB(6,15) "YOU WIN" ELSE PRINT TAB(6,15) "YOU LOSE" | |
310PRINT TAB(4,16) "PRESS SPACE" | |
320REPEAT UNTIL INKEY(-99) | |
330UNTIL FALSE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment