public List <Asteroid> Destroy() { List <Asteroid> result = new List <Asteroid>(); ToRemove = true; AsteroidDestroyed?.Invoke(this, new EventArgs()); Remove(); if (_asteroidSize != 1) { Asteroid a1 = new Asteroid(_grid, _pos.Copy(), _vec.Copy(), asteroidSize: (byte)(_asteroidSize - 1)); Position p2 = _pos.Copy(); p2.X += DefaultSize; p2.Y += DefaultSize; PRandom pr = new PRandom(); GBsharp2.Primitives.Vector v2 = new GBsharp2.Primitives.Vector(pr.Next((int)(-AsteroidsDefaultSpeed * 2), (int)(-AsteroidsDefaultSpeed)), pr.Next((int)(-AsteroidsDefaultSpeed / 2), (int)(AsteroidsDefaultSpeed / 2))); Asteroid a2 = new Asteroid(_grid, p2, v2, asteroidSize: (byte)(_asteroidSize - 1)); result.Add(a1); result.Add(a2); } return(result); }
public Missile(Grid grid, Position pos, GBsharp2.Primitives.Vector vec, double size = 1.0) : base(grid, pos, vec, size) { }
public Player(Grid grid, Position pos, GBsharp2.Primitives.Vector vec, double size = 1.0) : base(grid, pos, vec, size) { Missiles = new List <Missile>(); HP = 10; }
public Asteroid(Grid grid, Position pos, GBsharp2.Primitives.Vector vec, byte asteroidSize, double size = 1.0) : base(grid, pos, vec, size) { _asteroidSize = asteroidSize; }