Exemple #1
0
    /**
     * Initializes the player.
     */
    public void Start()
    {
        CharacterSettings.LoadSettings();

        //initialize location script
        ls = c.GetComponent <Location_Script>();

        //initialize AIFighter brain
        fighterBrain = getFighterBrain();

        //initialize hit points
        this.hitPoints = MAX_HIT_POINTS;

        //initialize mana points
        this.manaPoints = MAX_MANA_POINTS;

        //initialize jumping flag
        this.jumping = false;

        //initialize reset cleared flag
        this.resetCleared = false;

        //initialize set projectile flag
        this.setProjectile = false;

        //initialize the animator
        anim = GetComponent <Animator>();
        anim.SetInteger("Dir", 1);

        //initialize the health points
        healthPoints         = GameObject.FindObjectOfType <Canvas>();
        healthPoints.enabled = true;

        //initialize the color
        this.hitColor    = Color.blue;
        this.normalColor = CharacterSettings.GetColor();
        this.changeToNormalColor();

        //allow the player to move
        canMove    = true;
        speed      = 15;
        setCanMove = false;
        isBlocking = false;
        //set mana cost for certain moves
        manaMelee = 0;
        manaBlock = 5;
        manaRange = 10;
        //set up health cost
        setMeleeAttack  = 5;
        setRangedAttack = 5;
        projSpeed       = 20;
        //gets timer script from camera
        timer = c.GetComponent <Timer>();
    }   //end of Start method