bugg fix
This commit is contained in:
parent
556e2f4866
commit
02b0dab13d
1 changed files with 6 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ package ei.game.player;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import ei.engine.scene.Node;
|
||||
import ei.game.gamestate.EndGameState;
|
||||
|
||||
public class PlayerHandler {
|
||||
// The instance of this class
|
||||
|
|
@ -85,6 +86,11 @@ public class PlayerHandler {
|
|||
for(int i=0; i<players.size() ;i++){
|
||||
if(players.get(i).defeated()){
|
||||
players.get(i).kilAll();
|
||||
players.get(i).endGame(EndGameState.DEFEAT);
|
||||
players.remove(i);
|
||||
if(players.size() == 1){
|
||||
players.get(0).endGame(EndGameState.VICTORY);
|
||||
}
|
||||
}
|
||||
else{
|
||||
players.get(i).update();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue