Talk:JavascriptGraphicsAPI

From Sirikata Wiki
Jump to navigation Jump to search

Re: JavascriptGraphicsAPI#Moving a graphics object

How about a three step movement protocol?

  • StartMove
  • Move
  • StopMove

I realize this is a state-full proposition, but having default values and assumptions hard coded in the proposed Move message is implicitly state-full and less robust.

StartMove

This StartMove message sets the initial conditions for an object at rest, setting it in motion.

This message handles default values and assumptions that are made once (or infrequently).

An object may receive this message at any time, while in rest or in motion (i.e. transitions, snapping).

Move

The Move message updates the conditions for an object in motion.

This is the most frequent message of the three. The contents of this message can be optimal without the overloaded burdens handled by the StartMove and StopMove messages. This message does not have default values. It's purpose is to send explicit updates of new values as efficiently as possible.

It is an error for an object at rest to receive a Move message.

StopMove

The StopMove message sets the final conditions for an object in motion, bringing it to rest.

This message handles default values and assumptions that are made once (closures). Objects at rest may be optimized in various ways by the client.

It is an error for an object at rest to receive a StopMove message.


By Marcus 20:42, 11 April 2010 (UTC)