Newer
Older
taikaGame / piece.js
@evalanai evalanai on 27 Apr 515 bytes add temporaly images of piece
// -*- coding: utf-8-unix -*-

// 本家は全部で11段階あるっぽい
export const PIECE_TYPE = Object.freeze({
  level: {
    1: {
      image: 'img/circle.png',
      radius: 10
    },

    2: {
      image: 'img/circle2.png',
      radius: 15
    }
  }
});

export class Piece {
  #level;                  // 種類

  constructor(type, initCoord) {
    this.#level = type;
  }

  get radius {
    return PIECE_TYPE[this.#level].radius;
  }

  get imgPath {
    return PIECE_TYPE[this.#level].image;
  }
}