Hello, Im trying to create a feature in which at Night Enemies can spawn in random positions so that way I dont have to spawn them in a fixed position and how would I create a functional day/night system
Im trying to implement this in a top-down enviroment
Hi, it depends what you mean with a functional day and night system. Should it get dark in the night etc.? In any case you need a timer and based on the elapsed time you decide when it is night or day in your game.
Add a boolean variable “night”
And, change it every 20 minutes (“wait 1200 seconds” action)
When “night = true” and “repeat every RandomInRange(2,5) or RandomInRange(10,30)” do the “create object “Enemy” in position RandomInRange(first X pixel of map, last X pixel of map), RandomInRange(first Y pixel of map, last Y pixel of map)”
I hope that at least something will be understandably here…