Here is all my code, from creating the spaceship to its rotation function:
[lua]local spaceship = display.newImageRect(“SGSpacecraft2.png”, 40, 40)
spaceship.x = display.contentWidth/2 - 125
spaceship.y = display.contentHeight/2
physics.addBody(spaceship,“dynamic”)
spaceship.name = “spaceship”
print(spaceship,spaceship.rotation)
local function spaceshipAnimation()
spaceship.rotation = spaceship.rotation + 45
print(spaceship.rotation)
end
satmr = timer.performWithDelay(200,spaceshipAnimation,-1)[/lua]
I had already tried removing the spaceship.rotation = spaceship.rotation, but it didn’t make a difference. I changed the print statement to just spaceship.rotation in the function, and this time only the numbers were popping up; no ‘table’. It was incrementing by 45 each time. The output is:
Corona Simulator: 45
Corona Simulator: 90
Corona Simulator: 135
Corona Simulator: 180
Corona Simulator: 225
Corona Simulator: 270
Corona Simulator: 315
Corona Simulator: 360
Corona Simulator: 405
Corona Simulator: 449.99996948242
Corona Simulator: 494.99996948242