| @@ -11,7 +11,7 @@ export default class Player extends Entity { | |||
| constructor(level) { | |||
| super(level, "player"); | |||
| this.bounds.size.set(1, 2); | |||
| this.bounds.size.set(0.5, 2); | |||
| this.addTrait(new TCollider(this)); | |||
| this.addTrait(new TKeyboardController(this)); | |||
| this.addTrait(new TPhysics(this)); | |||
| @@ -22,8 +22,11 @@ export default class Player extends Entity { | |||
| } | |||
| draw(ctx) { | |||
| this.texture.draw(ctx, | |||
| this.bounds.pos.pixelX - assets.entities.scale * 1.5, | |||
| this.bounds.pos.pixelY); | |||
| let x = | |||
| this.bounds.pos.pixelX - | |||
| assets.entities.scale * 1.5 - | |||
| this.bounds.size.pixelX / 2 | |||
| this.texture.draw(ctx, x, this.bounds.pos.pixelY); | |||
| } | |||
| } | |||