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.

Platform.js 372B

123456789101112131415161718
  1. import Entity from "../Entity.js";
  2. import TPlatform from "../traits/TPlatform.js";
  3. import TCollider from "../traits/TCollider.js";
  4. export default class Platform extends Entity {
  5. constructor(level) {
  6. super(level);
  7. this.bounds.size.set(5, 1);
  8. this.addTrait(new TCollider(this));
  9. this.addTrait(new TPlatform(this));
  10. }
  11. draw(ctx) {
  12. this.bounds.draw(ctx);
  13. }
  14. }