Hi guys, i am in the final weeks of developing my first game for both iOS and android 
in corona simulator everything seems perfect but apparently it’s not the case when I test my game with real device. I use galaxy nexus with android ICS 4.0
The problem is the pause and sound on/off button in the game. Here’s what I have
[code]-- PAUSE,RESUME,RESTART, SOUND BUTTON
pauseBtn = display.newImage(“pause.png”)
pauseBtn.x = ControlIconX
pauseBtn.y = ControlIconY
localGroup:insert(pauseBtn)
soundOn = display.newImage(“volume.png”)
soundOn.x = SoundIconX
soundOn.y = SoundIconY
localGroup:insert(soundOn)
soundOff = display.newImage(“mute.png”)
soundOff.x = XOutside
soundOff.y = SoundIconY
localGroup:insert(soundOff)
resumeBtn = display.newImage(“play.png”)
resumeBtn.x = XOutside
resumeBtn.y = ControlIconY
localGroup:insert(resumeBtn)
restartBtn = display.newImage(“restart.png”)
restartBtn.x = RestartIconX
restartBtn.y = ControlIconY
localGroup:insert(restartBtn)
local function pause ()
if paused == false then
physics.pause()
paused = true
gameIsActive = false
–Show resume button
pauseBtn.x = XOutside
resumeBtn.x = ControlIconX
monkeybaby:pause()
audio.stop (gameMusicChannel)
if(timerBabyEat ~= nil) then
timer.cancel(timerBabyEat)
end
end
end
pauseBtn:addEventListener(“tap”, pause)
local function resume ()
if paused == true then
physics.start()
paused = false
gameIsActive = true
–Show pause button
pauseBtn.x = ControlIconX
resumeBtn.x = XOutside
monkeybaby:play(“rolling”)
if option.getSoundStatus() == 1 then
option.setSoundStatus(1)
gameMusicChannel = audio.play(gameMusic, {channel=2, loops=-1})
else
audio.stop (gameMusicChannel)
end
timerBabyEat = timer.performWithDelay(200,babyroll,1)
end
end
resumeBtn:addEventListener(“tap”, resume)
[/code]
basically we use XOutside to put “resume” button outside the screen and we replace the pause button with this resume button when the user touch the pause button. But it doesnt work at all when I test the game in my phone (it works in corona simulator). When I said it doesnt work, i mean it doesnt work at all (nothing happens after I touch the buttons)
It seems eventlistener doesnt work in android WHILE it works in corona simulator, why is this happening?
2. Another bug is the movement to the left and right based on “virtual pad”. Here’s what I have:
[code]function touchleft (event)
if event.phase == “began” then
if gameIsActive == true then
pencetKiri = true
pencetKanan = false
motionx = -speed
motiony = 0
player:prepare(“playerleft”)
player:play(“playerleft”)
event.phase = “ended”
end
end
end
left:addEventListener(“touch”, touchleft)
function touchright (event)
if event.phase == “began” then
if gameIsActive == true then
pencetKiri = false
pencetKanan = true
motionx = speed
motiony = 0
player:prepare(“playerright”)
player:play(“playerright”)
event.phase = “ended”
end
end
end
right:addEventListener(“touch”, touchright)[/code]
so when the user touch the left button, the character will move to the left side. when he touch the right button the character will move to the right side. At the moment the codes work but sometimes the character will just keep moving without me touching it at all. Problem is, it only happens sometimes so I dont know what is wrong.
Let’s say I press left, right, left, then right for 3 seconds, then I dont touch anything…the character will then keep moving to the right direction (when I dont touch anything) until I press left again. Im not sure what’s wrong because this bug only happens sometimes. I also want to say in corona simulator the bug doesnt show up at all.
Can you guys help me what’s wrong?
[import]uid: 114765 topic_id: 26027 reply_id: 326027[/import]
[import]uid: 114765 topic_id: 26027 reply_id: 106395[/import]