move-crate ( board player-pos move crate -- )


Vocabulary
gamelib.demos.sokoban

Inputs
boardan object
player-posan object
movean object
cratean object


Outputs
None

Definition


:: 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 ;