1
0
kolibrios/programs/games/megamaze/trunk/tilt2.inc

106 lines
2.2 KiB
PHP
Raw Normal View History

; level format
; [fx|fy][blue xy][red xy][blue point xy][red point xy]..[maze walls]
; internal format
; points db=[stepptr]
; [player]= blue
; [finish]= red
; area: ..[1-red,0-black xy].. ( -1 if empty)
TILT2_levelp:
call get_xy_sf
mov [stepptr],esi
add esi,2
call unpack_level
mov [pause_time],10
ret
TILT2_key:
cmp eax,176
jb .ex
cmp eax,179
ja .ex
mov esi,area
inc esi
lea ebx,[eax-176]
.lp:
xor edx,edx
mov eax,[player]
call check_move
jc .nom1
inc edx
add eax,[dirs+ebx*4]
mov [player],eax
.nom1:
mov eax,[finish]
call check_move
jc .nom2
inc edx
add eax,[dirs+ebx*4]
mov [finish],eax
.nom2:
test edx,edx
jz .ex1
call delay
call drwfld
jmp .lp
.ex1:
mov eax,[finish]
cmp eax,[player]
jnz .ex2
mov [win_flag],2
jmp TILT2_drawm.skip
.ex2:
mov esi,[stepptr]
cmp al,[esi+1]
jne .ex
mov eax,[player]
cmp al,[esi]
jne .ex
mov [win_flag],1
.ex:
ret
TILT2_drawm:
cmp [win_flag],2
je .skip
; mov [sq_size],3
mov eax,[player]
call get_xy
mcall 13,[lx],[ly],0xff
mov eax,[finish]
call get_xy
mcall 13,[lx],[ly],0xff0000
.skip:
shl [sq_size],1
mov esi,[stepptr]
lodsb
call get_xy
mcall 13,[lx],[ly],0xff
lodsb
call get_xy
shr [sq_size],1
mcall 13,[lx],[ly],0xff0000
ret
TILT2_level:
file 'tilt2.bin'
if lang eq ru
TILT2_help mstr \
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><E1A8AD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⮪',\
'ᮮ⢥<E1AEAE><E2A2A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E6A2A5>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! <20><><EFBFBD><EFBFBD><EFBFBD><><E1A4A5><EFBFBD><EFBFBD>',\
'<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1A8A2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A8A0>, <20> <20><><EFBFBD> <20><EFBFBD><E2AEAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',\
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20> <20><20><><EFBFBD><20><><EFBFBD> <20><EFBFBD><E0A8A4><EFBFBD><EFBFBD>',\
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA2><EFBFBD> ᭠砫<E1ADA0>.','',\
'http://www.clickmazes.com'
else
TILT2_help mstr \
'The red block must reach the red target and the',\
'blue block the blue target. Beware! The two',\
'blocks are made of highly reactive material and,',\
'if they collide, will instantly evaporate. At',\
'this point you must start all over again.','',\
'http://www.clickmazes.com'
end if