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(); } }
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(); }; }
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; }