Ejemplo n.º 1
0
        public void Spawn()
        {
            var firework = EntityFramework.Spawn <Firework>();

            firework.Position = Position;

            //// Rotate so forward is facing up.
            firework.Rotation = Quat.CreateRotationAA(1.5f, Vec3.Right);

            //// Rotate to a random direction.
            var radians  = Utils.Deg2Rad(MinMaxAngle);
            var rndAngle = new Random().Next((int)(-radians * 10), (int)(radians * 10)) / 10f;

            firework.Rotation *= Quat.CreateRotationAA(rndAngle, Vec3.Up);

            firework.Launch();
        }