With the deadline fast approaching, this week I focused on getting all of the logic completed for the player’s weapon, which I decided to call the ‘Evaporator’. After encountering performance issues with a previous approach that involved the creation and destruction of a lot of collision sprites, I did some research and found a suitable solution would be creating a class that extends Phaser.GameObjects.Line, listening for intersections with select body’s/rectangles and then simulating collision.

With the bullet/’Beam’ class completed, I setup the ‘Evaporator’ class that controls the position and length of the beam’s geometry when the fire function is called.

Putting it all together, in the game’s update function I’m handling inputs from the control key for fire – calling the functions previously setup in both the Evaporator and Beam class.
