added tore

This commit is contained in:
delta1805 2017-09-24 22:28:08 +02:00
parent 47d57b8a88
commit 9dc5fdc6e2
2 changed files with 42 additions and 26 deletions

View File

@ -148,6 +148,10 @@ public class Spiel {
} }
if (weiter) { if (weiter) {
double tordis = s.p.getDistance(nichtballteam.torwart.p); double tordis = s.p.getDistance(nichtballteam.torwart.p);
if(tordis <10){
tor();
}else{
tordis = s.p.getDistance(nichtballteam.torwart.p);
Spieler t = null; Spieler t = null;
boolean ss = false; boolean ss = false;
for (Spieler m : ballteam.spieler) { for (Spieler m : ballteam.spieler) {
@ -179,13 +183,24 @@ public class Spiel {
} }
} }
} }
}
break; break;
} }
} }
} }
public boolean torMoeglich(){ public void tor(){
return false; if(ballBesitz){
heimteam.tore++;
System.out.println("Heimteam punktet!");
heimteam.setPositions(true);
auswärtsteam.setPositions(false);
}else{
auswärtsteam.tore++;
System.out.println("Auswärtsteam punktet!");
heimteam.setPositions(true);
auswärtsteam.setPositions(false);
}
} }
public void ballWechsel(){ public void ballWechsel(){

View File

@ -9,6 +9,7 @@ public class Team {
public Spieler[] spieler = new Spieler[10]; public Spieler[] spieler = new Spieler[10];
Torwart torwart; Torwart torwart;
int siege = 0; int siege = 0;
int tore;
public Team(String name){ public Team(String name){
this.name = name; this.name = name;