コード例 #1
0
 public Asteroid(string size, float rotation, Vector2f pos, World parent, int value, bool spawned = false, bool add = true)
     : base(Rsc.Tex("rsc/Asteroid" + size + ".png"), pos, parent, value, add)
 {
     Rotation = Rand.RandInt(0, 360);
     MoveRot = rotation;
     Origin = Center;
     Size = size;
     Col = new Color(255, 200, 200, 100);
     var t = new Ticker(Parent, new TimeSpan(0, 0, 2), null);
     t.OnTick = delegate
                    {
                        t.Destroy();
                        Col = Color.White;
                        Active = true;
                    };
     Active = !spawned;
     if (Active)
     {
         Col = Color.White;
     }
     if(DangerManager.Instance.UsedDP > DangerManager.Instance.MaxDP)
     {
         Destroy();
     }
 }
コード例 #2
0
ファイル: Bolt.cs プロジェクト: gigimoi/ld25-Inversetroids
 public Bolt(Vector2f pos, float rotation, World parent, bool add = true)
     : base(Rsc.Tex("rsc/Bolt.png"), pos, parent, add)
 {
     Rotation = rotation;
     Origin = Center;
     var ticker = new Ticker(Parent, new TimeSpan(0,0,0,2), null);
     ticker.OnTick = delegate
                         {
                             _start = true;
                             ticker.Destroy();
                         };
 }
コード例 #3
0
ファイル: UFO.cs プロジェクト: gigimoi/ld25-Inversetroids
 public UFO(Vector2f pos, float rotation, World parent, bool add = true)
     : base(Rsc.Tex("rsc/UFO.png"), pos, parent, 80, add)
 {
     MoveRot = rotation;
     Col = new Color(255, 200, 200, 100);
     var t = new Ticker(Parent, new TimeSpan(0, 0, 2), null);
     t.OnTick = delegate
     {
         t.Destroy();
         Col = Color.White;
         Active = true;
     };
     Active = false;
     Origin = Center;
 }