Jump to content

Multiple bullet hell :) ? How to approach a per-bullet damage.


Recommended Posts

Hello fellas,

I'm in the process of structuring weaponry for my shmup.


Instead of having one shot from the spaceship, it will have different cannons that will shoot different bullet types that cause different damage (and effects).

What I need to do also - is - at impact of each different bullet with an enemy a few calculations have to be made:


1. the damage caused (for example > difference between the enemy armor and the shot damage)

2. the critical hit chance

3. the critical hit damage

4. the area damage

5. any particular effect.


I was just wondering if this is even possible - first of all, and how would I track each bullet.


I've still got to do this, so I have not got any code yet, just asking for some advice.

Thanks guys!


Link to comment
Share on other sites

Is each bullet a sprite? Can you extend Phaser.Sprite and include all these as properties in the class? Then, on collision, you could read the values for their effects. Then, yeah, each bullet could be added to a Group and then you can check player collision against the group.

Link to comment
Share on other sites

That it:

Either you extend Phaser.Sprite (which I would recommand, check the Phaser examples)

Or you could (since javascript is flexible) simply create a sprite that contains custom properties:

    mySprite.desiredDmg = 10;

    mySprite.shootArea = 300;


But I wouldn't recommand this since it can quickly become messy.

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...