How to correlate enemy spawn with player's healthbar?

Godot Version

4

Question

Hey! I’m basically making a horror game right now and I’m stuck because I want to spawn different enemies according to the player’s healthbar. What should I do??? Please help as I’m a beginner. Thank you!

Do you need something more complicated than this?

if player_health < 25:
    spawn_enemy_1()
elif player_health < 50:
    spawn_enemy_2()
(...)
3 Likes

Thanks mate! Basically in my game the healthbar acts as an insanity meter so if you lose 25 health you’re in insanity level 1. So what I’m saying is when the player reaches 50% health, they go into insanity level 2. I want the insanity level 1 enemies to despawn and level 2s enemies to spawn and vice versa when healed. Is that too much? Thanks in advance.