Skip to content

Instantly share code, notes, and snippets.

@tuykin
Created May 24, 2018 18:07
Show Gist options
  • Save tuykin/ec730df3aa43a8b5096f79e71f95eefe to your computer and use it in GitHub Desktop.
Save tuykin/ec730df3aa43a8b5096f79e71f95eefe to your computer and use it in GitHub Desktop.
GameDrawer
var cfg = {
boxes_count: 10,
players_count: 3,
boxes_seq: 'random' // 'sequental'
}
var game = new Game(cfg)
var bone_value = game.dropBone();
game.currentPlayer.moveTo(bone_value);
var gameTable = new GameTable(game)
gameTable.drawBoxes();
var gameDrawer = new GameDrawer(game);
gameDrawer.drawBoxes();
class GameDrawer {
contstructor(game) {
this.game = game;
}
drawBox(box) {
}
drawBoxes() {
this.game.boxes.each { this.drawBox(box) }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment