So I have my sprite set on a transition
local playbutton = display.newImage( "play.png" )
group:insert(playbutton)
playbutton.x = display.contentWidth / 1.5
playbutton.y = display.contentHeight / 12
playbutton.active = false
local function buttonTouched(e) if e.phase == "began" then
e.target.alpha = .5
end if e.phase == "ended" then
instance:play();
trans1 = transition.to( instance, { time=15000, x = 1100 } )
e.target.alpha = 1 print("Replay button was touched.")
if(instance.y \> 700) then
transition.cancel(trans1)
print("Transition Stopped")
end
end
end
playbutton:addEventListener( "touch", buttonTouched )
However when my sprite runs into a wall it just keeps walking. Here’s my wall code.
local floor = display.newImageRect("floorlarge.png", 1000, 225, 1000, 225)
group:insert(floor)
floor.x = 890; floor.y =380
physics.addBody(floor, "static", {density=3,friction=3,bounce=0})
floor.name = "floor"
Not sure why the sprite walks right through it. [import]uid: 72845 topic_id: 35278 reply_id: 335278[/import]
