saricden/no-place-like

Generic Gun class

Opened this issue · 0 comments

[Problem]

It would be good to have a generic Gun class we can extend from to create new weapons quickly.

[Solution]

  1. Create new Gun class and extend from Container.
  2. 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.
  1. Create new property for weapon in MCAfrica constructor config pass in instantiated gun.
  2. Create a switchWeapon(weapon) function on our MCAfrica class.