// 2011.07.06 # Doj

:noname  player-y! player-x! ;oninit_ S
lab 
     #######
     #1    #
###### ### #
#      # # #
# ###### # #
# #      # #
# #      # #
# ######## #
#     2    #
############
\lab
  last-lab-x value 1maze-x
  last-lab-y value 1maze-y
  last-lab-maze value 1maze-ptr
lab 
     #######
     #1    #
###### ### #
#      # # #
# ###### ###
# #         
# #         
# ##########
#    2    F#
############
\lab
  last-lab-x value 2maze-x
  last-lab-y value 2maze-y
  last-lab-maze value 2maze-ptr
lab 
###  #######
#S#  #1    #
# #### ### #
#      # # #
######## # #
         # #
         # #
########## #
#    2     #
############
\lab
maze!

variable state 0 state !
:noname passed 1maze-x maze-x ! 1maze-y maze-y ! 1maze-ptr maze-ptr ! ;enter_ 1
:noname passed 2maze-x maze-x ! 2maze-y maze-y ! 2maze-ptr maze-ptr ! ;enter_ 2
:noname 
  state @ switch
    1 of  \of
    2 of  \of
  \switch
;after-update
: nvisible? player-y @ - abs swap player-x @ - abs max 3 > ;
: draw_# 
  2dup nvisible? if drop drop exit then
  COLOR 2dup PURPLES GEN[]2 ^ set-color draw-cell-rect 
;
:noname  draw_# ;draw_ #
:noname pchar" data\sounds\newlevel.wav" sound ;init
:noname  2dup nvisible? if drop drop exit then draw-finish ;draw_ F
1 player-x! 1 player-y!
64 cell-x! 64 cell-y!
centrize
