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


Vocabulary
gamelib.demos.parent-demo

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 class-of wall class-of = not ]
[
crate light-crate >>image-path drop
board move crate call-parent*
board 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 ;