Help creating a counter!

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By RodriGodot

Hi! First of all, sorry for my english, I hope I can express good enough so you can understand my questions.

I have mainly two problems, which probably are quite simple but I’m a begginer with this engine, and I’m starting to learn the basics.

I’m creating a simple game which is based on avoiding enemies. Right now I have created the main character, the enemies, and the scripts to get my main character deleted if he touches an enemy.

But I don’t know how to create two counters:

  1. A label which counters the time from the first second you are playing until you ‘die’ (dissapear).
  2. and a second counter to let one of my enemies appear. I mean, lets say the player has been avoiding enemies for 1 minute.
    I want to let another type of enemy appaear from the minute 1:01.

So, can any of you help me with a script or some tips to do both things, please?
Thank you so much!

:bust_in_silhouette: Reply From: Zylann

You can use the Timer node (internally named SceneTreeTimer): SceneTreeTimer — Godot Engine (3.0) documentation in English

It has a property to choose how long it waits, and another to decide if it repeats or not.
When the countdown finishes, it will emit the timeout signal, which you can connect to your script.