public override void UpdatePhysics(float elapsed, Board board) { var x = this.Center.X + this.Velocity.X * elapsed; var y = this.Center.Y + this.Velocity.Y * elapsed; if ((x > board.Size.Width) || (y > board.Size.Height) || (x < 0) || (y < 0)) { Status = ItemStatus.Dead; } this.Center = new Point() { X = x, Y = y }; }
public override void UpdatePhysics(float elapsed, Board board) { var x = this.Center.X + this.Velocity.X * elapsed; var y = this.Center.Y + this.Velocity.Y * elapsed; if (x > board.Size.Width) x = (x - board.Size.Width); if (y > board.Size.Height) y = (y - board.Size.Height); if (x < 0) x = (board.Size.Width - x); if (y < 0) x = (board.Size.Width - y); this.Center = new Point() { X = x, Y = y }; }
public virtual void UpdatePhysics(float elapsed, Board board) { }
public override void UpdatePhysics(float elapsed, Board board) { var x = this.Center.X + this.Velocity.X * elapsed; var y = this.Center.Y + this.Velocity.Y * elapsed; this.Center = new Point() { X = x, Y = y }; }
public Game() { Players = new List<Player>(); Board = new Board(); NextId = 0; }