public void Move(Bullet bullet, Tile tile) { bullet.Tile.Bullet = null; bullet.X = tile.X; bullet.Y = tile.Y; tile.Bullet = bullet; bullet.Tile = tile; }
public override void Process(Player player, Game game) { Bullet bullet = new Bullet(); bullet.Shooter = player; bullet.Direction = Direction; bullet.X = RTSTools.GetX(player.X, Direction); bullet.Y = RTSTools.GetY(player.Y, Direction); Tile tile = game.Map.TryGetTile(bullet.X, bullet.Y); if (tile == null) return; if (tile.IsSolid) return; //TODO might need to handle multple bullets being in the same place if (Constants.Debug) Console.WriteLine("{0} fired {1}", player.Name, Direction); bullet.Tile = tile; tile.Bullet = bullet; game.BulletList.Add(bullet); }