Can’t fathom how to limit swipe on a game without black background showing/bleeding in.
Same as ‘Ghosts vs. Monsters’ - when you swipe to the next screen, if you swipe too far, then the black background bleeds in.
Basically looking to limit the swipe so that it stops at the edge of the gaming background. The limitation probably needs to be put into this section of code (from level1.lua in Ghosts vs. Monsters). . .
if canSwipe == true then
if screenPosition == “left” then
– Swipe left to go right
if event.xStart > 180 then
gameGroup.x = event.x - event.xStart
if gameGroup.x > 0 then
gameGroup.x = 0
canSwipe = true
end
end
elseif screenPosition == “right” then
– Swipe right to go to the left
gameGroup.x = (event.x - event.xStart) - 480
if gameGroup.x < -480 then
gameGroup.x = -480
canSwipe = true
end
end
end
end
end
Any ideas or pointers would be appreciated as I’m still quite new to Corona. Right now I’ve hit a brick wall with this.
In the meantime, if I find a solution I’ll update this post. [import]uid: 12941 topic_id: 10394 reply_id: 310394[/import]