Handbook
Glossary
move-crate ( board player-pos move crate -- )
Vocabulary
gamelib
.
demos
.
parent-demo
Inputs
board
an
object
player-pos
an
object
move
an
object
crate
an
object
Outputs
None
Definition
USING:
accessors
classes
combinators
gamelib.board
gamelib.cell-object
kernel
math.vectors
;
IN:
gamelib.demos.parent-demo
::
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
;