Beispiel #1
0
        private bool canSeePlayer(NPCWorldView.GameCharacter player)
        {
            var npc = this._npc;

            if (Vector3.Distance(npc.getPos(), player.getPos()) < 20)
            {
                return(true);
            }
            return(false);
        }
Beispiel #2
0
    //==============Constructor==================================================
    public NPCBrain(NPCWorldView.GameCharacter npc, BlockingQueue <NPCThread.instruction> i, WorldGrid worldGrid)
    {
        this.npc           = npc;
        this._state        = new Stack <State>();
        this._instructions = i;
        this._speed        = 1.0f;
        this._worldGrid    = worldGrid;

        this._state.Push(new Roam(this));
    }
Beispiel #3
0
 public State(NPCBrain x)
 {
     this._worldGrid = x._worldGrid; _npc = x.npc; this._brain = x;
 }