move-object ( board object-pos move object -- board )


Vocabulary
gamelib.board

Inputs
boardan object
object-posan object
movean object
objectan object


Outputs
boardan object


Definition


:: move-object ( board object-pos move object -- board )
object-pos move v+ :> dest
{ object-pos dest } [ first board width>> < ] all?
{ object-pos dest } [ second board height>> < ] all? and
object-pos [ 0 >= ] all? and dest [ 0 >= ] all? and [
board object-pos object delete-from-cell
dest object add-to-cell drop
] when board ;