Here is the part of the code below, when I add “physics.addBody(kusdus1, {density=0.1, friction=.3, bounce=.4})” to the code as you can see at the end, corona shuts down?! What is the problem? Any help will be appriciated.
note: if I remove the “physics.addBody(kusdus1, {density=0.1, friction=.3, bounce=.4})” part it run without any problem.
function rastgelekus1(event)
local sheet1 = sprite.newSpriteSheet( “birdsprite.png”, 64, 64)
local kus1ucus = sprite.newSpriteSet(sheet1, 9, 4)
sprite.add( kus1ucus, “kus1ucus”, 1, 4, 100, 0 )
local kus1 = sprite.newSprite( kus1ucus )
kus1.x = 0
kus1.y = mran(_Y-(_Y-80),_Y/2)
kus1.xScale = 1
kus1.yScale = 1
kus1:prepare(“kus1ucus”)
kus1:play()
local trans = transition.to( kus1, { time=mran(1500,3500), alpha=1, x=(_GE-20), y=kus1.y,onComplete=killkus} )
physics.addBody(kus1,“static”, {density=0.1, friction=.3, bounce=.4})
timer.cancel(tmr1)
tmr1 = timer.performWithDelay (mran(100,800),rastgelekus1,100)
local function carpisma1(event)
if event.phase == “began” and event.other.name == “top” then
kus1:removeSelf()
transition.cancel(trans)
local kus1dus = sprite.newSpriteSet(sheet1, 4, 1)
sprite.add( kus1dus, “kus1dus”, 1, 1, 100, 0 )
local kusdus1 = sprite.newSprite( kus1dus )
kusdus1.x = kus1.x
kusdus1.y = kus1.y
kusdus1.xScale = 1
kusdus1.yScale = 1
kusdus1:prepare(“kus1dus”)
kusdus1:play()
physics.addBody(kusdus1, {density=0.1, friction=.3, bounce=.4})
end
end
kus1:addEventListener( “collision”, carpisma1)
end
–[[function rastgelekus2(event)
local sheet2 = sprite.newSpriteSheet( “kusprite.png”, 180, 123)
local kus2ucus = sprite.newSpriteSet(sheet2, 1, 3)
sprite.add( kus2ucus, “kus2ucus”, 1, 3, 100, 0 )
local kus2 = sprite.newSprite( kus2ucus )
kus2.x = 0
kus2.y = mran(_Y-(_Y-80),_Y/2)
kus2.xScale = 0.7
kus2.yScale = 0.7
kus2:prepare(“kus2ucus”)
kus2:play()
transition.to( kus2, { time=mran(2500,4000), alpha=1, x=(_GE-20), y=kus2.y,onComplete=killkus} )
timer.cancel(tmr2)
tmr2 = timer.performWithDelay (mran(400,800),rastgelekus2,100)
end
]]–
tmr1 = timer.performWithDelay (1000,rastgelekus1,100)
–tmr2 = timer.performWithDelay (1000,rastgelekus2,100)
function killkus(k)
k:removeSelf()
end [import]uid: 74718 topic_id: 12463 reply_id: 312463[/import]