How to set up a score counter?

Kastex

  • Posts: 40
i checked out some youtube tutorials for this but they don't exactly explain what i am looking for or in any detail that someone new can understand.

what i'm trying to do is having the score counter display at a certain area of the screen. i want the score to increase while the player is playing. like each second or whatever. the score will stop increasing when the player dies. i also want the score to increase by a set amount when the player collides with a specific actor.

can someone help me with this?

GameDev408

  • *
  • Posts: 239
First create an attribute, call it score.
When created, set alive to true
In an event, do every x seconds, if alive set score to score + 1
when drawing, draw text "score" at x,y
When player dies, set alive to false
when player collides with actor of type / specific actor, set score to score + y