Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1806 | yogev_ezra | 1 | ; level format |
2 | ; [fx|fy]..[field cells x2]..[worm_count]..[worm_len][start cell #][body dirs x2] |
||
3 | |||
4 | ; internal format |
||
5 | ; [stepptr]= worms # |
||
6 | ; area: [worm_len][start_cell #][end_cell #]..[dirs].. |
||
7 | ; [cur_step]: dragged worm pointer |
||
8 | ; [finish]: 0 - if head dragged, 1- if tail |
||
9 | CZ_levelp: |
||
10 | call get_xy_sf |
||
11 | call LP_levelp.bit2 |
||
12 | mov dword[area],5;0 |
||
13 | ret |
||
14 | |||
15 | CZ_key: |
||
16 | mov [jump],still |
||
17 | cmp eax,176 |
||
18 | jb .ex |
||
19 | cmp eax,179 |
||
20 | ja .ex |
||
21 | mov ecx,dword[area] |
||
22 | lea ebx,[eax-176] |
||
23 | mov eax,[player] |
||
24 | call check_bounds |
||
25 | je .ex |
||
26 | cmp ecx,5 |
||
27 | jne .novert |
||
28 | .vert: |
||
29 | add eax,[dirs+ebx*4] |
||
30 | call check_bounds |
||
31 | je .ex |
||
32 | mov ecx,eax |
||
33 | add ecx,[dirs+ebx*4] |
||
34 | mov cl,[field+ecx] |
||
35 | cmp cl,[field+eax] |
||
36 | jne .ex |
||
37 | mov dword[area],ebx |
||
38 | .ok: |
||
39 | mov [player],eax |
||
40 | cmp eax,[finish] |
||
41 | jne .jm |
||
42 | cmp dword[area],5 |
||
43 | jne .jm |
||
44 | mov [win_flag],1 |
||
45 | .jm: |
||
46 | mov [jump],drw |
||
47 | .ex: |
||
48 | ret |
||
49 | .novert: |
||
50 | mov edx,ebx |
||
51 | cmp edx,ecx ; the same dir |
||
52 | jne .nosame |
||
53 | add eax,[dirs+ebx*4] |
||
54 | call check_bounds |
||
55 | je .ex |
||
56 | .set5: |
||
57 | mov dword[area],5 |
||
58 | add eax,[dirs+ebx*4] |
||
59 | jmp .ok |
||
60 | .nosame: |
||
61 | xor edx,11b |
||
62 | cmp edx,ecx ; the opposite dir |
||
63 | je .set5 |
||
64 | add eax,[dirs+ebx*4] |
||
65 | mov ebx,ecx |
||
66 | xor ecx,11b |
||
67 | add eax,[dirs+ecx*4] |
||
68 | jmp .vert |
||
69 | |||
70 | CZ_drawm: |
||
71 | mov ecx,[cell_count] |
||
72 | mov esi,field |
||
73 | mov [sq_size],3 |
||
74 | .lp: |
||
75 | push ecx |
||
76 | movzx ebx,byte[field+ecx-1] |
||
77 | shr ebx,6 |
||
78 | lea eax,[ecx-1] |
||
79 | call get_xy |
||
80 | add [lx],5-2 shl 16 |
||
81 | add [ly],5-2 shl 16 |
||
82 | mov edx,[f_colors+ebx*4] |
||
83 | mcall 13,[lx],[ly] |
||
84 | .no: |
||
85 | pop ecx |
||
86 | loop .lp |
||
87 | |||
88 | inc [sq_size] |
||
89 | mov eax,[player] |
||
90 | call get_xy |
||
91 | xor edx,edx |
||
92 | cmp dword[area],5 |
||
93 | je .vert |
||
94 | push [lx] |
||
95 | push [ly] |
||
96 | mov edx,dword[area] |
||
97 | add eax,[dirs+edx*4] |
||
98 | call get_xy |
||
99 | mcall 13,[lx],[ly] |
||
100 | pop [ly] |
||
101 | pop [lx] |
||
102 | .vert: |
||
103 | mcall 13,[lx],[ly] |
||
104 | add [sq_size],5 |
||
105 | mov eax,[finish] |
||
106 | call get_xy |
||
107 | mcall 13,[lx],[ly],0xffffff |
||
108 | |||
109 | ret |
||
110 | |||
111 | |||
112 | CZ_level: |
||
113 | file 'colzone.bin' |
||
114 | |||
115 | if lang eq ru |
||
116 | CZ_help mstr \ |
||
117 | 'Черный блок из 2 кубиков стоит на раскрашенной',\ |
||
118 | 'клетчатой доске. Ваша задача - перекатить его на',\ |
||
119 | 'клетку с белым квадратиком. Блок начинает стоя и',\ |
||
120 | 'должен закончить тоже в вертикальном положении.',\ |
||
121 | 'Нельзя выкатывать его за пределы сетки и сверх',\ |
||
122 | 'того - кубики блока должны всегда ложиться на',\ |
||
123 | 'клетки одинакового цвета. Блок не отображен в 3D,',\ |
||
124 | 'поэтому Вы видите лишь его проекцию.','',\ |
||
125 | 'http://www.clickmazes.com' |
||
126 | else |
||
127 | CZ_help mstr \ |
||
128 | 'A black block, made of two black cubes stuck',\ |
||
129 | 'together, sits on a coloured grid. Your challenge',\ |
||
130 | 'is to roll the black block to its target',\ |
||
131 | 'position, which is marked with a small white',\ |
||
132 | 'square. The block starts on one end (vertical)',\ |
||
133 | 'and must also finish in this position. The block',\ |
||
134 | 'is not permitted to roll off the grid and, in',\ |
||
135 | 'addition, the block must always lie entirely',\ |
||
136 | 'within one colour-zone. Note the block is not',\ |
||
137 | 'displayed in 3D, in effect you see only its',\ |
||
138 | 'shadow.','',\ |
||
139 | 'http://www.clickmazes.com' |
||
140 | end if |