Coin counter

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    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.

  • Ayolabi12345Ayolabi12345 Member Posts: 30

    ok thanks. um another thing (sorry ima noob) how do imake my touch control follow the screen?

  • ookami007ookami007 Member Posts: 581

    Put your HUD (touch control) on a seperate layer and make that layer non-scrollable (checkbox on the layer)

  • Ayolabi12345Ayolabi12345 Member Posts: 30

    @ookami007 its not working!!!

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    @Ayolabi12345 the touch controls that you want to move with the scene has to be inside the camera area in the scene editor.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Here is a tutorial for creating non-scrolling GUI's:

  • ookami007ookami007 Member Posts: 581

    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

Sign In or Register to comment.