added tore
This commit is contained in:
parent
47d57b8a88
commit
9dc5fdc6e2
|
|
@ -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(){
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue