Increasing enemy speed question

Hi there! I was wondering how to implement the enemies speeding up every time they spawn?

I tried a few methods but none of them worked. I created a variable named ‘Kill count’ and added 1 to it every time the player kills an enemy. I then set up a while loop in the enemy script with the kill count as the condition. I think my problem might be that the enemy gets queue_free() so the variable is reset every time. I’m really out of my depth with it and was hoping some of you kind folks might have a solution.

Hi there,

You can keep track of the kill count either in the game.gd or the enemy_spawner.gd script. Then you need to change the speed of the enemy when you instance it. You can do that in the spawn_enemy() function of the enemy spawner or the _on_enemy_spawner_enemy_spawned function in the game script. Let me know if this explanation is enough, I can go a little bit more in depth if you need more help

1 Like

Hey Kaan,

That makes sense, I will try to implement this. Thankyou!

(BTW I really enjoyed your tutorials and would like to see more, especially Godot)

Kind regards.

1 Like

Thank you very much, best of luck!

1 Like

I have temporarily moved onto a C++ tutorial and I must say Godot seems a bit easier with it being a dynamic language. But learning some fundamentals in Godot has helped me a ton. There’s a lot I still need to learn though about OOP.

That’s great, learning C++ is an important skill in the games industry regardless of using Godot or not.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms