Skip to content

Components

Oleksandr Malakhov edited this page Jul 25, 2018 · 2 revisions

Components are mostly standalone features with their own objectives and purposes, here are all components used in the game:

EnemyBullet

Responsible for shooting a guided bullet to the position where player was at launch, it does not follow the user completely.

fire function

takes in the starting position of the bullet and of the target and launches the bullet

update

updates the position of the bullet with each phaser cycle

hitPlayer

triggers when enemy bullet hits player, takes a life away

Ball

Generally the Ball gets called from the level scene and has 2 colliders. It checks for hits on brick and on the player. It is the driving component of the game since its the only object which can destroy bricks and gain points.

Bullet

The player can fire the bullets with the key S. They can be used to give the ball momentum or destroy enemy bullets.

heartObject and Heartplugin

Responsible for displaying the hearts which represent players lifes

Music

adds music to the scenes upon call and has functions to stop and start music from the scenes. Can also adjust each tracks volume individually

Sounds

The same as music but with sounds

Player

Contains all the code for player movements and triggering animations

Point drops

Upon a brick being destroy point drops are being droped with a certain chance, the code to change the chance of point drop is contained within the ball component. Point drops increase the score by 100 and are destroyed in 2,5 sec.