@alanFlickGames oh, it is very monstrous code, close your eyes and never use it, especially on Monday:
Modes = {}
Modes.greenLever = false
Modes.yellowLever = false
– etc.
Levers = {}
Levers.greenLeverOn = display.newImageRect ("green_lever_on.png", width, height)
Levers.greenLeverOn.x = ...
Levers.greenLeverOn.y = ...
Levers.greenLeverOff = display.newImageRect ("green_lever_off.png", width, height)
Levers.greenLeverOff.x = Levers.greenLeverOn.x
Levers.greenLeverOff.y = Levers.greenLeverOn.x
Status = {}
Status.greenLeverOn = function ()
Levers.greenLeverOff.isVisible = false
print ("Hey, the green lever is on!")
Modes.greenLever = true
end
Levers.greenleverOff.tap = Status.greenLeverOn
Levers.greenleverOff:addEventListener ("tap", Status.greenLeverOn)
Status.greenLeverOff = function ()
Levers.greenLeverOff.isVisible = true
print ("Hey, the green lever is off!")
Modes.greenLever = false
end
Levers.greenLeverOn.tap = Status.greenLeverOff
Levers.greenLeverOn:addEventListener ("tap", Status.greenLeverOff)
etc. the same for every lever…
Now, next step ==>>
Status.CompareYellowGreen = function ()
if Modes.yellowLever == true and
Modes.greenLever == true then
print ("Welcome to YelloGreen World!")
elseif Modes.yellowLever == false or Modes.greenLever == true then
print ("It's a final countdown!")
end
return true
end
Runtime:addEventListener ("enterFrame", Status.CompareYellowGreen)
Well, it is some like this, but I can’t guarantee this mess works everywhere in the entire Universe.
PS. Read this doc to get less work: https://docs.coronalabs.com/api/type/CoronaPrototype/new.html
PPS. Finally, I’ll prefer a combination of switchers and radiobuttons… Ok, @roaminggamer, you won.