Coin counter
Ayolabi12345
Member Posts: 30
I have a coin system. However I can't figure out how to put like a counter on the stage to show how many coins the player has collected (In total)
Comments
To keep track of the number of coins, make an integer game attribute called game.coins. Have a rule that says If actor collides with [coin actor] -- or however you pick up coins -- Change Attribute game.coins to game.coins+1. Obviously, you can add any number you want such as 10 coins, 50 coins, etc. Then use a Display Text behavior and select game.coins from the Attribute Browser inside of the expression editor. Be sure to set the text color to something other than the scene background color.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
ok thanks. um another thing (sorry ima noob) how do imake my touch control follow the screen?
Put your HUD (touch control) on a seperate layer and make that layer non-scrollable (checkbox on the layer)
@ookami007 its not working!!!
@Ayolabi12345 the touch controls that you want to move with the scene has to be inside the camera area in the scene editor.
Mental Donkey Games
Website - Facebook - Twitter
Here is a tutorial for creating non-scrolling GUI's:
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
I won't try to overshadow Jamie, but the demo I posted of the ammo, also contained a scrolling level - just walk to the right and a non-movable GUI - namely the ammo counters.
You will see that I put them all on a layer that is ON TOP of all of the other layers and scrollable is unchecked. Hopefully it will help.
https://dropbox.com/s/i2k9aw6mgvzkir5/Ammo%20Demo.zip?dl=0