update-location ( board loc flowcell-object -- )


Vocabulary
gamelib.demos.flow-demo

Inputs
boardan object
locan object
flowcell-objectan object


Outputs
None

Definition


:: update-location ( board loc flowcell-object -- )
flowcell-object flow-on? [
flowcell-object flow>> :> flow-obj flow-obj target>>
:> target flow-obj counter>> 1 +
:> counter counter target = [
flow-obj direction>> :> direction board loc
direction flowcell-object move-object drop
flow-obj 0 >>counter drop
] [ flow-obj counter >>counter drop ] if
flowcell-object flow-obj >>flow drop
] when ;