Change images of menus
doug_smuppet
Member Posts: 99
When I start my game, appear a button "New Game", and then when I play and save all attributes... after close my game and return to play again, how can I use the attribute to change the image of the button "New Game" to "Continue Game"? What attribute use to do this?
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
There is many ways to accomplish this as I said, this is how i usually do it.
something like that
You wouldn't need to save the image at all... just save a boolean that keeps track of whether or not the game has started. You don't need tables, although tables are great for storing large amounts of values/attributes.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
1 - I create a Game Attribute as boolean called Started.
2 - I create a actor Loadgame (in first scene)
......|_ Put Load Attribute behavior and
..........|_ From: load_button_continue load: game.Started
3 - On button "New Game"
......|_ Rule (When Touch is Pressed)
..........|_ Change Scene (to level 1)
..........|_ Change Image (set image to: btn_continue)
..........|_ Change Attribute
..............I_ set: WHAT PUT HERE to: game.Started
..........|_ Save Attribute
..............I_ save: game.Started as: load_button_continue
1 - I create a Game Attribute as boolean called Started and set it to false.
2 - I create a actor Loadgame (in first scene)
......|_ Put Load Attribute behavior and
..........|_ From: Started load: game.Started
3 - On button "New Game"
......|_ Rule (When Touch is Pressed)
..........|_ Change Attribute game.Started to true
..........|_ Save Attribute
..............I_ save: game.Started as: Started
..........|_ Change Scene (to level 1)
..........|_ Change Image (set image to: btn_continue)
In your button actor, you would do:
When/If game.Started is true
..........|_ Change Image (set image to: btn_continue)
..........|_ Otherwise/Else
...............|_ Change Image (set image to: btn_start)
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left