Handbook
Glossary
move ( maze-gadget move -- )
Vocabulary
gamelib
.
demos
.
maze-game
Inputs
maze-gadget
an
object
move
an
object
Outputs
None
Definition
USING:
accessors
colors
gamelib.board
kernel
math.vectors
sequences
ui.gadgets
;
IN:
gamelib.demos.maze-game
::
move
( maze-gadget move -- )
maze-gadget
board-gadget>>
board>>
first
:>
board
maze-gadget
maze-scroller>>
:>
scroller board
[
COLOR:
blue
=
]
find-cell-pos
:>
player-pos player-pos move
v+
:>
new-pos new-pos
bound-check
[
board new-pos
can-move?
[
player-pos
{
0 1
}
=
not
player-pos
{
16 15
}
=
not
and
[
scroller move
move-window
]
when
board player-pos new-pos
move-entire-cell
drop
]
when
]
when
maze-gadget
relayout-1
;