Ejemplo n.º 1
0
        public Asteroid Half()
        {
            Radius /= 2;
            Speed  *= 2;
            UnitDirectionVector = VMath.RotateVector(UnitDirectionVector, 25);
            Asteroid splitAsteroid = new Asteroid(Position, UnitDirectionVector, Speed, Radius);

            if (CanSplit())
            {
                splitAsteroid.UnitDirectionVector = VMath.RotateVector(UnitDirectionVector, -50);
            }
            else
            {
                Destroy();
                splitAsteroid.Health = 0;
            }
            return(splitAsteroid);
        }
Ejemplo n.º 2
0
 public void Rotate(float degrees)
 {
     UnitDirectionVector = VMath.RotateVector(UnitDirectionVector, degrees);
 }