Exemplo n.º 1
0
        private bool verificarPosAdelante(Moto moto, float ElepsedTime)
        {
            double distAhora = this.distancia(moto.getPosicion());

            this.avanzar(ElepsedTime);
            double distDespues = this.distancia(moto.getPosicion());

            this.retroceder(ElepsedTime);

            return(distDespues < distAhora ? true : false);
        }
Exemplo n.º 2
0
        public void seguirObjetivo(Moto moto, float ElepsedTime, List <CustomVertex.PositionColored[]> obstaculos, List <TgcMesh> cajas)
        {
            if (!moto.getPosicion().Equals(new Vector3(0, 0, 0)))
            { //posicion inicial
                this.acelerar(ElepsedTime);

                comprobarColisionSiguienteUpdate(obstaculos, cajas);

                if (verificarGiro(ElepsedTime))
                {
                    if (verificarGiroDerecha(moto, ElepsedTime))
                    {
                        this.girarDerecha(true);
                    }
                    if (verificarGiroIzquierda(moto, ElepsedTime))
                    {
                        this.girarIzquierda(true);
                    }
                }
            }
        }