1234567891011121314151617181920 |
- import Entity from "../Entity.js";
-
- import TKeyboardController from "../traits/TKeyboardController.js";
- import TPhysics from "../traits/TPhysics.js";
- import TCollider from "../traits/TCollider.js";
-
- export default class Player extends Entity {
- constructor(level) {
- super(level);
-
- this.bounds.size.set(1, 2);
- this.addTrait(new TCollider(this));
- this.addTrait(new TKeyboardController(this));
- this.addTrait(new TPhysics(this));
- }
-
- draw(ctx) {
- this.bounds.draw(ctx);
- }
- }
|