Ok I’m here again. I need help to accomplish this. I have been since yesterday night and I could not. I am blocked. In my second game the controls are zoom in zoom out to move objects. There will only be three zoom in and three zoom out positions to play. The problem I have is with the count of the zoom taps and the positions of the objects. I want them to only open and close at specific positions. I can’t make this happen.
Here the code:
--zoom out/in
local function zoomButtonsTouch( event )
if ( event.phase == "began" ) then
zoomOutTap = zoomOutTap
zoomInTap = zoomInTap
if ( event.target.id == "1" ) and ( canZoomOut == true) then
print( "Zoom out taps", zoomOutTap )
if (zoomOutTap > 1) then
zoomOutTap = zoomOutTap - 1
controls.objectZoomOut()
else
canZoomOut = false; canZoomIn = true; zoomOutTap = 4
print( "No more zoom out!" )
end
elseif ( event.target.id == "2" ) and ( canZoomIn == true) then
print( "Zoom out taps", zoomInTap )
if (zoomInTap > 1) then
zoomInTap = zoomInTap - 1
controls.objectZoomIn()
else
canZoomIn = false; canZoomOut = true; zoomInTap = 4
print( "No more zoom! in" )
end
end
end
return true
end