0 Favourites

Picking up coins and scoring points

This forum is currently in read-only mode.
  • Hello!

    I just stumbled across construct classic a couple weeks back and i'm making a simple super mario style platform game with coins to pick up and enemies to squash.

    I just need to know how I can make the objects I pick up affect my score. I have learnt how to create the object and destroy it on contact with my player but I don't know how to make this all add up and pop up on the HUD (which i still need to do but i'm sure thats pretty straightforward..)

    I've gone through a bunch of the platform tutorials but for some reason haven't found what i'm looking for yet..

    If anyone could help that would be great! I've found info on most other subjects apart from this one!

    Thanks for your time!!

    Sam

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Hi, I would probably do it like this:

    Select your player character and look at its properties.

    Add a private variable called "score", by default it should be a number and 0.

    Add a text box on another layer, name it and set that layer so that it doesn't scroll. This will be what displays your score.

    In your event sheet add a new system condition for "Always (every tick)" and then an action: select the text box, then select "set text" - the set text screen will come up as "" don't type anything in there yet, instead double click your player object, then "get private variable" - it will input something like player.Value('Variable name') - replace the 'Variable Name' with what you named your private variable before eg 'score' - keep the quotations. So now, every tick it will set the text box to whatever value the private variable 'score' is.

    So all you have to do now is add an action to whatever happens when you hit a coin - so on collision with player and coin add 1 to private variable 'score'

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
217 18,532
humanescape's avatar
humanescape
Unread hot topic
0 Favourites
Construct 2 Coin Op Jam
51 4,019
Ragevortex's avatar
Ragevortex
Unread hot topic
57 16,721
Blinx123's avatar
Blinx123