My app installs to my device, it opens, i can go through all the screens except 1, when i press it, it goes blank than exits the app… im guessing the problem must be here in the screen im trying to get to, do you guys find any errors?? i went on terminal and NO errors showed up!!
[code]
module(…, package.seeall)
function new()
local localGroup = display.newGroup()
lives = 3
local tapSound = audio.loadSound( “tapsound.wav” )
local impactSound = audio.loadSound( “impact.wav” )
local flashSound = audio.loadSound(“flashsound.wav”)
local bug = display.newImage( “ant.png” )
localGroup:insert(bug)
bug.x = 500
bug.y = 300
local function moveit (event)
bug.alpha = 1
transition.to(bug, {time=7000, x=500, y=300})
local function moveback (event)
transition.to(bug, {time=2000, x=0, y=50})
end
timer.performWithDelay (2000, moveback, 1)
end
timer.performWithDelay(5000, moveit, 0)
local function killbug (event)
bug.alpha = 0
audio.play( impactSound )
local blood = display.newImage (“blood.png”)
transition.to( blood, { time=500, delay=3000, alpha=0 } )
blood.x = bug.x
blood.y = bug.y
score.setScore( score.getScore() + 5)
end
bug:addEventListener(“touch”, killbug)
local bug = display.newImage( “ladybug.png” )
localGroup:insert(bug)
bug.x = 500
bug.y = 270
local function moveit (event)
bug.alpha = 1
transition.to(bug, {time=7000, x=500, y=270})
local function moveback (event)
transition.to(bug, {time=2000, x=-600, y=270})
end
timer.performWithDelay (2000, moveback, 1)
end
timer.performWithDelay(5000, moveit, 0)
local function killbug (event)
bug.alpha = 0
audio.play( tapSound )
local blood = display.newImage (“blood.png”)
transition.to( blood, { time=500, delay=3000, alpha=0 } )
blood.x = bug.x
blood.y = bug.y
score.setScore( score.getScore() + 15)
end
bug:addEventListener(“touch”, killbug)
local bug = display.newImage( “ladybug2.png” )
localGroup:insert(bug)
bug.x = 50
bug.y = 360
local function moveit (event)
bug.alpha = 1
transition.to(bug, {time=7000, x=50, y=360})
local function moveback (event)
transition.to(bug, {time=2000, x=50, y=-30})
end
timer.performWithDelay (4000, moveback, 4)
end
timer.performWithDelay(8000, moveit, 0)
local function killbug (event)
bug.alpha = 0
audio.play( tapSound )
local blood = display.newImage (“blood.png”)
transition.to( blood, { time=500, delay=3000, alpha=0 } )
blood.x = bug.x
blood.y = bug.y
score.setScore( score.getScore() + 15)
end
bug:addEventListener(“touch”, killbug)
local bug = display.newImage( “poka.png” )
localGroup:insert(bug)
bug.x = 500
bug.y = 160
local function moveit (event)
transition.to(bug, {time=7000, x=500, y=180})
bug.alpha = 1
local function moveback (event)
transition.to(bug, {time=2000, x=-600, y=180})
end
timer.performWithDelay (5000, moveback, 1)
end
timer.performWithDelay(5000, moveit, 0)
local function killbug (event)
bug.alpha = 0
audio.play( impactSound )
local blood = display.newImage (“blood.png”)
transition.to( blood, { time=500, delay=3000, alpha=0 } )
blood.x = bug.x
blood.y = bug.y
score.setScore( score.getScore() + 20)
end
bug:addEventListener(“touch”, killbug)
local bug = display.newImage( “rainbow.png” )
localGroup:insert(bug)
bug.x = -100
bug.y = 100
local function moveit (event)
transition.to(bug, {time=7000, x=-100, y=100})
bug.alpha = 1
local function moveback (event)
transition.to(bug, {time=2000, x=600, y=100})
end
timer.performWithDelay (5000, moveback, 1)
end
timer.performWithDelay(5000, moveit, 0)
local function killbug (event)
bug.alpha = 0
audio.play( tapSound )
local blood = display.newImage (“blood.png”)
transition.to( blood, { time=500, delay=3000, alpha=0 } )
blood.x = bug.x
blood.y = bug.y
score.setScore( score.getScore() + 30)
end
bug:addEventListener(“touch”, killbug)
local bug = display.newImage( “rainbow2.png” )
localGroup:insert(bug)
bug.x = 70
bug.y = -30
local function moveit (event)
bug.alpha = 1
transition.to(bug, {time=7000, x=70, y=-30})
local function moveback (event)
transition.to(bug, {time=2000, x=70, y=360})
end
timer.performWithDelay (8000, moveback, 3)
end
timer.performWithDelay(7500, moveit, 0)
local function killbug (event)
bug.alpha = 0
audio.play( tapSound )
local blood = display.newImage (“blood.png”)
transition.to( blood, { time=500, delay=3000, alpha=0 } )
blood.x = bug.x
blood.y = bug.y
score.setScore( score.getScore() + 30)
end
bug:addEventListener(“touch”, killbug)
local bug = display.newImage( “roach.png” )
localGroup:insert(bug)
bug.x = -200
bug.y = 300
local function moveit (event)
transition.to(bug, {time=7000, x=-100, y=160})
bug.alpha = 1
local function moveback (event)
transition.to(bug, {time=2000, x=600, y=160})
end
timer.performWithDelay (2000, moveback, 1)
end
timer.performWithDelay(5000, moveit, 0)
local function killbug (event)
bug.alpha = 0
audio.play( impactSound )
local blood = display.newImage (“blood.png”)
transition.to( blood, { time=500, delay=3000, alpha=0 } )
blood.x = bug.x
blood.y = bug.y
score.setScore( score.getScore() + 10)
end
bug:addEventListener(“touch”, killbug)
local heart1 = display.newImage( “heart3.png” )
localGroup:insert(heart1)
heart1.x = 105
heart1.y = 13
local heart3 = display.newImage( “heart1.png” )
localGroup:insert(heart3)
heart3.x = 86
heart3.y = 17
local heart2 = display.newImage( “heart2.png” )
localGroup:insert(heart2)
heart2.x = 53
heart2.y = 17
local bug = display.newImage( “scorpion.png” )
localGroup:insert(bug)
bug.x = 600
bug.y = 0
local function moveit (event)
transition.to(bug, {time=7000, x=500, y=100})
local function moveback (event)
transition.to(bug, {time=2000, x=-100, y=300})
end
timer.performWithDelay (5000, moveback, 1)
end
timer.performWithDelay(5000, moveit, 0)
local function killbug (event)
lives = lives - 1
if lives == 2 then
heart3.isVisible = false
end
if lives == 1 then
heart3.isVisible = false
heart2.isVisible = false
end
if lives == 0 then
director:changeScene ( “gameover” )
end
local bloodscreen = display.newImage (“bloodscreen.png”)
transition.to( bloodscreen, { time=500, delay=300, alpha=0 } )
end
bug:addEventListener(“touch”, killbug)
local bug = display.newImage( “spider.png” )
localGroup:insert(bug)
bug.x = 250
bug.y = 0
local function moveit (event)
transition.to(bug, {time=2000, x=0, y=100})
local function moveback (event)
transition.to(bug, {time=2000, x=500, y=300})
end
timer.performWithDelay (2000, moveback, 1)
end
timer.performWithDelay(5000, moveit, 0)
local function killbug (event)
lives = lives - 1
if lives == 2 then
heart3.isVisible = false
end
if lives == 1 then
heart3.isVisible = false
heart2.isVisible = false
end
if lives == 0 then
director:changeScene ( “gameover” )
end
local bloodscreen = display.newImage (“bloodscreen.png”)
transition.to( bloodscreen, { time=500, delay=300, alpha=0 } )
end
bug:addEventListener(“touch”, killbug)
local bug = display.newImage( “spider.png” )
localGroup:insert(bug)
bug.x = 600
bug.y = 100
local function moveit (event)
transition.to(bug, {time=8000, x=600, y=100})
local function moveback (event)
transition.to(bug, {time=4000, x=-600, y=100})
end
timer.performWithDelay (2000, moveback, 1)
end
timer.performWithDelay(8000, moveit, 0)
local function killbug (event)
lives = lives - 1
if lives == 2 then
heart3.isVisible = false
end
if lives == 1 then
heart3.isVisible = false
heart2.isVisible = false
end
if lives == 0 then
director:changeScene ( “gameover” )
end
local bloodscreen = display.newImage (“bloodscreen.png”)
transition.to( bloodscreen, { time=500, delay=300, alpha=0 } )
end
bug:addEventListener(“touch”, killbug)
local bug = display.newImage( “spider2.png” )
localGroup:insert(bug)
bug.x = -600
bug.y = 180
local function moveit (event)
transition.to(bug, {time=8000, x=-600, y=180})
local function moveback (event)
transition.to(bug, {time=4000, x=600, y=180})
end
timer.performWithDelay (2000, moveback, 1)
end
timer.performWithDelay(8000, moveit, 0)
local function killbug (event)
lives = lives - 1
if lives == 2 then
heart3.isVisible = false
end
if lives == 1 then
heart3.isVisible = false
heart2.isVisible = false
end
if lives == 0 then
director:changeScene ( “gameover” )
end
local bloodscreen = display.newImage (“bloodscreen.png”)
transition.to( bloodscreen, { time=500, delay=300, alpha=0 } )
end
bug:addEventListener(“touch”, killbug)
local bug = display.newImage(“stinkbug.png”)
localGroup:insert(bug)
bug.x = -100
bug.y = 250
local function moveit (event)
transition.to(bug, {time=7000, x=-100, y=160})
local function moveback (event)
transition.to(bug, {time=2000, x=480, y=0})
end
timer.performWithDelay (2000, moveback, 1)
end
timer.performWithDelay(5000, moveit, 0)
local function killbug (event)
audio.play( flashSound )
local blank = display.newImage (“blank.png”)
transition.to( blank, { time=500, delay=3000, alpha=0 } )
end
bug:addEventListener(“touch”, killbug)
local bug = display.newImage( “goldbeetle.png” )
localGroup:insert(bug)
bug.x = -100
bug.y = 0
local function moveit (event)
bug.alpha = 1
transition.to(bug, {time=7000, x=-100, y=0})
local function moveback (event)
transition.to(bug, {time=2000, x=600, y=320})
end
timer.performWithDelay (5000, moveback, 1)
end
timer.performWithDelay(5000, moveit, 0)
local function killbug (event)
bug.alpha = 0
audio.play( tapSound )
local blood = display.newImage (“blood.png”)
transition.to( blood, { time=500, delay=3000, alpha=0 } )
blood.x = bug.x
blood.y = bug.y
score.setScore( score.getScore() + 100)
end
bug:addEventListener(“touch”, killbug)
local background = display.newImage( “backgrounds.png” )
localGroup:insert(background)
score = require(“score”)
local border = 5
local scoreInfo = score.getInfo()
score.init( {
x = 460,
y = 0 }
)
score.setScore(0)
return localGroup
end
[/code] [import]uid: 10827 topic_id: 4836 reply_id: 304836[/import]