I have replicated the megaman x megabuster.
I have 3 shots, with the same Gameobject. (each with different animations)
Each of them have different animation.
mediafire.com/view/v1m7tu4wz ... buster.jpg
mediafire.com/file/2ota54i36 ... 20tiro.jpg
How do I make So each version of Mega buster, do different types of damage. to the Goomba. in this example_
mediafire.com/file/uze0e9dos ... harged.jpg
Develop games in your browser. Powerful, performant & highly capable.
Your links got shortened and not working.
Two ways to do this:
1. add "shotDamage" instance variable to your shot sprite. When shot is created, set shotDamage to some number (how much damage it should deal).
When shot hits an enemy, subtract shotDamage from enemy's health.
2. When shot hits the enemy, compare shot's animation name and/or animation frame and decide how much damage it will deal.
Something like this:
Shot On collision with Enemy
...Shot animation "BigBullet" is playing -> Enemy subtract 100 from health
...Shot animation "SmallBullet" is playing -> Enemy subtract 20 from health
So this worked thanks!