Rev 109 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 109 | Rev 485 | ||
---|---|---|---|
1 | ; |
1 | ; |
2 | ; Arcanoid Gaem 4Ver Mini Sample by Pavlushin Evgeni for ASCL |
2 | ; Arcanoid Gaem 4Ver Mini Sample by Pavlushin Evgeni for ASCL |
3 | ; www.waptap@mail.ru www.cyberdeck.fatal.ru www.deck4.narod.ru |
3 | ; www.waptap@mail.ru www.cyberdeck.fatal.ru www.deck4.narod.ru |
4 | ; Play again and exit button added |
4 | ; Play again and exit button added |
5 | ; |
5 | ; |
6 | ; 3Ver Play again, Exit button. |
6 | ; 3Ver Play again, Exit button. |
7 | ; 4Ver Next level function. |
7 | ; 4Ver Next level function. |
8 | ; |
8 | ; |
9 | ;****************************************************************************** |
9 | ;****************************************************************************** |
10 | use32 |
10 | use32 |
11 | org 0x0 |
11 | org 0x0 |
12 | db 'MENUET01' ; 8 byte id |
12 | db 'MENUET01' ; 8 byte id |
13 | dd 0x01 ; header version |
13 | dd 0x01 ; header version |
14 | dd START ; start of code |
14 | dd START ; start of code |
15 | dd IM_END ; size of image |
15 | dd IM_END ; size of image |
16 | dd 0x300000 ; memory for app |
16 | dd 0x300000 ; memory for app |
17 | dd 0x300000 ; esp |
17 | dd 0x300000 ; esp |
18 | dd 0x0 , 0x0 ; I_Param , I_Icon |
18 | dd 0x0 , 0x0 ; I_Param , I_Icon |
19 | 19 | ||
20 | ;****************************************************************************** |
20 | ;****************************************************************************** |
21 | 21 | ||
22 | include 'lang.inc' |
22 | include 'lang.inc' |
- | 23 | include '..\..\..\macros.inc' |
|
23 | include 'ascl.inc' |
24 | include 'ascl.inc' |
24 | include 'ascgl.inc' |
25 | include 'ascgl.inc' |
25 | include 'ascgml.inc' |
26 | include 'ascgml.inc' |
26 | 27 | ||
27 | 28 | ||
28 | START: ; start of execution |
29 | START: ; start of execution |
29 | bmptoimg arc_file,pong |
30 | bmptoimg arc_file,pong |
30 | getimg pong,0,0,80,4,img |
31 | getimg pong,0,0,80,4,img |
31 | getimg pong,0,4,80,4,img2 |
32 | getimg pong,0,4,80,4,img2 |
32 | getimg pong,5,38,15,15,img3 |
33 | getimg pong,5,38,15,15,img3 |
33 | getimg pong,0,8,80,20,img5 |
34 | getimg pong,0,8,80,20,img5 |
34 | fullimg img4 , 80 ,20 ,0x00000000 ;black for rocket |
35 | fullimg img4 , 80 ,20 ,0x00000000 ;black for rocket |
35 | fullimg img6 , 15 ,15 ,0x00000000 ;black for ball |
36 | fullimg img6 , 15 ,15 ,0x00000000 ;black for ball |
36 | fullimg img7a , 60,20,0x0000cf00 |
37 | fullimg img7a , 60,20,0x0000cf00 |
37 | fullimg img7b , 60,20,0x00af0000 |
38 | fullimg img7b , 60,20,0x00af0000 |
38 | fullimg img7c , 60,20,0x000000cf |
39 | fullimg img7c , 60,20,0x000000cf |
39 | fullimg img8 , 60,20,0x00000000 |
40 | fullimg img8 , 60,20,0x00000000 |
40 | 41 | ||
41 | call draw_window |
42 | call draw_window |
42 | 43 | ||
43 | still: |
44 | still: |
44 | 45 | ||
45 | scevent red,key,button |
46 | scevent red,key,button |
46 | 47 | ||
47 | cmp [againbut],1 |
48 | cmp [againbut],1 |
48 | je stl2 |
49 | je stl2 |
49 | 50 | ||
50 | outcount dword [scoreb],256,8,cl_Blue,5*65536 |
51 | outcount dword [scoreb],256,8,cl_Blue,5*65536 |
51 | outcount dword [scorea],332,8,cl_Red,5*65536 |
52 | outcount dword [scorea],332,8,cl_Red,5*65536 |
52 | outcount dword [level],368,8,cl_White,2*65536 |
53 | outcount dword [level],368,8,cl_White,2*65536 |
53 | 54 | ||
54 | del_images: |
55 | del_images: |
55 | setimg dword [ply1x],dword [ply1y],img4 |
56 | setimg dword [ply1x],dword [ply1y],img4 |
56 | setimg dword [ballx],dword [bally],img6 |
57 | setimg dword [ballx],dword [bally],img6 |
57 | setimg dword [gravx],dword [gravy],img4 |
58 | setimg dword [gravx],dword [gravy],img4 |
58 | 59 | ||
59 | del_blocks: |
60 | del_blocks: |
60 | mov ecx,0 |
61 | mov ecx,0 |
61 | xxx: |
62 | xxx: |
62 | pushad |
63 | pushad |
63 | mov esi,dword [mass+ecx] |
64 | mov esi,dword [mass+ecx] |
64 | mov edi,dword [mass+ecx+4] |
65 | mov edi,dword [mass+ecx+4] |
65 | mov ebp,dword [mass+ecx+8] |
66 | mov ebp,dword [mass+ecx+8] |
66 | cmp ebp,0 |
67 | cmp ebp,0 |
67 | jne notptx |
68 | jne notptx |
68 | setimg esi,edi,img8 |
69 | setimg esi,edi,img8 |
69 | notptx: |
70 | notptx: |
70 | popad |
71 | popad |
71 | add ecx,12 |
72 | add ecx,12 |
72 | cmp ecx,[blocks_max] |
73 | cmp ecx,[blocks_max] |
73 | jne xxx |
74 | jne xxx |
74 | 75 | ||
75 | 76 | ||
76 | 77 | ||
77 | move_ply1: |
78 | move_ply1: |
78 | 79 | ||
79 | correct [ply1x],[ply1rx],2 |
80 | correct [ply1x],[ply1rx],2 |
80 | correct [ply1y],[ply1ry],2 |
81 | correct [ply1y],[ply1ry],2 |
81 | 82 | ||
82 | ;automove ball |
83 | ;automove ball |
83 | mov eax,dword [ballxv] |
84 | mov eax,dword [ballxv] |
84 | add dword [ballx],eax |
85 | add dword [ballx],eax |
85 | mov eax,dword [ballyv] |
86 | mov eax,dword [ballyv] |
86 | add dword [bally],eax |
87 | add dword [bally],eax |
87 | 88 | ||
88 | ;autoslow ball for rocket gravitation (Space key) |
89 | ;autoslow ball for rocket gravitation (Space key) |
89 | cmp dword [ballxv],0 |
90 | cmp dword [ballxv],0 |
90 | jl ballb |
91 | jl ballb |
91 | balla: |
92 | balla: |
92 | cmp dword [ballxv],2 |
93 | cmp dword [ballxv],2 |
93 | jng balln |
94 | jng balln |
94 | dec dword [ballxv] |
95 | dec dword [ballxv] |
95 | jmp balln |
96 | jmp balln |
96 | ballb: |
97 | ballb: |
97 | cmp dword [ballxv],-2 |
98 | cmp dword [ballxv],-2 |
98 | jnl balln |
99 | jnl balln |
99 | inc dword [ballxv] |
100 | inc dword [ballxv] |
100 | jmp balln |
101 | jmp balln |
101 | balln: |
102 | balln: |
102 | cmp dword [ballyv],2 |
103 | cmp dword [ballyv],2 |
103 | jng by_n |
104 | jng by_n |
104 | dec dword [ballyv] |
105 | dec dword [ballyv] |
105 | by_n: |
106 | by_n: |
106 | 107 | ||
107 | ;ball collusion of screen |
108 | ;ball collusion of screen |
108 | cmp dword [ballx],400-12 |
109 | cmp dword [ballx],400-12 |
109 | jna xa_ok |
110 | jna xa_ok |
110 | neg dword [ballxv] |
111 | neg dword [ballxv] |
111 | xa_ok: |
112 | xa_ok: |
112 | cmp dword [ballx],6 |
113 | cmp dword [ballx],6 |
113 | jnb xb_ok |
114 | jnb xb_ok |
114 | neg dword [ballxv] |
115 | neg dword [ballxv] |
115 | xb_ok: |
116 | xb_ok: |
116 | 117 | ||
117 | cmp dword [bally],30 |
118 | cmp dword [bally],30 |
118 | jnb yb_ok |
119 | jnb yb_ok |
119 | neg dword [ballyv] |
120 | neg dword [ballyv] |
120 | yb_ok: |
121 | yb_ok: |
121 | 122 | ||
122 | 123 | ||
123 | ;if ball far out of screen come back |
124 | ;if ball far out of screen come back |
124 | cmp dword [bally],466 |
125 | cmp dword [bally],466 |
125 | jng yax_ok |
126 | jng yax_ok |
126 | call draw_window |
127 | call draw_window |
127 | dec dword [scoreb] |
128 | dec dword [scoreb] |
128 | mov eax,[ply1ry] |
129 | mov eax,[ply1ry] |
129 | sub eax,6 |
130 | sub eax,6 |
130 | mov dword [bally],eax ;240 |
131 | mov dword [bally],eax ;240 |
131 | mov eax,[ply1rx] |
132 | mov eax,[ply1rx] |
132 | add eax,30 |
133 | add eax,30 |
133 | mov dword [ballx],eax ;200 |
134 | mov dword [ballx],eax ;200 |
134 | mov dword [ballyv],2 |
135 | mov dword [ballyv],2 |
135 | random 3,dword [ballxv] |
136 | random 3,dword [ballxv] |
136 | sub dword [ballxv],1 |
137 | sub dword [ballxv],1 |
137 | yax_ok: |
138 | yax_ok: |
138 | 139 | ||
139 | xorx: |
140 | xorx: |
140 | cmp dword [ballxv],0 |
141 | cmp dword [ballxv],0 |
141 | jne norx |
142 | jne norx |
142 | random 3,dword [ballxv] |
143 | random 3,dword [ballxv] |
143 | sub dword [ballxv],1 |
144 | sub dword [ballxv],1 |
144 | cmp dword [ballxv],0 |
145 | cmp dword [ballxv],0 |
145 | je xorx |
146 | je xorx |
146 | norx: |
147 | norx: |
147 | 148 | ||
148 | ;test on collusion ply1 of ball |
149 | ;test on collusion ply1 of ball |
149 | collusion_test: |
150 | collusion_test: |
150 | collimg img,[ply1x],[ply1y],img3,[ballx],[bally],eax |
151 | collimg img,[ply1x],[ply1y],img3,[ballx],[bally],eax |
151 | cmp eax,1 |
152 | cmp eax,1 |
152 | jne not_coll |
153 | jne not_coll |
153 | neg dword [ballyv] |
154 | neg dword [ballyv] |
154 | sub dword [bally],4 |
155 | sub dword [bally],4 |
155 | ; neg dword [ballxv] |
156 | ; neg dword [ballxv] |
156 | not_coll: |
157 | not_coll: |
157 | 158 | ||
158 | ;test on collusion gravity of ball |
159 | ;test on collusion gravity of ball |
159 | collusion_grav: |
160 | collusion_grav: |
160 | collimg img,[gravx],[gravy],img3,[ballx],[bally],eax |
161 | collimg img,[gravx],[gravy],img3,[ballx],[bally],eax |
161 | cmp eax,1 |
162 | cmp eax,1 |
162 | jne not_collg |
163 | jne not_collg |
163 | sub dword [bally],30 |
164 | sub dword [bally],30 |
164 | neg dword [ballyv] |
165 | neg dword [ballyv] |
165 | cmp dword [ballyv],0 |
166 | cmp dword [ballyv],0 |
166 | jl ab |
167 | jl ab |
167 | jg bf |
168 | jg bf |
168 | jmp not_collgx |
169 | jmp not_collgx |
169 | ab: |
170 | ab: |
170 | sub dword [ballyv],10 |
171 | sub dword [ballyv],10 |
171 | jmp not_collgx |
172 | jmp not_collgx |
172 | bf: |
173 | bf: |
173 | add dword [ballyv],10 |
174 | add dword [ballyv],10 |
174 | not_collgx: |
175 | not_collgx: |
175 | cmp dword [ballxv],0 |
176 | cmp dword [ballxv],0 |
176 | jl abx |
177 | jl abx |
177 | jg bfx |
178 | jg bfx |
178 | jmp not_collg |
179 | jmp not_collg |
179 | abx: |
180 | abx: |
180 | sub dword [ballxv],0 ;8 ;15 |
181 | sub dword [ballxv],0 ;8 ;15 |
181 | jmp not_collg |
182 | jmp not_collg |
182 | bfx: |
183 | bfx: |
183 | add dword [ballxv],0 ;8 |
184 | add dword [ballxv],0 ;8 |
184 | 185 | ||
185 | 186 | ||
186 | ; mov dword [ballyv],20 |
187 | ; mov dword [ballyv],20 |
187 | not_collg: |
188 | not_collg: |
188 | 189 | ||
189 | ;ply contorl |
190 | ;ply contorl |
190 | control 12,316,[ply1rx] |
191 | control 12,316,[ply1rx] |
191 | control 380,470,[ply1ry] |
192 | control 380,470,[ply1ry] |
192 | 193 | ||
193 | ;garvity |
194 | ;garvity |
194 | gravity: |
195 | gravity: |
195 | cmp dword [gravtime],0 |
196 | cmp dword [gravtime],0 |
196 | je no_dg |
197 | je no_dg |
197 | dec dword [gravtime] |
198 | dec dword [gravtime] |
198 | no_dg: |
199 | no_dg: |
199 | 200 | ||
200 | draw_gravity: |
201 | draw_gravity: |
201 | cmp dword [gravtime],0 |
202 | cmp dword [gravtime],0 |
202 | je nograv |
203 | je nograv |
203 | mov eax,dword [ply1x] |
204 | mov eax,dword [ply1x] |
204 | mov ebx,dword [ply1y] |
205 | mov ebx,dword [ply1y] |
205 | sub ebx,30 |
206 | sub ebx,30 |
206 | mov dword [gravx],eax |
207 | mov dword [gravx],eax |
207 | mov dword [gravy],ebx |
208 | mov dword [gravy],ebx |
208 | jmp endgrav |
209 | jmp endgrav |
209 | nograv: |
210 | nograv: |
210 | mov dword [gravx],1000 |
211 | mov dword [gravx],1000 |
211 | mov dword [gravy],1000 |
212 | mov dword [gravy],1000 |
212 | endgrav: |
213 | endgrav: |
213 | 214 | ||
214 | redraw_images: |
215 | redraw_images: |
215 | setimg dword [ply1x],dword [ply1y],img2 |
216 | setimg dword [ply1x],dword [ply1y],img2 |
216 | setimg dword [ballx],dword [bally],img3 |
217 | setimg dword [ballx],dword [bally],img3 |
217 | setimg dword [gravx],dword [gravy],img5 |
218 | setimg dword [gravx],dword [gravy],img5 |
218 | 219 | ||
219 | draw_blocks: |
220 | draw_blocks: |
220 | mov ecx,0 |
221 | mov ecx,0 |
221 | xxx2: |
222 | xxx2: |
222 | pushad |
223 | pushad |
223 | mov esi,dword [mass+ecx] |
224 | mov esi,dword [mass+ecx] |
224 | mov edi,dword [mass+ecx+4] |
225 | mov edi,dword [mass+ecx+4] |
225 | mov ebp,dword [mass+ecx+8] |
226 | mov ebp,dword [mass+ecx+8] |
226 | cmp ebp,0 |
227 | cmp ebp,0 |
227 | je notpt |
228 | je notpt |
228 | cmp ebp,1 |
229 | cmp ebp,1 |
229 | jne no_a |
230 | jne no_a |
230 | setimg esi,edi,img7a |
231 | setimg esi,edi,img7a |
231 | jmp notpt |
232 | jmp notpt |
232 | no_a: |
233 | no_a: |
233 | cmp ebp,2 |
234 | cmp ebp,2 |
234 | jne no_b |
235 | jne no_b |
235 | setimg esi,edi,img7b |
236 | setimg esi,edi,img7b |
236 | jmp notpt |
237 | jmp notpt |
237 | no_b: |
238 | no_b: |
238 | cmp ebp,3 |
239 | cmp ebp,3 |
239 | jne no_c |
240 | jne no_c |
240 | setimg esi,edi,img7c |
241 | setimg esi,edi,img7c |
241 | jmp notpt |
242 | jmp notpt |
242 | no_c: |
243 | no_c: |
243 | 244 | ||
244 | notpt: |
245 | notpt: |
245 | popad |
246 | popad |
246 | add ecx,12 |
247 | add ecx,12 |
247 | cmp ecx,[blocks_max] |
248 | cmp ecx,[blocks_max] |
248 | jne xxx2 |
249 | jne xxx2 |
249 | 250 | ||
250 | ;collusion ball of blocks |
251 | ;collusion ball of blocks |
251 | coll_blocks: |
252 | coll_blocks: |
252 | mov [temp3],0 |
253 | mov [temp3],0 |
253 | mov ecx,0 |
254 | mov ecx,0 |
254 | testloop: |
255 | testloop: |
255 | pushad |
256 | pushad |
256 | mov ebp,dword [mass+ecx+8] |
257 | mov ebp,dword [mass+ecx+8] |
257 | cmp ebp,0 |
258 | cmp ebp,0 |
258 | jne testcol |
259 | jne testcol |
259 | jmp notest |
260 | jmp notest |
260 | testcol: |
261 | testcol: |
261 | mov [temp3],1 |
262 | mov [temp3],1 |
262 | mov esi,dword [mass+ecx] |
263 | mov esi,dword [mass+ecx] |
263 | mov edi,dword [mass+ecx+4] |
264 | mov edi,dword [mass+ecx+4] |
264 | mov [temp1],esi |
265 | mov [temp1],esi |
265 | mov [temp2],edi |
266 | mov [temp2],edi |
266 | push ecx |
267 | push ecx |
267 | collimg img8,[temp1],[temp2],img3,[ballx],[bally],eax |
268 | collimg img8,[temp1],[temp2],img3,[ballx],[bally],eax |
268 | pop ecx |
269 | pop ecx |
269 | cmp eax,1 |
270 | cmp eax,1 |
270 | jne notest |
271 | jne notest |
271 | mov dword [mass+ecx+8],0 |
272 | mov dword [mass+ecx+8],0 |
272 | ; neg [ballxv] |
273 | ; neg [ballxv] |
273 | neg [ballyv] |
274 | neg [ballyv] |
274 | add [scorea],30 |
275 | add [scorea],30 |
275 | call draw_window |
276 | call draw_window |
276 | jmp end_col |
277 | jmp end_col |
277 | notest: |
278 | notest: |
278 | popad |
279 | popad |
279 | add ecx,12 |
280 | add ecx,12 |
280 | cmp ecx,[blocks_max] |
281 | cmp ecx,[blocks_max] |
281 | jne testloop |
282 | jne testloop |
282 | end_col: |
283 | end_col: |
283 | 284 | ||
284 | cmp [delay_cnt],0 |
285 | cmp [delay_cnt],0 |
285 | jne no_delay |
286 | jne no_delay |
286 | mov [delay_cnt],1 |
287 | mov [delay_cnt],1 |
287 | delay 1 ;don't generate delay for fast speed programm |
288 | delay 1 ;don't generate delay for fast speed programm |
288 | no_delay: |
289 | no_delay: |
289 | dec [delay_cnt] |
290 | dec [delay_cnt] |
290 | 291 | ||
291 | win_test: |
292 | win_test: |
292 | cmp [temp3],1 |
293 | cmp [temp3],1 |
293 | je stl |
294 | je stl |
294 | ; inc [level] |
295 | ; inc [level] |
295 | mov [nextlev],1 |
296 | mov [nextlev],1 |
296 | mov [againbut],1 |
297 | mov [againbut],1 |
297 | call draw_window |
298 | call draw_window |
298 | ; label 160,200,'You Win!',cl_Green+font_Big |
299 | ; label 160,200,'You Win!',cl_Green+font_Big |
299 | ; label 130,220,'Youre Score:',cl_Green+font_Big |
300 | ; label 130,220,'Youre Score:',cl_Green+font_Big |
300 | ; outcount dword [scorea],230,220,cl_Green,5*65536 |
301 | ; outcount dword [scorea],230,220,cl_Green,5*65536 |
301 | ; label 130,234,'Youre Lives:',cl_Green+font_Big |
302 | ; label 130,234,'Youre Lives:',cl_Green+font_Big |
302 | ; outcount dword [scoreb],230,234,cl_Green,5*65536 |
303 | ; outcount dword [scoreb],230,234,cl_Green,5*65536 |
303 | ; delay 600 ;wait 2sec |
304 | ; delay 600 ;wait 2sec |
304 | ; close ;exit from program |
305 | ; close ;exit from program |
305 | stl: |
306 | stl: |
306 | 307 | ||
307 | lose_test: |
308 | lose_test: |
308 | cmp [scoreb],0 |
309 | cmp [scoreb],0 |
309 | jne stl2 |
310 | jne stl2 |
310 | ; call draw_window |
311 | ; call draw_window |
311 | ; label 160,200,'You Lose!',cl_Red+font_Big |
312 | ; label 160,200,'You Lose!',cl_Red+font_Big |
312 | ; label 130,220,'Youre Score:',cl_Red+font_Big |
313 | ; label 130,220,'Youre Score:',cl_Red+font_Big |
313 | ; outcount dword [scorea],230,220,cl_Red,5*65536 |
314 | ; outcount dword [scorea],230,220,cl_Red,5*65536 |
314 | ; delay 300 ;wait 2sec |
315 | ; delay 300 ;wait 2sec |
315 | ; close ;exit from program |
316 | ; close ;exit from program |
316 | ; mov ebx,10*65536+40 |
317 | ; mov ebx,10*65536+40 |
317 | ; mov ebx,10*65536+20 |
318 | ; mov ebx,10*65536+20 |
318 | ; mov edx,2 |
319 | ; mov edx,2 |
319 | ; mov esi,0x0000ff00 |
320 | ; mov esi,0x0000ff00 |
320 | ; mov eax,8 |
321 | ; mov eax,8 |
321 | ; int 0x40 |
322 | ; mcall |
322 | mov [level],0 |
323 | mov [level],0 |
323 | mov [nextlev],0 |
324 | mov [nextlev],0 |
324 | mov [againbut],1 |
325 | mov [againbut],1 |
325 | call draw_window |
326 | call draw_window |
326 | 327 | ||
327 | stl2: |
328 | stl2: |
328 | 329 | ||
329 | jmp still |
330 | jmp still |
330 | 331 | ||
331 | red: |
332 | red: |
332 | call draw_window |
333 | call draw_window |
333 | jmp still |
334 | jmp still |
334 | 335 | ||
335 | key: ; key |
336 | key: ; key |
336 | mov eax,2 |
337 | mov eax,2 |
337 | int 0x40 |
338 | mcall |
338 | cmp ah,key_Left |
339 | cmp ah,key_Left |
339 | jne no_l |
340 | jne no_l |
340 | sub dword [ply1rx],50 ;24 ;16 |
341 | sub dword [ply1rx],50 ;24 ;16 |
341 | no_l: |
342 | no_l: |
342 | cmp ah,key_Right |
343 | cmp ah,key_Right |
343 | jne no_r |
344 | jne no_r |
344 | add dword [ply1rx],50 ;24 ;16 |
345 | add dword [ply1rx],50 ;24 ;16 |
345 | no_r: |
346 | no_r: |
346 | cmp ah,key_Up |
347 | cmp ah,key_Up |
347 | jne no_u |
348 | jne no_u |
348 | sub dword [ply1ry],20 |
349 | sub dword [ply1ry],20 |
349 | no_u: |
350 | no_u: |
350 | cmp ah,key_Down |
351 | cmp ah,key_Down |
351 | jne no_d |
352 | jne no_d |
352 | add dword [ply1ry],20 |
353 | add dword [ply1ry],20 |
353 | no_d: |
354 | no_d: |
354 | cmp ah,key_Space |
355 | cmp ah,key_Space |
355 | jne no_sp |
356 | jne no_sp |
356 | mov dword [gravtime],100 |
357 | mov dword [gravtime],100 |
357 | no_sp: |
358 | no_sp: |
358 | jmp still |
359 | jmp still |
359 | 360 | ||
360 | button: ; button |
361 | button: ; button |
361 | mov eax,17 ; get id |
362 | mov eax,17 ; get id |
362 | int 0x40 |
363 | mcall |
363 | cmp ah,1 ; button id=1 ? |
364 | cmp ah,1 ; button id=1 ? |
364 | jne noclose |
365 | jne noclose |
365 | mov eax,-1 ; close this program |
366 | mov eax,-1 ; close this program |
366 | int 0x40 |
367 | mcall |
367 | noclose: |
368 | noclose: |
368 | cmp ah,2 |
369 | cmp ah,2 |
369 | jne noplayagain |
370 | jne noplayagain |
370 | mov [xt],100 |
371 | mov [xt],100 |
371 | mov [yt],100 |
372 | mov [yt],100 |
372 | mov [gravtime],10 |
373 | mov [gravtime],10 |
373 | mov [gravx],1000 |
374 | mov [gravx],1000 |
374 | mov [gravy],1000 |
375 | mov [gravy],1000 |
375 | mov [ply1rx],160 |
376 | mov [ply1rx],160 |
376 | mov [ply1ry],460 |
377 | mov [ply1ry],460 |
377 | mov [ply1x],160 |
378 | mov [ply1x],160 |
378 | mov [ply1y],400 |
379 | mov [ply1y],400 |
379 | mov [ballx],200 |
380 | mov [ballx],200 |
380 | mov [bally],300 |
381 | mov [bally],300 |
381 | mov [ballyv],2 |
382 | mov [ballyv],2 |
382 | mov [ballxv],1 |
383 | mov [ballxv],1 |
383 | 384 | ||
384 | cmp [nextlev],1 |
385 | cmp [nextlev],1 |
385 | je noch |
386 | je noch |
386 | mov [scorex],0 |
387 | mov [scorex],0 |
387 | mov [scorea],0 |
388 | mov [scorea],0 |
388 | mov [scoreb],3 |
389 | mov [scoreb],3 |
389 | jmp noch2 |
390 | jmp noch2 |
390 | noch: |
391 | noch: |
391 | inc [scoreb] |
392 | inc [scoreb] |
392 | inc [level] |
393 | inc [level] |
393 | mov eax,[maxlev] |
394 | mov eax,[maxlev] |
394 | cmp [level],eax |
395 | cmp [level],eax |
395 | jna noch2 |
396 | jna noch2 |
396 | mov [level],eax |
397 | mov [level],eax |
397 | noch2: |
398 | noch2: |
398 | 399 | ||
399 | mov eax,18*4*5 |
400 | mov eax,18*4*5 |
400 | mul [level] |
401 | mul [level] |
401 | mov ebp,eax |
402 | mov ebp,eax |
402 | add ebp,levels |
403 | add ebp,levels |
403 | mov ecx,18*4*5 ;bytes |
404 | mov ecx,18*4*5 ;bytes |
404 | loo: |
405 | loo: |
405 | mov eax,dword [ebp+ecx] |
406 | mov eax,dword [ebp+ecx] |
406 | mov dword [mass+ecx],eax |
407 | mov dword [mass+ecx],eax |
407 | sub ecx,4 |
408 | sub ecx,4 |
408 | jnz loo |
409 | jnz loo |
409 | 410 | ||
410 | mov [againbut],0 |
411 | mov [againbut],0 |
411 | 412 | ||
412 | call draw_window |
413 | call draw_window |
413 | noplayagain: |
414 | noplayagain: |
414 | jmp still |
415 | jmp still |
415 | 416 | ||
416 | 417 | ||
417 | draw_window: |
418 | draw_window: |
418 | startwd |
419 | startwd |
419 | window 0,0,400+8,480+24,window_Skinned |
420 | window 0,0,400+8,480+24,window_Skinned |
420 | label 12,8,'ARCANOID: USE ARROW KEYS LIVES SCORE',cl_White+font_Big |
421 | label 12,8,'ARCANOID: USE ARROW KEYS LIVES SCORE',cl_White+font_Big |
421 | 422 | ||
422 | cmp [againbut],0 |
423 | cmp [againbut],0 |
423 | je no_againbut |
424 | je no_againbut |
424 | 425 | ||
425 | cmp [nextlev],1 |
426 | cmp [nextlev],1 |
426 | je nlev |
427 | je nlev |
427 | label 160,200,'You Lose!',cl_Red+font_Big |
428 | label 160,200,'You Lose!',cl_Red+font_Big |
428 | label 130,220,'Youre Score:',cl_Red+font_Big |
429 | label 130,220,'Youre Score:',cl_Red+font_Big |
429 | outcount dword [scorea],230,220,cl_Red,5*65536 |
430 | outcount dword [scorea],230,220,cl_Red,5*65536 |
430 | mov ebx,150*65536+80 |
431 | mov ebx,150*65536+80 |
431 | mov ecx,240*65536+12 |
432 | mov ecx,240*65536+12 |
432 | mov edx,2 |
433 | mov edx,2 |
433 | mov esi,0x0000aa00 |
434 | mov esi,0x0000aa00 |
434 | mov eax,8 |
435 | mov eax,8 |
435 | int 0x40 |
436 | mcall |
436 | mov ecx,260*65536+12 |
437 | mov ecx,260*65536+12 |
437 | mov edx,1 |
438 | mov edx,1 |
438 | int 0x40 |
439 | mcall |
439 | label 152,244,'Play again?',cl_Red+font_Big |
440 | label 152,244,'Play again?',cl_Red+font_Big |
440 | jmp elev |
441 | jmp elev |
441 | nlev: |
442 | nlev: |
442 | label 160,200,'You Win!',cl_Green+font_Big |
443 | label 160,200,'You Win!',cl_Green+font_Big |
443 | label 130,220,'Youre Score:',cl_Green+font_Big |
444 | label 130,220,'Youre Score:',cl_Green+font_Big |
444 | outcount dword [scorea],230,220,cl_Green,5*65536 |
445 | outcount dword [scorea],230,220,cl_Green,5*65536 |
445 | mov ebx,150*65536+80 |
446 | mov ebx,150*65536+80 |
446 | mov ecx,240*65536+12 |
447 | mov ecx,240*65536+12 |
447 | mov edx,2 |
448 | mov edx,2 |
448 | mov esi,0x0000aa00 |
449 | mov esi,0x0000aa00 |
449 | mov eax,8 |
450 | mov eax,8 |
450 | int 0x40 |
451 | mcall |
451 | mov ecx,260*65536+12 |
452 | mov ecx,260*65536+12 |
452 | mov edx,1 |
453 | mov edx,1 |
453 | int 0x40 |
454 | mcall |
454 | label 152,244,'Next level?',cl_Red+font_Big |
455 | label 152,244,'Next level?',cl_Red+font_Big |
455 | elev: |
456 | elev: |
456 | 457 | ||
457 | label 178,264,'Exit?',cl_Red+font_Big |
458 | label 178,264,'Exit?',cl_Red+font_Big |
458 | no_againbut: |
459 | no_againbut: |
459 | 460 | ||
460 | endwd |
461 | endwd |
461 | ret |
462 | ret |
462 | 463 | ||
463 | 464 | ||
464 | ; DATA AREA |
465 | ; DATA AREA |
465 | againbut dd 0 |
466 | againbut dd 0 |
466 | 467 | ||
467 | xt dd 100 |
468 | xt dd 100 |
468 | yt dd 100 |
469 | yt dd 100 |
469 | 470 | ||
470 | gravtime dd 10 |
471 | gravtime dd 10 |
471 | gravx dd 1000 |
472 | gravx dd 1000 |
472 | gravy dd 1000 |
473 | gravy dd 1000 |
473 | 474 | ||
474 | ply1rx dd 160 |
475 | ply1rx dd 160 |
475 | ply1ry dd 460 |
476 | ply1ry dd 460 |
476 | 477 | ||
477 | ply1x dd 160 |
478 | ply1x dd 160 |
478 | ply1y dd 400 |
479 | ply1y dd 400 |
479 | 480 | ||
480 | ballx dd 200 |
481 | ballx dd 200 |
481 | bally dd 300 |
482 | bally dd 300 |
482 | 483 | ||
483 | ballyv dd 2 |
484 | ballyv dd 2 |
484 | ballxv dd 1 |
485 | ballxv dd 1 |
485 | 486 | ||
486 | temp1 dd 0 |
487 | temp1 dd 0 |
487 | temp2 dd 0 |
488 | temp2 dd 0 |
488 | temp3 dd 0 |
489 | temp3 dd 0 |
489 | 490 | ||
490 | scorex dd 0 |
491 | scorex dd 0 |
491 | scorea dd 0 |
492 | scorea dd 0 |
492 | scoreb dd 3 |
493 | scoreb dd 3 |
493 | 494 | ||
494 | level dd 0 |
495 | level dd 0 |
495 | nextlev dd 0 |
496 | nextlev dd 0 |
496 | maxlev dd 2 |
497 | maxlev dd 2 |
497 | 498 | ||
498 | counter dd 0 |
499 | counter dd 0 |
499 | tsoi dd 0 |
500 | tsoi dd 0 |
500 | 501 | ||
501 | delay_cnt dd 0 |
502 | delay_cnt dd 0 |
502 | 503 | ||
503 | blocks_max dd 6*5*12 ;size in bytes 5*3 dd |
504 | blocks_max dd 6*5*12 ;size in bytes 5*3 dd |
504 | 505 | ||
505 | mass: |
506 | mass: |
506 | dd 30,200,0 ,90,200,0 ,150,200,0 ,210,200,0 ,270,200,0 ,330,200,0 |
507 | dd 30,200,0 ,90,200,0 ,150,200,0 ,210,200,0 ,270,200,0 ,330,200,0 |
507 | dd 30,180,0 ,90,180,0 ,150,180,0 ,210,180,0 ,270,180,0 ,330,180,0 |
508 | dd 30,180,0 ,90,180,0 ,150,180,0 ,210,180,0 ,270,180,0 ,330,180,0 |
508 | dd 30,160,0 ,90,160,0 ,150,160,0 ,210,160,0 ,270,160,0 ,330,160,0 |
509 | dd 30,160,0 ,90,160,0 ,150,160,0 ,210,160,0 ,270,160,0 ,330,160,0 |
509 | dd 30,140,0 ,90,140,1 ,150,140,1 ,210,140,1 ,270,140,0 ,330,140,0 |
510 | dd 30,140,0 ,90,140,1 ,150,140,1 ,210,140,1 ,270,140,0 ,330,140,0 |
510 | dd 30,120,0 ,90,120,0 ,150,120,0 ,210,120,0 ,270,120,0 ,330,120,0 |
511 | dd 30,120,0 ,90,120,0 ,150,120,0 ,210,120,0 ,270,120,0 ,330,120,0 |
511 | 512 | ||
512 | levels: |
513 | levels: |
513 | dd 30,200,0 ,90,200,0 ,150,200,0 ,210,200,2 ,270,200,0 ,330,200,0 |
514 | dd 30,200,0 ,90,200,0 ,150,200,0 ,210,200,2 ,270,200,0 ,330,200,0 |
514 | dd 30,180,2 ,90,180,1 ,150,180,1 ,210,180,2 ,270,180,2 ,330,180,0 |
515 | dd 30,180,2 ,90,180,1 ,150,180,1 ,210,180,2 ,270,180,2 ,330,180,0 |
515 | dd 30,160,1 ,90,160,3 ,150,160,1 ,210,160,2 ,270,160,2 ,330,160,2 |
516 | dd 30,160,1 ,90,160,3 ,150,160,1 ,210,160,2 ,270,160,2 ,330,160,2 |
516 | dd 30,140,2 ,90,140,1 ,150,140,1 ,210,140,2 ,270,140,2 ,330,140,0 |
517 | dd 30,140,2 ,90,140,1 ,150,140,1 ,210,140,2 ,270,140,2 ,330,140,0 |
517 | dd 30,120,0 ,90,120,0 ,150,120,0 ,210,120,2 ,270,120,0 ,330,120,0 |
518 | dd 30,120,0 ,90,120,0 ,150,120,0 ,210,120,2 ,270,120,0 ,330,120,0 |
518 | ;level2 |
519 | ;level2 |
519 | dd 30,200,0 ,90,200,3 ,150,200,0 ,210,200,2 ,270,200,2 ,330,200,2 |
520 | dd 30,200,0 ,90,200,3 ,150,200,0 ,210,200,2 ,270,200,2 ,330,200,2 |
520 | dd 30,180,0 ,90,180,1 ,150,180,0 ,210,180,2 ,270,180,2 ,330,180,2 |
521 | dd 30,180,0 ,90,180,1 ,150,180,0 ,210,180,2 ,270,180,2 ,330,180,2 |
521 | dd 30,160,0 ,90,160,3 ,150,160,0 ,210,160,2 ,270,160,2 ,330,160,2 |
522 | dd 30,160,0 ,90,160,3 ,150,160,0 ,210,160,2 ,270,160,2 ,330,160,2 |
522 | dd 30,140,0 ,90,140,1 ,150,140,0 ,210,140,2 ,270,140,2 ,330,140,2 |
523 | dd 30,140,0 ,90,140,1 ,150,140,0 ,210,140,2 ,270,140,2 ,330,140,2 |
523 | dd 30,120,0 ,90,120,3 ,150,120,0 ,210,120,2 ,270,120,2 ,330,120,2 |
524 | dd 30,120,0 ,90,120,3 ,150,120,0 ,210,120,2 ,270,120,2 ,330,120,2 |
524 | ;level3 |
525 | ;level3 |
525 | dd 30,200,1 ,90,200,3 ,150,200,1 ,210,200,2 ,270,200,2 ,330,200,2 |
526 | dd 30,200,1 ,90,200,3 ,150,200,1 ,210,200,2 ,270,200,2 ,330,200,2 |
526 | dd 30,180,2 ,90,180,1 ,150,180,1 ,210,180,2 ,270,180,2 ,330,180,2 |
527 | dd 30,180,2 ,90,180,1 ,150,180,1 ,210,180,2 ,270,180,2 ,330,180,2 |
527 | dd 30,160,1 ,90,160,3 ,150,160,1 ,210,160,2 ,270,160,2 ,330,160,2 |
528 | dd 30,160,1 ,90,160,3 ,150,160,1 ,210,160,2 ,270,160,2 ,330,160,2 |
528 | dd 30,140,2 ,90,140,1 ,150,140,1 ,210,140,2 ,270,140,2 ,330,140,2 |
529 | dd 30,140,2 ,90,140,1 ,150,140,1 ,210,140,2 ,270,140,2 ,330,140,2 |
529 | dd 30,120,1 ,90,120,3 ,150,120,1 ,210,120,2 ,270,120,2 ,330,120,2 |
530 | dd 30,120,1 ,90,120,3 ,150,120,1 ,210,120,2 ,270,120,2 ,330,120,2 |
530 | 531 | ||
531 | arc_file: |
532 | arc_file: |
532 | file 'arc.bmp' |
533 | file 'arc.bmp' |
533 | 534 | ||
534 | rb 20000 |
535 | rb 20000 |
535 | 536 | ||
536 | IM_END: |
537 | IM_END: |
537 | 538 | ||
538 | pong: |
539 | pong: |
539 | rb 80*60*3+8 |
540 | rb 80*60*3+8 |
540 | img: |
541 | img: |
541 | rb 32*32*3+8 |
542 | rb 32*32*3+8 |
542 | img2: |
543 | img2: |
543 | rb 32*32*3+8 |
544 | rb 32*32*3+8 |
544 | img3: |
545 | img3: |
545 | rb 32*32*3+8 |
546 | rb 32*32*3+8 |
546 | img4: |
547 | img4: |
547 | rb 80*20*3+8 |
548 | rb 80*20*3+8 |
548 | img5: |
549 | img5: |
549 | rb 80*20*3+8 |
550 | rb 80*20*3+8 |
550 | img6: |
551 | img6: |
551 | rb 15*15*3+8 |
552 | rb 15*15*3+8 |
552 | img7a: |
553 | img7a: |
553 | rb 60*20*3+8 |
554 | rb 60*20*3+8 |
554 | img7b: |
555 | img7b: |
555 | rb 60*20*3+8 |
556 | rb 60*20*3+8 |
556 | img7c: |
557 | img7c: |
557 | rb 60*20*3+8 |
558 | rb 60*20*3+8 |
558 | img8: |
559 | img8: |
559 | rb 60*40*3+8 |
560 | rb 60*40*3+8 |
560 | 561 | ||
561 | I_END: |
562 | I_END: |