some fixes
This commit is contained in:
parent
aced31b12c
commit
60c95835a4
|
@ -1 +1 @@
|
||||||
1579
|
1591
|
|
@ -75,7 +75,7 @@ class TronGame
|
||||||
foreach($this->bots as $bot){
|
foreach($this->bots as $bot){
|
||||||
$trailsArr[] = $bot->trail->getTrailAsArray();
|
$trailsArr[] = $bot->trail->getTrailAsArray();
|
||||||
}
|
}
|
||||||
return json_encode($trailsArr);
|
return $trailsArr;
|
||||||
}
|
}
|
||||||
public function new_lap(){
|
public function new_lap(){
|
||||||
// for all alive bots
|
// for all alive bots
|
||||||
|
@ -104,7 +104,7 @@ class TronGame
|
||||||
}
|
}
|
||||||
|
|
||||||
$responses = $this->get_multi_IAS_Responses($urls,$paramsToSend);
|
$responses = $this->get_multi_IAS_Responses($urls,$paramsToSend);
|
||||||
print_r($responses);
|
//print_r($responses);
|
||||||
//grow bots'tails
|
//grow bots'tails
|
||||||
for ($botCount = 0; $botCount < $nbeBots; $botCount++){
|
for ($botCount = 0; $botCount < $nbeBots; $botCount++){
|
||||||
if ($this->bots[$botCount]->isAlive){
|
if ($this->bots[$botCount]->isAlive){
|
||||||
|
@ -120,7 +120,7 @@ class TronGame
|
||||||
for ($botCount = 0; $botCount < $nbeBots; $botCount++){
|
for ($botCount = 0; $botCount < $nbeBots; $botCount++){
|
||||||
if ($this->bots[$botCount]->isAlive){
|
if ($this->bots[$botCount]->isAlive){
|
||||||
foreach($this->bots as $otherBot){
|
foreach($this->bots as $otherBot){
|
||||||
if($otherBot->trail->contains($lastsCells($botCount)))
|
if($otherBot->trail->contains($lastsCells[$botCount]))
|
||||||
$loosers[] = $botCount;
|
$loosers[] = $botCount;
|
||||||
$this->bots[$botCount]->loose();
|
$this->bots[$botCount]->loose();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user