On Fri, Sep 30, 2011 at 4:52 PM, SA <[email protected]> wrote:

> As far as I can tell, these objects should derive from InstantAction,
> not Action or you get bad results enabling gravity and acceleration.
>
>


Could you clarify what do you mean by bad results ?

I modified the test_sprite.py found with the cocos tests to use the Move
action with gravity, and it does what I expect: a fall in a word with
gravity, when  the object has some nonzero initial horizontal velocity.

Pasted the code at
http://paste.pocoo.org/show/485305/
You can run it from the same directory as the other tests, so that the
script will find necessary resources.

Most of the time a good decision rule to select an action base class is:

   . If the change we want in the node is applied only one time, choose
InstantAction

   . If we want a change with intermediate values, which ends in a finite
time, and the total time that takes the full change is known in advance, use
an IntervalAction

   . else use Action

--
claudio

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cocos-discuss?hl=en.

Reply via email to