xxxxxxxxxx
36
class Player {
constructor(id) {
this.id = id;
this.tileID = 0;
this.rad = 5;
this.px;
this.py;
this.isDragged = false;
}
getID() {
return this.id;
}
getTileID() {
return this.tileID;
}
setTileCount(diceResult) {
this.tileID = this.tileID + diceResult;
}
mouseHover(mx, my) {
return dist(mx, my, this.px, this.py) < this.rad;
}
mouseDragged(mx, my) {
if (mouseHover) {
this.isDragged = true;
}
}
resetDrag() {
this.isDragged = false;
}
}