Hey guys ! I was looking through the forums, but I couldn't find anything helpful, so I'll have to ask:
-I'd like to make a Hack & Slash game, and I don't really know how to make the combat system, especially the aggro. The point would be that you could pick a target, and if he is in range, you hit him every X seconds. So I wondered if you could select a single ennemy to be that target, and change it when you click him.
Any help is welcome !
Develop games in your browser. Powerful, performant & highly capable.
You've already kinda answered your own question.
First you would check which enemy is selected, and store that in a variable. Then you would check the distance between the player and the enemy is withing striking distance. And if so, start playing a loop of the attack animation, and apply damage every X seconds to the selected target.
Yeah but can you store like a sprite in a variable ? Sorry I expressed myself badly I guess