Is there a way to have a "scoreboard"?

Is there a way to make it so that if the player colides with a coin then a number on the scoreboard will gain a point?

I put together a simple example here: https://flowlab.io/game/view/10686

Basically, I just set up a simple platformer level, then did the following:

  • Added a “Coin” object and cloned it a couple of times, with the following logic:
  • A Collision trigger, connected to a Sound Effect to play a chime
  • which is then connected to a Destroy behavior to make the coin disappear
  • Added the following logic to the player:
  • A Collision
  • trigger, set to collide with only the "Coin" objects
  • A Number called "coins", with the collision trigger connected to its increment ("+") input
  • A Label added to display the current count whenever the value changes.

Hope this helps.

@grazer How can we move the position of the LABEL on the screen. I tried different ways but no success, the label is in the middle of the game and is annoying, for sure is a way to properly place it on the screen.
Thanks!

@grazer I found this description under the Help section (With the object selected, click and drag the label to adjust its display position.)
Sorry to say but I can not manage to MOVE or REPOSITION the label text on my game layout. I add the Label behaviour and then a “text” is automatically placed on the center of my game and it fades out, after this that “text” can not be selected or manipulated in any way. If I click the Label behaviour the text get coloured for a second and then fades out.
Thanks!

Here, I’ll explain that for you.
Let’s say you have your player have a collision with a coin and that triggers the text label, or bar. What you want to do is click on your player so the menu pops up, hit edit, but don’t hit behaviors or anything. If the pop up is in the way, move the player so you can see the label. Now you can click and drag the label or bar, as long as the object it is set on has the edit menu open (the one with the picture and the behavior buttons showing)

@Mhx Ar - Thanks for the tip, now I did fix my labels.

It doesn’t work for me for some reason. The score adds up to one and then stops; it doesn’t count any more points. If you want to look at my game, the way I want to increase the score is by hitting the bad guys with the Ice Beam, so i put the behavior in the Ice Beam, instead of my character who dies if he touches them. Here’s the link. http://flowlab.io/game/view/169067

I make it send a message then destroy. :stuck_out_tongue: but that is just me