Get Health Packs from special Animals

I know something was missing. There was no way to replenish your health before. But now you can rack up your health by picking up health packs which are popped from special animals. Let me know if you found the right animals.

p17

Here Is the Class script attached to our Healthpack.

public class GiveHealth : MonoBehaviour

{

    public GameObject     Effect;

    public int              HealthToGive;

    public void OnTriggerEnter2D (Collider2D other)

    {

        var player = other.GetComponent<Player>();

        if (player == null)

            return;

        player.GiveHealth (HealthToGive, gameObject);

        //Instantiate (Effect, transform.position, transform.rotation);

        DestroyHealthPack();

    }

    public void DestroyHealthPack()

    {

        Destroy(gameObject);

    }

}

Thanks for reading.

if you want to check out some of our projects please subscribe to our YouTube channel:

You can check up our work in progress games here:

If you are looking for solutions to game development issues see our blogs here:

If you like our projects please sign up for our newsletter at the bottom of this Page.

Leave a Reply