I have a ball with dynamic physics applied so it can collide with walls and the floor. I am trying to move the ball around obstacles I have on the screen, however the movement is pretty wild if physics is set to dynamic, if I set the ball to static, the movement is jerky and hard to control, and it wont collide with any of my static obstacles.
Any help is appreciated
Here is my code:
--Creates Hero local function player(xCenter, yCenter, radius ) local player1 = display.newImageRect( "images/hero.png", 32, 31 ) player1.x = xCenter player1.y = yCenter player1:setFillColor( 100,100,100 ) physics.addBody( player1, "dynamic", {bounce = 0, density=1, friction=.1, radius=radius} ) return player1 end local hero = player(startPlatform.x+20, startPlatform.y-15, 15) -- Give hero movement local function heroMovex(event) hero.x = hero.x + (hero.x\*event.xGravity) hero.y = hero.y - (hero.y \* event.yGravity-1) end Runtime:addEventListener("accelerometer", heroMovex)