Trending
Opinion: How will Project 2025 impact game developers?
The Heritage Foundation's manifesto for the possible next administration could do great harm to many, including large portions of the game development community.
The thirteenth weekly devlog of Deterrence. This week I use the unity animation events to make enemies deal damage and spawn enemies for levels. And the project starts to feel like a game as pieces come together.
Since the enemy robot's animation shows the unit firing twice, I decided to also use events for each fire animation that would call the enemy unit's fire method. This gave me a lot of wiggle room to make units shoot in different ways and also made it very simple to calculate unit DPS (Damage Per Second). So, I decided to make player units follow this structure as well.
Calculating DPS using Unity animations required grabbing the RuntimeAnimatorController of the units Animator. With the RuntimeAnimatorController, I can find the fire animation by name and then simply use the animation length and number of events in the animation.
Unity animation event functions don't support methods that have multiple parameters, so, to get around this, I made a method with a string parameter and pass multiple parameters separated by a comma in a large string. With this trick, I can use animation events to spawn diverse enemy groups at any start point in the level. Doing it this way will make it easier to build levels by using the animations like event timelines and using the extra functionality that comes with animations.
Now that enemy units can deal damage to player units and buildings, and can move towards points of interest; Play testing is now starting to feel like playing a game. I'm starting to balance stats and list of functionality to implement is dwindling. The game is approaching an alpha stage and by my estimate I believe there will be an alpha version of the game within the next 2 months.
Read more about:
BlogsYou May Also Like