Game design question...
Blake
blake at kingdomrpg.com
Mon May 7 09:04:10 UTC 2007
On Mon, 07 May 2007 00:52:39 -0700, sig <siguctua at gmail.com> wrote:
> On 07/05/07, Blake <blake at kingdomrpg.com> wrote:
>> On Sun, 06 May 2007 23:41:46 -0700, sig <siguctua at gmail.com> wrote:
>>
>> > i'd rather use blocks for this matter. like:
>> >
>> > aGame do: myBlock withParams: { commandText. player }
>>
>> Where do you get "myBlock" from, starting from the UI (which initiates
>> the
>> action)?
>>
> from any point you like to. I don't know how exactly your verification
> looks like, i given this short code just to show, that you can encode
> your action in a block(s) instead of cloning numerous subclasses of
> CommandObject for each action type you may need.
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.
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?
===Blake===
More information about the Squeak-dev
mailing list
|