This commit is contained in:
GordonDaFreeman 2017-09-20 22:07:43 +02:00
parent 189afc5a66
commit 91f15c4809
3 changed files with 17 additions and 3 deletions

View File

@ -13,6 +13,7 @@ public class Spiel {
Team heimteam;
Team auswärtsteam;
Schiedsrichter schiri;
Ball b;
//true = heim | false = auswärts
boolean ballBesitz;
@ -41,6 +42,14 @@ public class Spiel {
ballteam = auswärtsteam;
nichtballteam = heimteam;
}
for(Spieler s:ballteam.spieler){
double d = s.geschwindigkeit;
if(s.hasBall()) d-=1;
s.p.moveTo(nichtballteam.torwart.p, d);
}
for(Spieler s:nichtballteam.spieler){
s.p.moveTo(b.s.p, s.geschwindigkeit);
}
}
private void attackPhase(){

View File

@ -1,5 +1,5 @@
package fußballmanager.personen;
public class Ball{
Person p;
public Spieler s;
}

View File

@ -10,8 +10,8 @@ public class Spieler extends Person {
int verteidigung;
int tore;
int motivation;
double geschwindigkeit;
Position p;
public double geschwindigkeit;
public Position p;
Ball b;
public void setBall(Ball b){
@ -40,4 +40,9 @@ public class Spieler extends Person {
this.vorname = Datenbank.genVorname();
this.name = Datenbank.genName();
}
public boolean hasBall() {
if(b!=null) return true;
return false;
}
}