Skip to content

Commit

Permalink
[Linesh][#22] Refactor: extract object center 55 as variables
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanLin-TWer committed Mar 19, 2017
1 parent 059c4e2 commit e8dca9b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/constants/game.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
export class Game {
static CELL_WIDTH = 101
static CELL_HEIGHT = 83
static OBJECT_CENTER = 55

static COLLISION_RADIUS = 12

static HORIZON_CELLS = 5
static VERTICAL_CELLS = 6

static BOARD_WIDTH = Game.CELL_WIDTH * Game.HORIZON_CELLS

static row(y) {
return this.CELL_HEIGHT * (y - 1) + 55
return this.CELL_HEIGHT * (y - 1) + this.OBJECT_CENTER
}
static col(x) {
return this.CELL_WIDTH * (x - 1)
Expand Down

0 comments on commit e8dca9b

Please sign in to comment.