I’m using this code:
local physics = require "physics"
local sprite = require "sprite"
physics.start( )
local runningmansheet = sprite.newSpriteSheet("runner-nopowerups.png", 128, 128 )
local runningmansheet = sprite.newSpriteSheet("runner-nopowerups.png", 128, 128 )
sprite.add( runningman, "runningman", 1 , 15, 300 )
runnerinstance = sprite.newSprite( runningman )
runnerinstance.x = display.contentWidth / 4
runnerinstance.y = ( display.contentHeight / 3 ) \* 2
runnerinstance:prepare("runningman")
runnerinstance:play( )
physics.setGravity( 0, 9.8)
physics.addBody(runnerinstance, "kinematic", { density=1.0, friction=0.3, bounce=0.3 } )
By this code, the sprite should be “falling”, shouldn’t it?
However, there is no reaction. I’m not getting any sort of error; it runs just fine, but the sprite doesn’t seem to be reacting like a physics object. [import]uid: 147975 topic_id: 27284 reply_id: 327284[/import]