/// <summary> /// Initialize the current hero's information to none /// </summary> private void IntializeCurrentHeroLocation() { currentHeroPostion = new PicBoxTile(heroRow, heroCol); currentHeroPostion.Type = TileType.None; currentHeroPostion.Image = null; pnlGameBoard.Controls.Add(currentHeroPostion); currentHeroPostion.BringToFront(); }
/// <summary> /// Set the current location to show hero image /// </summary> private void SetHero() { heroPicBoxTile = CalculatePosition(heroRow, heroCol); heroPicBoxTile.Type = TileType.Hero; heroPicBoxTile.Image = imgLst.Images[1]; pnlGameBoard.Controls.Add(heroPicBoxTile); board[heroRow, heroCol].Type = TileType.None; board[heroRow, heroCol].Image = null; heroPicBoxTile.BringToFront(); }
/// <summary> /// Set the current location to show destination image /// </summary> private void SetDestination() { picBoxDestination = CalculatePosition(heroRow, heroCol); picBoxDestination.Type = TileType.Destination; picBoxDestination.Image = imgLst.Images[4]; pnlGameBoard.Controls.Add(picBoxDestination); board[heroRow, heroCol].Type = TileType.Destination; board[heroRow, heroCol].Image = imgLst.Images[4]; picBoxDestination.BringToFront(); }
/// <summary> /// Set the current location to show box image on the destination /// </summary> /// <param name="picBoxPreviousTile"></param> private void SetBoxOnDestination(PicBoxTile picBoxPreviousTile) { picBoxBoxTile = picBoxPreviousTile; picBoxBoxTile = CalculatePosition(boxRow, boxCol); picBoxBoxTile.Type = TileType.Box; picBoxBoxTile.Image = imgLst.Images[5]; pnlGameBoard.Controls.Add(picBoxBoxTile); board[boxRow, boxCol].Type = TileType.Box; board[boxRow, boxCol].Image = imgLst.Images[3]; picBoxBoxTile.BringToFront(); }