Constructor
new HUD(game, player)
Create a new HUD display
Parameters:
Name | Type | Description |
---|---|---|
game |
SpaceInvaders | The current game instance |
player |
PlayerShip | The player |
Properties:
Name | Type | Description |
---|---|---|
game |
SpaceInvaders | The current game instance |
player |
PlayerShip | The player instance |
components |
Array.<HUDComponent> | Array of HUD components being displayed. |
- Source:
Methods
addComponent(component)
Add a new component to the HUD
Parameters:
Name | Type | Description |
---|---|---|
component |
HUDComponent | The HUD component to add to the main HUD display |
- Source:
reset()
New game reset - because the HUD only represents data elsewhere nothing
needs to happen here.
- Source:
update()
Make a call to all the component update() methods. Called by main
game loop.
- Source: