Handbook
Glossary
move-crate ( board player-pos move crate -- )
Vocabulary
gamelib
.
demos
.
sokoban
Inputs
board
an
object
player-pos
an
object
move
an
object
crate
an
object
Outputs
None
Definition
USING:
accessors
combinators
gamelib.board
kernel
math.vectors
;
IN:
gamelib.demos.sokoban
::
move-crate
( board player-pos move crate -- )
player-pos move
v+
:>
crate-pos board crate-pos move
v+
get-cell
:>
next-cell
{
{
[
next-cell
is-empty?
]
[
crate
light-crate
>>image-path
drop
board crate-pos move crate
move-object
player-pos move
player
move-object
drop
]
}
{
[
next-cell
goal
cell-only-contains?
]
[
crate
dark-crate
>>image-path
drop
board crate-pos move crate
move-object
player-pos move
player
move-object
drop
]
}
[
]
}
cond
;