thanks Omni!
as per request I am posting my code for optimization
main engine::
:Text(‾1,0,0,sub(Str1,1,15
:Text(‾1,8,0,sub(Str1,16,15
:Text(‾1,16,0,sub(Str1,31,15
:Text(‾1,24,0,sub(Str1,46,15
:Text(‾1,32,0,sub(Str1,61,15
:Text(‾1,40,0,sub(Str1,76,15
:Text(‾1,48,0,sub(Str1,91,15
:Text(‾1,56,0,sub(Str1,106,15
:StorePic 2
:Text(‾1,0,0,sub(Str2,1,15
:Text(‾1,8,0,sub(Str2,16,15
:Text(‾1,16,0,sub(Str2,31,15
:Text(‾1,24,0,sub(Str2,46,15
:Text(‾1,32,0,sub(Str2,61,15
:Text(‾1,40,0,sub(Str2,76,15
:Text(‾1,48,0,sub(Str2,91,15
:Text(‾1,56,0,sub(Str2,106,15
:RecallPic 2
:L1(3→B:L1(4→A
:L1(1→G
:L1(2→H
:L1(5→S
:L1(6→T
:L2(1→Z
:L2(2→Y
:L2(3→X
:DelVar M
:DelVar JText(‾1,0,90,H
:If S:Then
:Text(‾1,24,90,"!
:End
:If G=3:Then
:Text(‾1,16,90,"
:End
:If T:Then
:Text(‾1,32,90,"
:End
:While A≠1 and A≠9 and B≠0 and B≠16 and H
:If E:Then
:E-1→E
:If not(E
:Then
:Text(‾1,8,90,"
:End:End
:A→C
:B→D
:Text(‾1,8A-8,6B-6,"Ω
:If M
:Then
:2→M
:Text(‾1,8A-8,6B-6,"Î
:End
:getKey→K
:If K:Then
:B+(K=26)-(K=24→B
:If B≠D
:Then
:If B and B≠16 and ""=sub(Str1,15A-14+B-1,1
:Then
:D→B
:End
:End
:End
:If A≠1 and A≠9
:Then
:If not(J) and ""≠sub(Str1,15(A+1)-15+B,1) and ""≠sub(Str1,15(A-1)-15+B,1
:Then
:A+1→A
:Else
:If S and K=21:Then
:prgmZAT
:End
:If T and K=31:Then
:prgmZSH
:End
:J+G(K=25 and not(J→J
:End
:If J:Then
:If ""≠sub(Str1,15(A-1)-15+B,1
:Then
:A-1→A
:End
:J-1→J
:End
:If (A≠C or B≠D) and B and B≠16
:Then
:Text(‾1,8A-8,6B-6,"Ω
:Text(‾1,8C-8,6D-6,"
:If ""=sub(Str1,15C-15+B,1
:Then
:Text(‾1,8C-8,6D-6,"
:End
:If 2=M
:Then
:Text(‾1,8C-8,6D-6,"Î
:DelVar M
:End
:End
:If " "≠sub(Str1,15A-15+B,1
:Then
:prgmZIT
:End:End
:If Z:Then
:prgmZEN
:End:End
:G→L1(1
:H→L1(2
:A→L1(3
:B→L1(4
:S→L1(5
special tiles (prgmZIT)
:If "o"=sub(Str1,15A-15+B,1
:Then
:1→T
:sub(Str1,15A-15+B,length(Str1)-15A-14+B→Str3
:sub(Str2,1,15A-16+B)+" "+Str3→Str1
:Else
:If "!"=sub(Str1,15A-15+B,1
:Then
:1→S
:sub(Str1,15A-14+B,length(Str1)-(15A-14+B→Str3
:sub(Str1,1,15A-16+B)+" "+Str3→Str1
:Text(‾1,24,90,"!
:Else
:If "Δ"=sub(Str1,15A-14+B-1,1
:Then
:H+3→H
:If 9<H
:Then
:9→H
:End
:sub(Str1,15A-14+B,length(Str1)-(15A-14+B→Str3
:sub(Str1,1,15A-16+B)+" "+Str3→Str1
:Text(‾1,0,90,H
:Text(‾1,8,90,"┼
:3→E
:Else
:If ""=sub(Str1,15A-14+B-1,1
:Then
:Text(‾1,16,90,"
:sub(Str1,15A-14+B,length(Str1)-15A-14+B→Str3
:sub(Str1,1,15A-14+B-2)+" "+Str3→Str1
:3→G
:Else
:If "Î"=sub(Str1,15A-14+B-1,1
:Then
:Text(‾1,0,90,H
:H-1→H
:1→M
:End
:End
:End
:End
sword animation (prgmZAT)
:15A-15+B→S
:Text(‾1,8A-8,6(B+1)-6,"-
:Text(‾1,8(A-1)-8,6(B+1)-6,"/
:Text(‾1,8A-8,6(B+1)-6,sub(Str1,S+1,1
:StorePic 2
:Text(‾1,8A-8,6(B+1)-6,sub(Str2,S+1,1
:RecallPic 2
:Text(‾1,8(A-1)-8,6B-6,"!
:Text(‾1,8(A-1)-8,6(B+1)-6,sub(Str1,S-14,1
:StorePic 2
:Text(‾1,8(A-1)-8,6(B+1)-6,sub(Str2,S-14,1
:RecallPic 2
:Text(‾1,8(A-1)-8,6(B-1)-6,"
:Text(‾1,8(A-1)-8,6B-6,sub(Str1,S-15,1
:StorePic 2
:Text(‾1,8(A-1)-8,6B-6,sub(Str2,S-15,1
:RecallPic 2
:Text(‾1,8A-8,6(B-1)-6,"-
:Text(‾1,8(A-1)-8,6(B-1)-6,sub(Str1,S-16,1
:StorePic 2
:Text(‾1,8(A-1)-8,6(B-1)-6,sub(Str2,S-16,1
:RecallPic 2
:Text(‾1,8A-8,6(B-1)-6,sub(Str1,15A-16+B,1
:StorePic 2
:Text(‾1,8A-8,6(B-1)-6,sub(Str2,15A-16+B,1
:RecallPic 2
:1→S
:If (A=Y and (B-1=X or B+1=X)) or (A-1=Y and (B-1=X or B=X or B+1=X
:Then
:DelVar Z
:End
magic animation (prgmZSH)
:H+2(X=B or X=B+1 or X=B-1→H
:A-1→T
:If H>9:Then
:9→H
:End
:Text(‾1,8T-8,6B-6,"O
:For(θ,1,10):End
:Text(‾1,8T-8,6B-6,"o
:For(θ,1,10):End
:Text(‾1,8T-8,6B-6,"o
:For(θ,1,10):End
:Text(‾1,8T-8,6B-6,"∙
:For(θ,1,10):End
:Text(‾1,8T-8,6B-6,sub(Str1,15T-15+B,1
:StorePic 2
:Text(‾1,8T-8,6B-6,sub(Str2,15T-15+B,1
:RecallPic 2
enemy movement and action handler (prgmZEN)
:H+2(X=B or X=B+1 or X=B-1→H
:A-1→T
:If H>9:Then
:9→H
:End
:Text(‾1,8T-8,6B-6,"O
:For(θ,1,10):End
:Text(‾1,8T-8,6B-6,"o
:For(θ,1,10):End
:Text(‾1,8T-8,6B-6,"o
:For(θ,1,10):End
:Text(‾1,8T-8,6B-6,"∙
:For(θ,1,10):End
:Text(‾1,8T-8,6B-6,sub(Str1,15T-15+B,1
:StorePic 2
:Text(‾1,8T-8,6B-6,sub(Str2,15T-15+B,1
:RecallPic 2
as before the chars are a little bit wierd, if you want to know exactly which one it is just ask
EDIT: here are the files in case you want to test them out: