Let’s go over how to add Unity ads to the platformer project.
First, open the Services window and enable ads. Enable test mode to be able to test in the inspector:
Let’s go over how to set up an enemy that can fire projectiles based on an event triggered by the animation.
This article continues to build on the enemy behaviour from this article.
First, create the projectile by dragging in the first frame of the projectile animation. Set the order layer to ensure it is visible and add a box collider:
Interfaces are great when it comes to adding shared functionally to unrelated objects. For example, both enemies and boxes can be damaged. Another example is NPCs and buttons which both can be interacted with but they have nothing else in common. Let’s go over how to add damage to enemies using an Interface:
I will use the hit box I set up in this article and continue to build on the enemy class from this article.
Create the script for the interface and call it IDamageable:
Let’s go over how to set up patrolling enemies for 2D platformer.
Create an empty game object and drag in the first sprite from the idle animation as a child of the game object. Reset the position on the sprite and make sure that the sprite is on the correct order layer:
Indie Game Developer