Creepwaves

in Programming & Dev2 years ago

Hello everybody!

giphygoblo.gif

This past week I worked on a creepwave something that I wanted to do since a long time, many challenges were discovered for something apparently simple as this.

First off setting it up was pretty easy just need a spawn object and an objective for the creeps to reach. This was easy by having a timer on the spawn object that create on set timer. On the creep object using the move_towards() function I could set the x and y of the objective and a set speed for the creeps to walk to.

Now onto the combat. Using the function distance_to_object() minor to a set distance from the enemy in pixels (say <100) the move_towards() function switched to the enemy though this had to be added a state in wich it was following the enemy as a priority over the final object.

This was all easy enough but when I wanted to add conquerable mid point using the same method I got many issues, probably because how the middle point were set up and the often back and forth conquer that happened creating many instances were the closest object changed rapidly and created an overflow of checks. I took a look to many MOBA(the genre in wich creepwaves are the base of the game) and to my surprise that wasn't what they did. Usally creepwaves follow a path and attack what they find on the way.
So I left at that as you can see below in the video.

For now I'm happy with the results even though I would love to check the way drawable pathways work in Gml. Now the next step is to develop a game around this creepwaves rattling around a big battleground and how the player can interact with in a single player expirience.

Have a good week and enjoy!

Sort:  

Congratulations @mproxima! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You distributed more than 160000 upvotes.
Your next target is to reach 165000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

Be ready for the September edition of the Hive Power Up Month!
Hive Power Up Day - September 1st 2023
HiveBuzz Women's World Cup Contest - Prizes from our sponsors