Generic Gun class
Opened this issue · 0 comments
saricden commented
[Problem]
It would be good to have a generic Gun
class we can extend from to create new weapons quickly.
[Solution]
- Create new
Gun
class and extend fromContainer
. - Add config key/value properties w/ defaults to
constructor(config)
.
- Projectile sprite key.
- Gun sprite key.
- Gun idle animation key (if applicable, defaults to false).
- Gun shoot animation key (if applicable, defaults to false).
- Emitter config (spread operator pass-through).
- Pistol grip v rifle x shotgun style grip.
- Create new property for
weapon
inMCAfrica
constructor config pass in instantiated gun. - Create a
switchWeapon(weapon)
function on ourMCAfrica
class.