Green Man Jump on Crate - Need Help with an Eample

Hello all, I am totally new to MAC and corona and have been slowly working ( cough cough playing ) my way through the examples and code. I have the little green running man from one example and a crate image from another example. I would like to know if someone can help supply me with an example on how to make the green man JUMP and land on the crate. In my example I was trying to use a button click and just try to make the man jump. but nothing ever happens when the jump() function is executed.

The text message is displaybed - but the jump never seems to happen.

am i approaching this right or wrong?

local buttonRight = ui.newButton{
default = “buttonArrow.png”,
over = “buttonArrowOver.png”,
onPress = buttonRightPress,
onRelease = buttonRightRelease,
–text = “Button 1 Label”,
emboss = true
}

local buttonRightPress = function( event )
t:setText( “Button R pressed” )
jump()
end

function jump( )
sheet2:applyLinearImpulse( 0, -0.2, sheet2.x, sheet2.y-5 )

end

– A sprite sheet with a green dude
local sheet2 = sprite.newSpriteSheet( “greenman.png”, 128, 128 )
[import]uid: 11860 topic_id: 4362 reply_id: 304362[/import]

you need to create a sprite.newSpriteSet (single frame or animation etc) and then sprite.newSprite to display the actual sprite… and move that not the sheet.

it’s in the docs
http://developer.anscamobile.com/reference/index/spritenewsprite

also when you define jump() it probably wont know what “sheet” is since you dont define it until after that [import]uid: 6645 topic_id: 4362 reply_id: 13610[/import]

What is the correct way to create a jump?

I am totally new to corona and trying my best to learn ASAP but am struggling on my first game attempt.

I am using this right now on an image click and it seems to work but not how i intended.
It lifts the sprite up and forward onto my next image but the sprite seems to tilt forward and backward etc… because of the physics im thinking. Is this the correct way to create a jump?

instance2:applyLinearImpulse( 0.25, -0.5, instance2.x, instance2.y-5 );

Thanks in advance Larry [import]uid: 11860 topic_id: 4362 reply_id: 13642[/import]