You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Player.js 329B

1234567891011121314151617
  1. import Entity from '../Entity';
  2. import Vec2 from '../Vec2';
  3. import KeyboardControls from '../traits/KeyboardControls';
  4. export default class Player extends Entity {
  5. constructor(level) {
  6. super(level);
  7. this.bounds.size.set(20, 20);
  8. this.addTrait(new KeyboardControls(this));
  9. }
  10. draw(ctx) {
  11. this.bounds.draw(ctx);
  12. }
  13. }