Game design question...

sig siguctua at gmail.com
Mon May 7 11:00:56 UTC 2007


> I get the overall idea, I'm just trying to figure out the details.
>
> So I have:
>
>         aCommand := aGame processCommand: commandText.
>         aGame do: aCommand.
>
> And I think you're suggesting:
>
>         myBlock := aGame processCommand: commandText.

Be careful there. you might finish up with expired context mess!
Better call it from the place where you have block, do not return it
up the call chain.

>         aGame do: myBlock withParams: {commandText. player}
>
> and where I have an object with a do method:
>
>         aGame move:player to:qx at qy sector:sx at sy
>
> you'd skip that hierarchy and put a block, like:
>
>         [|player quadrant sector|
>          player := params at: 2.
>          self parseLocation: (params at: 1) with: quadrant and: sector.
>          aGame move:player to:quadrant sector:sector.]
>
> Is that about right?
>

yes, in general, you got my point.



More information about the Squeak-dev mailing list