Ejemplo n.º 1
0
        public void Update(nIDrawable Parent, nSprite[] sprites, float seconds)
        {
            _parent = (Twinkle)Parent;
              Life += seconds;
              var visible = 0.5f;
              var factor = 0f;
              if (Life < visible)
            factor = (Life / visible);
              else
            factor = 1.0f - (Life / (Lifespan - visible));

              sprites[0].Rotation += _parent.SpinRate * seconds;
              sprites[0].Color[3] = factor;
        }
Ejemplo n.º 2
0
 private Twinkle MakeTwinkle(Collectables parent)
 {
     var bounds = _state.GameBounds();
       var t = new Twinkle() {
     Size = nRand.Float(5f, 1f),
     Points = 500,
     Position = new float[2] {
       nRand.Float(0, bounds.xMax * 3f / 4f),
       nRand.Float(0, bounds.yMax * 3f / 4f)
     },
     Color = new float[4] {
       nRand.Float(0.9f, 0f, 0.2f),
       nRand.Float(0.9f, 0f, 0.2f),
       nRand.Float(0.9f, 0f, 0.2f),
       0f
     },
     SpinRate = nRand.Float(0, Config.CollectableSpinRate)
       };
       return t;
 }
Ejemplo n.º 3
0
 /** 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));
 }