Hello!
I have two objects:
– Make the player
player = display.newImageRect( world, playerImg, 26, 60 )
player = players.new( player, “00272B” )
player.y = -30
– Make the badGuy
badGuy = display.newImageRect( world, badGuyImg, 40, 40 )
badGuy = badGuys.new( badGuy )
badGuy.x = badGuy.x + 100
adding physics to both of them:
physics.addBody( player, “dynamic”, { friction = 0, bounce = 0 } )
physics.addBody(badGuy, “dynamic”)
badGuy.gravityScale = 0
And they both move like this:
function move()
instance:applyLinearImpulse(0.1, 0, instance.x, instance.y);
end
Because of their mass, they still dont move at the same speed, but that’s what i need. I know that i cant change mass and probally somehow need to calculate right density, so they both will have same mass and move at the same speed. Any help?
Thanks