Hey Ahmed, try this out! 
Set the FPS to 60 in a config.lua file, and use the iPhone4S skin.
I didn’t implement multitouch, because I hate it, so that’s up to you! The rest works perfectly.
-------------- -- main.lua -- -------------- -- create all graphics layers and elements local gameWorldGroup = display.newGroup() local userInterfaceGroup = display.newGroup() local heroGroup = display.newGroup() local gameBackGround = display.newRect(0,0,2000,2000) gameBackGround:setFillColor(0,.5,.5) gameWorldGroup:insert(gameBackGround) local upButton = display.newRect(200,660,100,100) local downButton = display.newRect(200,860,100,100) local leftButton = display.newRect(100,760,100,100) local rightButton = display.newRect(300,760,100,100) local jumpButton = display.newRect(500,760,100,100) userInterfaceGroup:insert(upButton) userInterfaceGroup:insert(downButton) userInterfaceGroup:insert(leftButton) userInterfaceGroup:insert(rightButton) userInterfaceGroup:insert(jumpButton) userInterfaceGroup.alpha = .5 local heroCircle = display.newCircle(0,0,50,50) local heroShadow = display.newCircle(0,0,52,52) heroShadow:setFillColor(0,0,0) heroShadow.alpha = .5 heroGroup:insert(heroShadow) heroGroup:insert(heroCircle) gameWorldGroup:insert(heroGroup) gameWorldGroup.x = 320 gameWorldGroup.y = 480 -- create all "physics" variables local heroIsJumping = false local heroHorizontalPosition = 0 local heroVerticalPosition = 0 local heroJumpHeight = 0 local heroHorizontalSpeed = 0 local heroVerticalSpeed = 0 local heroJumpSpeed = 0 local heroMaxSpeed = 5 local heroMoveAcceleration = .5 local heroGravity = .3 local heroMoveFriction = 0.8 local upButtonIsPressed = false local downButtonIsPressed = false local leftButtonIsPressed = false local downButtonIsPressed = false local jumpButtonIsPressed = false -- create variables that adjust the circle sizes local heroCircleScaleFactor = .01 local heroShadowDistanceFactor = 1 -- create all touchListener functions local upButtonTouched = function(event) if event.phase == "began" then display.getCurrentStage():setFocus(event.target) upButtonIsPressed = true elseif event.phase == "ended" or event.phase == "cancelled" then display.getCurrentStage():setFocus(nil) upButtonIsPressed = false end return true end -- upButtonTouched() local downButtonTouched = function(event) print("down") if event.phase == "began" then display.getCurrentStage():setFocus(event.target) downButtonIsPressed = true elseif event.phase == "ended" or event.phase == "cancelled" then display.getCurrentStage():setFocus(nil) downButtonIsPressed = false end return true end -- downButtonTouched() local leftButtonTouched = function(event) if event.phase == "began" then display.getCurrentStage():setFocus(event.target) leftButtonIsPressed = true elseif event.phase == "ended" or event.phase == "cancelled" then display.getCurrentStage():setFocus(nil) leftButtonIsPressed = false end return true end -- leftButtonTouched() local rightButtonTouched = function(event) if event.phase == "began" then display.getCurrentStage():setFocus(event.target) rightButtonIsPressed = true elseif event.phase == "ended" or event.phase == "cancelled" then display.getCurrentStage():setFocus(nil) rightButtonIsPressed = false end return true end -- rightButtonTouched() local jumpButtonTouched = function(event) if event.phase == "began" then display.getCurrentStage():setFocus(event.target) jumpButtonIsPressed = true heroJumpSpeed = -5 heroIsJumping = true elseif event.phase == "ended" or event.phase == "cancelled" then display.getCurrentStage():setFocus(nil) jumpButtonIsPressed = false end return true end -- jumpButtonTouched -- create enterFrame loop function local frameLoop = function(event) print(heroJumpHeight) -- first we calculate the change to the hero's speed, based on the 4 movement buttons if upButtonIsPressed == true then heroVerticalSpeed = heroVerticalSpeed - heroMoveAcceleration if heroVerticalSpeed \< -heroMaxSpeed then heroVerticalSpeed = -heroMaxSpeed end elseif downButtonIsPressed == true then heroVerticalSpeed = heroVerticalSpeed + heroMoveAcceleration if heroVerticalSpeed \> heroMaxSpeed then heroVerticalSpeed = heroMaxSpeed end elseif leftButtonIsPressed == true then heroHorizontalSpeed = heroHorizontalSpeed - heroMoveAcceleration if heroHorizontalSpeed \< -heroMaxSpeed then heroHorizontalSpeed = -heroMaxSpeed end elseif rightButtonIsPressed == true then heroHorizontalSpeed = heroHorizontalSpeed + heroMoveAcceleration if heroHorizontalSpeed \> heroMaxSpeed then heroHorizontalSpeed = heroMaxSpeed end else -- if none of the 4 direction move buttons is pressed, then we apply friction to slow down the hero to a standstill -- we don't know if the hero was moving horizontally or vertically, so we just apply to friction to both to make sure heroHorizontalSpeed = heroHorizontalSpeed \* heroMoveFriction heroVerticalSpeed = heroVerticalSpeed \* heroMoveFriction end -- after we've calculated the speed, we change the position based on the hero's speed -- first we apply the speed to calculate the new position variables: heroHorizontalPosition = heroHorizontalPosition + heroHorizontalSpeed heroVerticalPosition = heroVerticalPosition + heroVerticalSpeed -- then we check and calculate if the hero is jumping -- we can do this separately from the horizontal and vertical movement because they are basically not related if heroIsJumping == true then heroJumpSpeed = heroJumpSpeed + heroGravity heroJumpHeight = heroJumpHeight + heroJumpSpeed if heroJumpHeight \> 0 then heroJumpHeight = 0 heroIsJumping = false end end -- I'm not coding this here, but after you've got the H & V coordinates and jump height for the new hero position, you can use these -- coordinates to do collision testing with obstacles or enemies, and adjust the position variables if needed -- So, as I said, I won't do this check here, and just apply the position variables to the hero's displayGroup right away! heroGroup.x = heroHorizontalPosition heroGroup.y = heroVerticalPosition heroCircle.xScale = 1 - heroJumpHeight\* heroCircleScaleFactor heroCircle.yScale = heroCircle.xScale heroShadow.x = heroJumpHeight \* -heroShadowDistanceFactor heroShadow.y = heroJumpHeight \* -heroShadowDistanceFactor end -- frameLoop() -- add touch listeners to buttons upButton:addEventListener("touch", upButtonTouched) downButton:addEventListener("touch", downButtonTouched) leftButton:addEventListener("touch", leftButtonTouched) rightButton:addEventListener("touch", rightButtonTouched) jumpButton:addEventListener("touch", jumpButtonTouched) -- add frameLoop function to enterFrame Runtime event (so it runs 60 times per second) Runtime:addEventListener("enterFrame", frameLoop)