Categories
Uncategorised

Week 12/01/21

This week we were asked to create a simple tank game in phaser including player and enemy tanks, movement, shooting, destructable walls. This project taught us how to use custom properties and texture atlases gave us a very simple enemy ai where they would move straight in a direction until they hit a wall where they would turn bounce off of it perpendicular to where they came from

A big thing we learnt from this project was the implementation of classes and classes that extend from a base. During this project we needed to create a BaseTank class that would hold all of the functions and variables that would be needed to extend off of for the other classes. This was a big change from having all of our functions and variables inside of a singular file and this made it easier to find what we needed inside of it and made it easier to sort.

The basetank class needed a constructor in order to set it up, the tank is made up of three parts for it to work correctly, the turret for spawning the bullets, the hull for collision and movement and the shadow for nicer visuals. Inside of update these three need to be lined up correctly