コード例 #1
0
ファイル: Agente.cs プロジェクト: BaezCrdrm/PacmanAgentes
    public void MoverA(int _m)
    {
        /*
         * 0 -> Este
         * 1 -> Sur
         * 2 -> Oeste
         * 3 -> Norte
         */

        if (_m == 0)
        {
            Vector3 position = this.transform.position;
            position.x++;
            position = Mapa.AtraviesaTunel(position);
            this.transform.position = position;
        }
        if (_m == 1)
        {
            Vector3 position = this.transform.position;
            position.z--;
            this.transform.position = position;
        }
        if (_m == 2)
        {
            Vector3 position = this.transform.position;
            position.x--;
            position = Mapa.AtraviesaTunel(position);
            this.transform.position = position;
        }
        if (_m == 3)
        {
            Vector3 position = this.transform.position;
            position.z++;
            this.transform.position = position;
        }

        ActualizaPosicion();
    }