Game Development Community

setLinearVelocity definitely loves me not.

by Clint Moore · in iTorque 2D · 02/03/2009 (8:18 pm) · 4 replies

Two threads in one day - it's some sort of record.

Anyway, what I'm trying to do is dead simple (or so I thought). The animated sprite works in the player but not in the simulator or on the iphone.

Messy, Nasty, but syntactically correct (right?) code is here: gist.github.com/57927.

Again, it does work in the player. Anyone ever run into this before?

*edit*
Yea, it's just for testing... especially that onTimer function.

About the author

Recent Threads

  • Behavior DSO caching

  • #1
    02/03/2009 (8:24 pm)
    As an aside, I originally had the arguments to setLinearVelocityX as ints, they're strings in the above code because I was trial-and-erroring it.

    Kinda freaked out that the function can take an int or a string optionally though. This is probably mainly due to working with Haskell for the past year.
    #2
    02/03/2009 (10:52 pm)
    Make sure to call setUsesPhysics( true ) on the object first.
    #3
    02/03/2009 (11:07 pm)
    That was it! Thanks a lot, sir!
    #4
    02/04/2009 (6:04 am)
    It bit me too Clint! I would have totally helped you if Mat didn't ;)