/[james]/archive/graphical/Invaders
ViewVC logotype

Annotation of /archive/graphical/Invaders

Parent Directory Parent Directory | Revision Log Revision Log


Revision 28 - (hide annotations) (download)
Fri Mar 14 14:57:29 2003 UTC (21 years, 8 months ago) by james
File size: 3034 byte(s)
Initial import.

1 james 28 MODE 15
2     MODE 13
3     OFF
4     ON ERROR MODE 12: REPORT: PRINT ERL: END
5    
6     PRINT''" Red Blue"
7     PRINT'"Move left Z 2"
8     PRINT'"Move right X 3"
9     PRINT'"Fire bullet <space> Enter"
10     PRINT''"Press any key to start..."
11     IF GET
12    
13     MODE 15
14     MODE 13: REM 1280 * 1024 os units; 320 * 256 pixels (4 os units = 1 pixel)
15     OFF
16    
17     PROCs
18    
19     Bank% = 1
20     REPEAT
21     WAIT
22     SYS"OS_Byte", 113, Bank%
23     SYS"OS_Byte", 112, 3 - Bank%
24     Bank% = 3 - Bank%
25     PROCf
26     PROCm
27     n% += 1
28     IF TIME - 100 > m% THEN m% += 100: o% = n%: n% = 0
29     UNTIL 0
30     END
31    
32    
33     DEF PROCs
34     x1% = 400
35     x2% = 800
36     b1y% = -100
37     b2y% = -100
38     z1% = 0
39     z2% = 0
40     zh% = 0
41     zp% = 0
42     s% = 0
43     e% = 0
44     f% = 1
45     m% = TIME
46     n% = 0
47     o% = 0
48     DIM sx%(10)
49     DIM sy%(10)
50     DIM sd%(10)
51     DIM se%(10)
52     se%() = FALSE
53     ENDPROC
54    
55    
56     DEF PROCf
57     COLOUR 128 + %010000
58     CLS
59     GCOL %000011
60     PLOT 4, x1%, 140
61     PLOT 0, -40, -40
62     PLOT 81, 80, 0
63     GCOL %110000
64     PLOT 4, x2%, 140
65     PLOT 0, -40, -40
66     PLOT 81, 80, 0
67     GCOL %001100
68     RECTANGLE FILL 0, 0, 1280, 100
69     IF b1y% > 0 THEN
70     GCOL %010011
71     CIRCLE FILL b1x%, b1y%, 4
72     ENDIF
73     IF b2y% > 0 THEN
74     GCOL %110001
75     CIRCLE FILL b2x%, b2y%, 4
76     ENDIF
77     IF s% > 0 THEN
78     FOR t% = 1 TO 10
79     IF se%(t%) THEN
80     GCOL RND(%111111)
81     RECTANGLE FILL sx%(t%) - 20, sy%(t%) - 20, 40
82     ENDIF
83     NEXT
84     ENDIF
85     COLOUR %111111
86     PRINT "Red: "+STR$z1% TAB(10)" ";
87     IF zp% = 1 THEN PRINT "<-"; ELSE PRINT " ";
88     PRINT" High: "+STR$zh%;
89     IF zp% = 2 THEN PRINT " ->";
90     PRINTTAB(30) "Blue: "+STR$z2%
91     COLOUR 0
92     COLOUR 128 + %001100 TINT 196
93     PRINTTAB(1, 30) "Level: "+STR$f% TAB(20) "Frames/sec: "+STR$o%
94     ENDPROC
95    
96    
97     DEF PROCm
98     IF INKEY -98 THEN x1% -= 16: IF x1% < 0 THEN x1% = 0
99     IF INKEY -67 THEN x1% += 16: IF x1% > 1280 THEN x1% = 1280
100     IF INKEY -125 THEN x2% -= 16: IF x2% < 0 THEN x2% = 0
101     IF INKEY -109 THEN x2% += 16: IF x2% > 1280 THEN x2% = 1280
102     IF (INKEY -99) AND b1y% < 0 THEN b1y% = 130: b1x% = x1%
103     IF (INKEY -61) AND b2y% < 0 THEN b2y% = 130: b2x% = x2%
104     IF b1y% > 0 THEN b1y% += 40: IF b1y% > 1000 THEN b1y% = -100
105     IF b2y% > 0 THEN b2y% += 40: IF b2y% > 1000 THEN b2y% = -100
106     IF RND(50) = 1 AND s% < 10 THEN
107     s% += 1
108     t% = 1
109     WHILE se%(t%) = TRUE
110     t% += 1
111     ENDWHILE
112     sx%(t%) = RND(1200)
113     sy%(t%) = 1000
114     sd%(t%) = f%
115     se%(t%) = TRUE
116     e% += 1
117     IF e% = 20 THEN f% += 1: e% = 0
118     ENDIF
119     IF s% > 0 THEN
120     FOR t% = 1 TO 10
121     IF se%(t%) THEN
122     sy%(t%) -= sd%(t%)
123     IF sy%(t%) < 120 THEN
124     s% = 0
125     FOR u% = 1 TO 10
126     se%(u%) = FALSE
127     NEXT
128     IF z1% > zh% THEN zh% = z1%: zp% = 1
129     IF z2% > zh% THEN zh% = z2%: zp% = 2
130     z1% = 0
131     z2% = 0
132     e% = 0
133     f% = 1
134     ELSE
135     IF b1y% > 0 THEN
136     IF (sx%(t%) - 20 < b1x%) AND (sx%(t%) + 20 > b1x%) AND (b1y% > sy%(t%) - 20) THEN s% -= 1: se%(t%) = FALSE: z1% += sy%(t%) / 10: b1y% = -100
137     ENDIF
138     IF b2y% > 0 THEN
139     IF (sx%(t%) - 20 < b2x%) AND (sx%(t%) + 20 > b2x%) AND (b2y% > sy%(t%) - 20) THEN s% -= 1: se%(t%) = FALSE: z2% += sy%(t%) / 10: b2y% = -100
140     ENDIF
141     ENDIF
142     ENDIF
143     NEXT
144     ENDIF
145     ENDPROC

  ViewVC Help
Powered by ViewVC 1.1.26