Compare commits
No commits in common. "feature/shogun-in-danger" and "master" have entirely different histories.
feature/sh
...
master
@ -36,8 +36,6 @@ class Game {
|
||||
this.blackPlayer = new Player('black');
|
||||
this.chosenFigure = new Figure(0,0);
|
||||
this.fields = [];
|
||||
this.currentPlayer = 'white';
|
||||
this.otherPlayer = (this.currentPlayer == 'white') ? 'black' : 'white';
|
||||
}
|
||||
drawGamePanel(x,y, widthAndHeight) {
|
||||
var boxes = new Array();
|
||||
@ -95,10 +93,6 @@ class Game {
|
||||
}
|
||||
|
||||
handleClick(item) {
|
||||
if(!item.classList.contains(this.currentPlayer) && !item.classList.contains('possibleMove')) {
|
||||
alert(this.otherPlayer + ' ist nicht dran');
|
||||
return;
|
||||
}
|
||||
if(item.classList.contains('shogun') || item.classList.contains('farmer')) {
|
||||
this.chosenFigure.setX(item.getAttribute('data-x'));
|
||||
this.chosenFigure.setY(item.getAttribute('data-y'));
|
||||
@ -359,13 +353,6 @@ class Game {
|
||||
this.showPossibleMoves();
|
||||
this.chosenFigure.reset();
|
||||
game.updateLists();
|
||||
this.switchPlayers();
|
||||
}
|
||||
|
||||
switchPlayers() {
|
||||
var currentPlayer = this.currentPlayer;
|
||||
this.currentPlayer = this.otherPlayer;
|
||||
this.otherPlayer = currentPlayer;
|
||||
}
|
||||
|
||||
removeIndicator() {
|
||||
@ -377,6 +364,8 @@ class Game {
|
||||
updateLists() {
|
||||
var whiteList = document.querySelector('.whitePlayer');
|
||||
var blackList = document.querySelector('.blackPlayer');
|
||||
console.log(whiteList)
|
||||
console.log(blackList)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user