Categories
Blog

Week 3 Journal Log 24/10/22

This week we were introduced to Phaser, a JavaScript coding utility. This allowed us to simulate physics and arcade type games.

Bullet Bro’s

Bullet Bro’s is the game I decided to make, it’s a mix of Smash Bros and a Bullet Hell type of game.

This game originated from the JavaScript Demo file which looked like this
This is what the game looks like now

This is my main focus as our deadline is on the 25th of November, I have used the demo to familiarise myself with how phaser works and am currently using the Phaser api to give myself a solid foundation to improve my code and design a working JavaScript game.

I changed the start to not just give points, but to make the player invincible and give the player a higher shooting rate, this was inspired from Super Mario, and I decided to show that by making the player change colours while the invincibility is in effect.

This code shows the invincibility being set and the duration for how long it lasts.

Collision Detection

This week we also worked on using physics on our sprites and collision detection.

This was the axis aligned collision detection that we researched. Axis aligned bounding box collision is a collision type that detects collision between 2 rectangles that have the same axis rotation. This means that rectangles with different rotations cannot be compared.
This is the circle collision. With circle collision it will take the radius of the 2 circles and add them together, if the distance between the centre points of the 2 circles is less than the value of the 2 radii’s added together than they are colliding, if the distance is greater than the value then they are not colliding.

Leave a Reply

Your email address will not be published. Required fields are marked *