fix: changed a couple of methods
This commit is contained in:
parent
696735af14
commit
6b74d3ad7c
|
@ -88,25 +88,16 @@ public class Bow extends Actor {
|
||||||
return new Arrow(angle, power, shooter);
|
return new Arrow(angle, power, shooter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indiquer que c'est a son tour de jouer.
|
* Change the active state of the {@link Bow}.
|
||||||
|
* @param bool true or false
|
||||||
*/
|
*/
|
||||||
public void startPlaying() {
|
public void setPlaying(boolean bool) {
|
||||||
playing = true;
|
playing = bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indique que ce n'est plus son tour de jouer.
|
* @return the active state of the {@link Bow}.
|
||||||
*/
|
|
||||||
public void stopPlaying() {
|
|
||||||
playing = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Savoir si il est entrain de jouer.
|
|
||||||
*/
|
*/
|
||||||
public boolean isPlaying() {
|
public boolean isPlaying() {
|
||||||
return playing;
|
return playing;
|
||||||
|
|
|
@ -75,23 +75,16 @@ public class Player extends BaseActor {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indiquer que c'est son tour de jouer.
|
* Change the active state of the {@link Player}.
|
||||||
|
* @param bool true or false
|
||||||
*/
|
*/
|
||||||
public void startPlaying() {
|
public void setPlaying(boolean bool) {
|
||||||
bow.startPlaying();
|
bow.setPlaying(bool);
|
||||||
playing = true;
|
playing = bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indique la fin de son tour de jeu.
|
* @return the active state of the {@link Player}.
|
||||||
*/
|
|
||||||
public void stopPlaying() {
|
|
||||||
bow.stopPlaying();
|
|
||||||
playing = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Savoir si il est entrain de jouer.
|
|
||||||
*/
|
*/
|
||||||
public boolean isPlaying() {
|
public boolean isPlaying() {
|
||||||
return playing;
|
return playing;
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class GameScreen extends BaseScreen {
|
||||||
|
|
||||||
mainStage.addActor(players);
|
mainStage.addActor(players);
|
||||||
playerTurn = 0;
|
playerTurn = 0;
|
||||||
player1.startPlaying();
|
player1.setPlaying(true);
|
||||||
|
|
||||||
// arrows
|
// arrows
|
||||||
arrows = new Group();
|
arrows = new Group();
|
||||||
|
@ -81,16 +81,15 @@ public class GameScreen extends BaseScreen {
|
||||||
|
|
||||||
Player actualPlayer = (Player) players.getChild(playerTurn);
|
Player actualPlayer = (Player) players.getChild(playerTurn);
|
||||||
if (actualPlayer.isPlaying() && !actualPlayer.getBow().isPlaying()) {
|
if (actualPlayer.isPlaying() && !actualPlayer.getBow().isPlaying()) {
|
||||||
actualPlayer.stopPlaying();
|
actualPlayer.setPlaying(true);
|
||||||
playerTurn++;
|
playerTurn++;
|
||||||
playerTurn %= players.getChildren().size;
|
playerTurn %= players.getChildren().size;
|
||||||
actualPlayer = (Player) players.getChild(playerTurn);
|
actualPlayer = (Player) players.getChild(playerTurn);
|
||||||
actualPlayer.startPlaying();
|
actualPlayer.setPlaying(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void removePlayer(Player player) {
|
public void removePlayer(Player player) {
|
||||||
int index = players.getChildren().indexOf(player, true);
|
int index = players.getChildren().indexOf(player, true);
|
||||||
if (index < playerTurn) {
|
if (index < playerTurn) {
|
||||||
|
@ -101,7 +100,7 @@ public class GameScreen extends BaseScreen {
|
||||||
players.removeActor(player);
|
players.removeActor(player);
|
||||||
playerTurn %= players.getChildren().size;
|
playerTurn %= players.getChildren().size;
|
||||||
Player actualPlayer = (Player) players.getChild(playerTurn);
|
Player actualPlayer = (Player) players.getChild(playerTurn);
|
||||||
actualPlayer.startPlaying();
|
actualPlayer.setPlaying(true);
|
||||||
} else {
|
} else {
|
||||||
players.removeActor(player);
|
players.removeActor(player);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue