perl - ApplyForce and ApplyLinearImpulse in Box2D is not working -



perl - ApplyForce and ApplyLinearImpulse in Box2D is not working -

i writing 2d platformer game in perl sdl , box2d, setlinearvelocity() function working can moving character left or right. when want create jump using applylinearimpulse(), not working, applyforce() not working too. character object remain there.

my code :

if ($key_name=~/w/){ $me->applylinearimpulse(box2d::b2vec2->new(0,20.0), $me->getworldcenter()); }

i tried adding:

$world->step(1.0/60.0,10,10);

after it, stil no response.

please help.

oh found because should utilize getposition() rather getworldcenter() , forcefulness need much bigger lift object!

perl sdl box2d game-physics

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -