コード例 #1
0
        /** Create a new sparkle group */
        public void CreateSparkles(float[] Position, float[] Velocity)
        {
            var factory = new SparkFactory() {
            Source = new float[2] { Position[0], Position[1] },
            Lifespan = 0.5f,
            LifespanVar = 0.1f,
            Count = _realRate,
            CountVar = _realRate / 2,
            Tint = new float[4] { 1.0f, 1.0f, 1.0f, 1.0f }
              };

              factory.VelocityVar [2] = nRand.Float(0f, 50f);

              factory.Velocity [0] = Velocity [0] * 0.5f;
              factory.Velocity [1] = Velocity [1] * 0.5f;
              factory.VelocityVar [0] = Math.Sign(factory.Velocity [0]) * 3f;
              factory.VelocityVar [1] = Math.Sign(factory.Velocity [1]) * 3f;
              factory.Tint = new float[4] { 1.0f, 1.0f, 0.0f, 1.0f };

              var items = factory.Manufacture();
              foreach (var i in items) {
            var m = new nMotion(i, new RainbowSparkAnim());
            Sparkles.Add(m);
              }
        }
コード例 #2
0
 private void Init()
 {
     _motion = new nMotionVector() {
     MaxLength = MaxLength,
     SegmentSize = SegmentSize
       };
       _trail = new nTrail((int) (MaxLength / SegmentSize)) {
     MinWidth = MinWidth,
     MaxWidth = MaxWidth
       };
       var m = new nMotion(_trail, new ForeverAnim());
       _sprites.Add(m);
       _ready = true;
 }
コード例 #3
0
ファイル: Collectables.cs プロジェクト: shadowmint/pongstar
 public void Manufacture(Collectables parent)
 {
     var m = new nMotion(MakeTwinkle(parent), MakeTwinkleAnim());
       _twinks.Add(m);
       parent.Twinkles.Add((Twinkle) m.Parent);
 }
コード例 #4
0
ファイル: Collectables.cs プロジェクト: shadowmint/pongstar
 /** Create a score node */
 public void CreateScore(Twinkle parent)
 {
     var sc = new ScoreDsp() {
     Position = new float[2] { parent.Position[0], parent.Position[1] },
     Size = new float[2] { 6f, 3f },
     Float = 5.0f
       };
       var m = new nMotion(sc, new ScoreAnim() {
     Lifespan = 2f
       });
       _scores.Add(m);
       _parent.Trigger(new CollectableHit(_parent, parent.Points));
 }
コード例 #5
0
ファイル: Sparkle.cs プロジェクト: shadowmint/pongstar
        /** Create a new sparkle group */
        public void CreateSparkles(float[] Position, float[] Velocity, SparkleType type)
        {
            var factory = new SparkFactory() {
            Source = new float[2] { Position[0], Position[1] },
            Velocity = new float[3] { Velocity[0], Math.Sign(Velocity[1]) * 10f, 0f },
            Lifespan = 1.0f,
            LifespanVar = 0.5f,
            Count = 10,
            CountVar = 2,
            Tint = new float[4] { 1.0f, 1.0f, 1.0f, 1.0f }
              };

              /* Custom per type */
              factory.VelocityVar [2] = nRand.Float(0f, 50f);
              if (type == SparkleType.SPARKLE_WALL) {
            factory.Velocity [1] = 0;
            factory.Velocity [0] = Math.Sign(Velocity [0]) * 10f;
            factory.VelocityVar [0] = 20f;
            factory.VelocityVar [1] = 30f;
            factory.Tint = new float[4] { 0.5f, 0.5f, 1.0f, 1.0f };
              } else {
            factory.Velocity [0] = Velocity [0];
            factory.Velocity [1] = Math.Sign(Velocity [1]) * 10f;
            factory.VelocityVar [0] = 20f;
            factory.VelocityVar [1] = 30f;
            factory.Tint = new float[4] { 1.0f, 1.0f, 0.5f, 1.0f };
              }

              var items = factory.Manufacture();
              foreach (var i in items) {
            var m = new nMotion(i, new SparkAnim());
            _sparkles.Add(m);
              }
        }
コード例 #6
0
ファイル: nMotionGroup.cs プロジェクト: shadowmint/pongstar
 /** Add a sprite to the cluster */
 public void Add(nMotion sprite)
 {
     _mobiles.Add(sprite);
 }