public new void Run()
    {
        int position = AIHelperMethods.GetPositionStatus(player, opponent, ball, goal);

        switch (position)
        {
        case -1:
            RunDefault();
            break;

        case 0:
            RunZeroPosition();
            break;

        case 1:
            RunOnePosition();
            break;

        case 2:
            RunTwoPosition();
            break;

        case 3:
            RunThreePosition();
            break;
        }
    }
Ejemplo n.º 2
0
    public new void Run()
    {
        /* If the ball is in the corner, move it in the middle so a shot can be taken
         * easily. First calculate the point where the ball cannot
         * be shot at the goal, and then push it back to the middle.
         * If the ball is ready, shoot it at the goal.
         */



        int position = AIHelperMethods.GetPositionStatus(player, opponent, ball, goal);

        switch (position)
        {
        case -1:
            RunDefault();
            break;

        case 0:
            RunZeroPosition();
            break;

        case 1:
            RunOnePosition();
            break;

        case 2:
            RunTwoPosition();
            break;

        case 3:
            RunThreePosition();
            break;
        }
    }
 void Update()
 {
     if (!AIHelperMethods.HasArrived(agent))
     {
         animator.SetFloat("Speed", AIHelperMethods.GetCurrentAgentSpeed(aiController, agent));
     }
     else
     {
         animator.SetFloat("Speed", 0f);
     }
 }
    void Update()
    {
        if (!AIHelperMethods.HasArrived(agent))
        {
            animator.SetFloat("Speed", AIHelperMethods.GetCurrentAgentSpeed(pc, agent));
        }
        else
        {
            animator.SetFloat("Speed", 0f);
        }

        animator.SetBool("Firing", pi.Firing);
        animator.SetBool("Reloading", pi.Reloading);
    }
Ejemplo n.º 5
0
    public new void Run()
    {
        /* if the ball is not in between this player and the opposite goal
         * position in front of the goal to block the other player from scoring a goal
         *
         * if this player is not close to a goal and the ball is in front of the goal,
         * and if shooting the ball would not cause it to score a goal for the opposite team, shoot it
         *
         * if the ball is close to the player, use sword to kick it away
         * if the ball is further away, shoot it
         *
         * if the ball is on the side and there is a pickup available close, pick it up
         * the lower the health / stamina points - the more likely it is for this player get a pickup
         *
         * shoot the player of opposite if he has a low hp and this player is blocking the goal
         *
         * use shield to block the goal
         *
         * if the ball is approaching (check velocity etc.) use shield to block it
         *
         */
        int position = AIHelperMethods.GetPositionStatus(player, opponent, ball, goal);

        switch (position)
        {
        case -1:
            RunDefault();
            break;

        case 0:
            RunZeroPosition();
            break;

        case 1:
            RunOnePosition();
            break;

        case 2:
            RunTwoPosition();
            break;

        case 3:
            RunThreePosition();
            break;
        }
    }
Ejemplo n.º 6
0
 private bool CanReload()
 {
     return(AIHelperMethods.GetCurrentAgentSpeed(this, agent) == 0);
 }