Browse Source

use game.playfield instead of module-global constants

develop
Rob Colbert 2 years ago
parent
commit
8e47e88a5e
  1. 5
      game/js/lib/game-player.js

5
game/js/lib/game-player.js

@ -7,9 +7,6 @@
import { NiceVector2d } from 'dtp-nice-game';
import NiceSprite from 'dtp-nice-game/lib/nice-sprite.js';
const CANVAS_WIDTH = 960;
const CANVAS_HEIGHT = 540;
const CELL_WIDTH = 82;
const CELL_HEIGHT = 128;
@ -20,7 +17,7 @@ const CELL_HEIGHT = 128;
export default class GamePlayer extends NiceSprite {
constructor (game) {
super(game, new NiceVector2d(CANVAS_WIDTH / 2, CANVAS_HEIGHT - 20));
super(game, new NiceVector2d(game.playfield.width / 2, game.playfield.height - 20));
this.game = game;
this.moveSpeed = 12;
this.registration = new NiceVector2d(CELL_WIDTH / 2, CELL_HEIGHT);

Loading…
Cancel
Save