Making a Boolean Switch
SolarPepperStudios
Member Posts: 754
Hey everyone! This is the first time in a while I've had to come here for coding help! Anyways, I'm trying to make an iOS styled switch that toggles a boolean. That sounds really simple but for some reason it isn't working for me. :-w Here is a screenshot of my code:
Comments
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
When the actor is touched and if game.boolean is false -
change game.boolean to true and change image to switchON
and the exact same thing only opposite for if it is true.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
When Touch is Pressed
--Change Attribute: game.toggle = 1-game.toggle
If you really must have a boolean, add the rule
If Attribute game.toggle == 1
--Change Attribute: game.BoolToggle = true
--Otherwise: Change Attribute: game.BoolToggle = false