Help - Touch Event Listener Starts 2 Seconds Late

Hey guys, I came across a problem when working on my OOP game. For some reason, my event listener for touch was starting about 2 seconds late each time after the game began when it was supposed to start straightaway. The weird thing is, the event listener for keys aren’t different experience this problem despite being in the same class, within the same method. Anyone know what’s wrong?

I posted the whole code as I’m pretty sure my event listener for touch isn’t correct so it must be something else. The shooting code part is marked by the following comment: SHOOTING CODE HERE!

function Game:setUp() -- Add boundaries local Boundary = Boundary:new(self.group, self.boundaryRange) -- Add player local Player = Player:new(self.group, self.playerSpawnX, self.playerSpawnY, self.playerSpeed, self.reloadTime, self.bulletSpeed, self.playerSize) --Movement Function self.key = function(self, event) --function(target, event) --SENSORS - These changes the variables bound to their keys into on or off states. --Key: UP if event.keyName == "up" or event.keyName == "w" then if event.phase == "down" then up = 1 else up = 0 end end --Key: DOWN if event.keyName == "down" or event.keyName == "s" then if event.phase == "down" then down = 1 else down = 0 end end --Key: RIGHT if event.keyName == "right" or event.keyName == "d" then if event.phase == "down" then right = 1 else right = 0 end end --Key: LEFT if event.keyName == "left" or event.keyName == "a" then if event.phase == "down" then left = 1 else left = 0 end end --Response Code if up == 1 then Player:move(0, -self.playerSpeed) end if down == 1 then Player:move(0, self.playerSpeed) end if left == 1 then Player:move(-self.playerSpeed, 0) end if right == 1 then Player:move(self.playerSpeed, 0) end if up == 1 and right == 1 then Player:move(self.playerSpeed\*0.85, -self.playerSpeed\*0.85) elseif up == 1 and left == 1 then Player:move(-self.playerSpeed\*0.85, -self.playerSpeed\*0.85) elseif down == 1 and right == 1 then Player:move(self.playerSpeed\*0.85, self.playerSpeed\*0.85) elseif down == 1 and left == 1 then Player:move(-self.playerSpeed\*0.85, self.playerSpeed\*0.85) end --Key: None --Description: Stops player when no key pressed if up == 0 and left == 0 and right == 0 and down == 0 then Player:move(0, 0) end end Runtime:addEventListener( "key", self ) --SHOOTING CODE HERE! --Description: mouseDown = 1 if touching screen --Sets: shootX, shootY print("Shooting should be able to run!") local function onScreenTouch(event) if event.phase == "began" or event.phase == "moved" then mouseDown = 1 shootX = event.x shootY = event.y else mouseDown = 0 end end Runtime:addEventListener( "touch", onScreenTouch ) --Description: tell player to shoot if touching mouseDow == 1 local function shoot(event) if mouseDown == 1 then Player:fireBullet(shootX, shootY) print("shot") end end Runtime:addEventListener( "enterFrame", shoot ) end

Made bad, this was due to the fact the I was using composer fade in scene transition.

Made bad, this was due to the fact the I was using composer fade in scene transition.