Constructor
new BonusDropper(game)
Create a bonus dropper factory.
Parameters:
Name | Type | Description |
---|---|---|
game |
SpaceInvaders | The current game. |
- 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()
Usuall method called to make a new item in this factory
- Inherited From:
- Source:
makeItem() → {BonusDrop}
Make a new Bonus Drop item based on a random selection and return it.
Usually called from the inherited Factory.make() method.
- Overrides:
- Source:
Returns:
The bonus drop created.
- Type
- BonusDrop
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: