Added MemoryManager, new memory properties, improved performance, updated RakLib, fixed misc. bugs

This commit is contained in:
Shoghi Cervantes
2015-04-18 20:13:52 +02:00
parent ddc152ae0a
commit b2c25eaf36
32 changed files with 652 additions and 164 deletions

View File

@ -43,6 +43,8 @@ class Squid extends WaterAnimal implements Ageable{
public $swimDirection = null;
public $swimSpeed = 0.1;
private $switchDirectionTicker = 0;
public function initEntity(){
$this->setMaxHealth(5);
parent::initEntity();
@ -80,8 +82,11 @@ class Squid extends WaterAnimal implements Ageable{
return false;
}
if($currentTick % 20 === 0 and mt_rand(0, 100) < 5){
$this->swimDirection = null;
if(++$this->switchDirectionTicker === 100){
$this->switchDirectionTicker = 0;
if(mt_rand(0, 100) < 50){
$this->swimDirection = null;
}
}
$this->lastUpdate = $currentTick;