I’m trying to add physics to a cube so that it falls down and has an animation to it, but instead of falling it keeps floating to the left.
local sheetOptions =
{
width = 97,
height = 99,
numFrames = 2
}
local sheet_rollingCube = graphics.newImageSheet( “Cube.png”, sheetOptions )
local sequences_rollingCube = {
{
name = “fastRoll”,
frames = { 1,2},
time = 400,
loopCount = 0,
loopDirection = “forward”
}
}
local rollingCube = display.newSprite( sheet_rollingCube, sequences_rollingCube)
rollingCube.x = display.screenOriginX +60
rollingCube.y = display.screenOriginY +400
physics.addBody( rollingCube, “dynamic” )
rollingCube:scale( -0.5, -0.5 )