-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasteroids.csb
108 lines (100 loc) · 1.24 KB
/
asteroids.csb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
2->A
RanInt#(2,3)->C
14->D
RanInt#(2,3)->F
16->E
16->G
RanInt#(2,3)->H
16->I
RanInt#(2,3)->J
#Points
0->K
For 1->Z To 16
Locate Z,1,"x"
Locate Z,4,"x"
Next
Lbl 0
#Player
Locate 2,A,"->"
Do
GetKey->B
If B=47:Then Goto 1:IfEnd
#Obstacles
Locate D,C,0
Locate E,F,0
Locate G,H,0
Locate I,J,0
#Moves the obstacle and jumps to the top if it hits the bottom
Locate D,C," "
D-1->D
If D=1:Then
RanInt#(2,3)->C
16->D
K+1->K
IfEnd
Locate E,F," "
If E=1:Then
RanInt#(2,3)->F
16->E
K+1->K
IfEnd
Locate G,H," "
If E<=13:Then
G-1->G
IfEnd
If G=1:Then
RanInt#(2,3)->H
16->G
K+1->K
IfEnd
Locate I,J," "
If D<=14:Then
I-1->I
IfEnd
If I=1:Then
RanInt#(2,3)->J
16->I
K+1->K
IfEnd
GetKey->B
If B!=0:Then Goto 1:IfEnd
#Game ends
If D=2 And C=A:Then
Goto 3
IfEnd
If E=2 And F=A:Then
Goto 3
IfEnd
If G=2 And H=A:Then
Goto 3
IfEnd
If I=2 And J=A:Then
Goto 3
IfEnd
LpWhile B!=47
Lbl 1
Locate 2,A," "
#[EXIT]
If B=73:Then
Goto 3
IfEnd
#[EXE]
If B=47 And A=2:Then
3->A
Else
If B=47 And A=3:Then
2->A
IfEnd
IfEnd
Lbl 2
If GetKey=0:Then
Goto 0
Else
Locate 2,A,"->"
Goto 2
IfEnd
Lbl 3
K@
Stop
#Vars: A B C D E F G H I J
#Goto: 0 1 2 3