Constructor
new EnemyBombFactory(game)
Create the bomb factory.
Parameters:
Name | Type | Description |
---|---|---|
game |
SpaceInvaders | The current game instance. |
- Source:
Extends
Methods
canMake() → {boolean}
Check if we can make a new instance based on maxItems
- Inherited From:
- Source:
Returns:
- Type
- boolean
destroy(item) → {Object}
Destroy an instance created by this factory
Parameters:
Name | Type | Description |
---|---|---|
item |
Object | The item / instance to destroy |
- Inherited From:
- Source:
Returns:
Returns the instance created
- Type
- Object
make(droppedBy) → {boolean}
Public make method to drop a new bomb.
Parameters:
Name | Type | Description |
---|---|---|
droppedBy |
EnemyShip | The enemy ship that dropped this bomb. |
- Overrides:
- Source:
Returns:
True or false if bomb was dropped.
- Type
- boolean
makeItem(droppedBy) → {EnemyBomb}
Private method, make a new Bomb and return the instance.
Parameters:
Name | Type | Description |
---|---|---|
droppedBy |
EnemyShip | The enemy ship that dropped this bomb. |
- Overrides:
- Source:
Returns:
The bomb instance created.
- Type
- EnemyBomb
reset()
Destroy all items and reset the data
- Inherited From:
- Source:
resetCountdown()
Restart the auto make countdown based on max / min delay
- Inherited From:
- Source:
update()
Main update loop
- Inherited From:
- Source: