farrell2k, on 21 January 2013 - 09:21 PM, said:
I can. Depends on the game and the architecture, but it's generally pretty easy.
For example, if you're using an MVC architecture, the Controller is going to tell the Model what action the user has taken, not what the new state of the Model should be after the action is taken. Likewise, the Model is going to provide information about the current state to the View which will draw that state. The Model is not going to set values in the View, it will simply provide the View with the information it needs to do its job.
That's just one example. Here's another: if you're applying a force to an object, you don't want to calculate its new velocity and set it, you simply inform it that it's had some sort of impact, and here's the vector of acceleration that it should apply to itself, and let it calculate its new trajectory.
Or if you're in a zorkalike and your player drops and object, you don't reach into the room and insert that object in the room's inventory, you send the room a message telling it that this object has been dropped, and would it please do the right thing with it.
At least, that's how I'd do it.

New Topic/Question
Reply




MultiQuote







|