|
|
|
@ -73,9 +73,8 @@ class TronGame
|
|
|
|
|
//return all trails for draw svg
|
|
|
|
|
$trailsArr = array();
|
|
|
|
|
foreach($this->bots as $bot){
|
|
|
|
|
$trailsArr[] = $bot->trail;
|
|
|
|
|
$trailsArr[] = $bot->trail->getTrailAsArray();
|
|
|
|
|
}
|
|
|
|
|
//echo json_encode($trailsArr);
|
|
|
|
|
return json_encode($trailsArr);
|
|
|
|
|
}
|
|
|
|
|
public function new_lap(){
|
|
|
|
@ -105,13 +104,13 @@ class TronGame
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$responses = $this->get_multi_IAS_Responses($urls,$paramsToSend);
|
|
|
|
|
|
|
|
|
|
print_r($responses);
|
|
|
|
|
|
|
|
|
|
//grow bots'tails
|
|
|
|
|
for ($botCount = 0; $botCount < $nbeBots; $botCount++){
|
|
|
|
|
if ($this->bots[$botCount]->isAlive){
|
|
|
|
|
|
|
|
|
|
$dir = Direction::make($responses[$botCount]['responseArr']['play']);
|
|
|
|
|
|
|
|
|
|
$lastsCells[$botCount] = $this->bots[$botCount]->grow($dir);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|