@Gamexcb: Regarding jumping… (assuming platform-style)
My recently released game, Dungeon Tap, has jumping as well as the game we are working on now (side-scrolling platformer), and this is how I do it:
When creating the character, I assign a “.jumpPower” attribute, for example:
playerObject.jumpPower = 400
Then, assigned to the push of the jump button:
[blockcode]
– Start player’s upward motion
local vx; local vy
vx, vy = playerObject:getLinearVelocity()
playerObject:setLinearVelocity( vx, -playerObject.jumpPower )
[/blockcode]
And that gets the player jumping. You can modify the .jumpPower attribute (as well as the physics gravity setting) to adjust the height at which the player jumps.
My gravity settings are: physics.setGravity( 0, 30 )
Hope that helps! [import]uid: 7849 topic_id: 2645 reply_id: 8298[/import]