0 votes

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!

in Engine by (12 points)
retagged by

1 Answer

0 votes

You can use the Timer node (internally named SceneTreeTimer): http://docs.godotengine.org/en/3.0/classes/class_scenetreetimer.html

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.

by (28,744 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.