예제 #1
0
파일: Pong.cs 프로젝트: Jypeli-JYU/Jypeli
    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));
    }