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
Post a Comment