[SOLVED] Thanks for looking, but I figured it out. I needed to un-nest the return true
statements in some of my if conditions.
I have just started learning Lua this week, and I have started to program a 2D side-scroller game using Corona SDK. In this game, the player's character is moved by pressing buttons displayed on the screen much like a virtual game pad. These buttons work perfectly, however, the problem is that I have a
Runtime:addEventListener("tap", onScreenTap)
event listener that then calls the shoot() function to fire a projectile from the player whenever a tap is registered. This results in a projectile firing every time I lift the touch from one of the movement buttons.
Is there any way I can stop the shoot function from calling when I finish touching one of the movement keys? I have tried
display.getCurrentStage:setFocus()
and also putting
return true
at the end of the movement functions but nothing seems to work.