Exemplo n.º 1
0
    void Sparkle()
    {
        PhysicsObject sparkle = new PhysicsObject(3, 1);

        sparkle.Position = Mouse.PositionOnWorld;
        //sparkle.IgnoresCollisionResponse = true;
        sparkle.IgnoresGravity  = true;
        sparkle.Angle           = RandomGen.NextAngle();
        sparkle.Color           = RandomGen.NextColor(Color.LightYellow, Color.Yellow);
        sparkle.MaximumLifetime = RandomGen.NextTimeSpan(0.1, 2);
        Add(sparkle);

        double force = RandomGen.NextDouble(100, 200);

        sparkle.Hit(Vector.FromLengthAndAngle(force, sparkle.Angle));
    }