mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
entity ai classes, pigs should look around
This commit is contained in:
parent
6f603fcbe9
commit
8d454e5ec9
12 changed files with 206 additions and 38 deletions
|
|
@ -1,13 +1,22 @@
|
|||
<?php
|
||||
|
||||
abstract class Living extends Entity implements Damageable, Pathfindable{
|
||||
|
||||
abstract class Living extends Entity implements Damageable{
|
||||
public $pathFinder, $pathFound, $path, $pathNavigator, $target, $ai;
|
||||
public function __construct(Level $level, $eid, $class, $type = 0, $data = array()){
|
||||
$this->pathFinder = new AStar($this);
|
||||
$this->pathFound = false;
|
||||
$this->target = false;
|
||||
$this->path = null;
|
||||
$this->ai = new EntityAI($this);
|
||||
$this->pathNavigator = new PathNavigator($this);
|
||||
parent::__construct($level, $eid, $class, $type, $data);
|
||||
$this->canBeAttacked = true;
|
||||
}
|
||||
|
||||
public function getPathfinder(){ //Placeholder
|
||||
return $this->pathFinder;
|
||||
}
|
||||
public function update(){
|
||||
|
||||
$this->ai->updateTasks();
|
||||
parent::update();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue