Beispiel #1
0
 public virtual void Update(GameTime gt)
 {
     if (moveBehaviour != null)
     {
         moveBehaviour.Move(ref position, ref direction);
     }
 }
Beispiel #2
0
 public virtual void Update(GameTime gt, List <GameEntity> game_elements)
 {
     if (moveBehaviour1 != null)
     {
         moveBehaviour1.Move(this, game_elements);
     }
     if (moveBehaviour2 != null)
     {
         moveBehaviour2.Move(this, game_elements);
     }
 }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        if (currentNode == null || isDead)
        {
            return;
        }

        // Check if reached node.
        float distance = Vector3.Distance(transform.position, currentNode.transform.position);

        if (distance < moveBehaviour.Speed * Time.deltaTime)
        {
            currentNode = currentNode.NextNode;
            if (currentNode == null)
            {
                // We reached the end of the path, so go away ^^
                Debug.Log("Reached end");
                DamagePlayer();
                return;
            }
        }

        moveBehaviour.Move(currentNode.transform.position);
    }
 public void Update(GameTime gt)
 {
     UpdateInput();
     moveBehaviour.Move(ref position, ref direction);
 }
Beispiel #5
0
 public void Move()
 {
     moveBehaviour.Move();
 }