Project Documentation - Manfredtham/Battleship GitHub Wiki
- C# Coding Standard
- Missing reference System.Data
- Missing Class datatype
- VK_ -> vk_
- i = Conversion.Int(sn) -> i = ((int)sn) - 1;
- Missing Class datatype
- VK_ -> vk_
- Missing Class datatype
- VK_ -> vk_
- public GameController() -> static GameController()
- Missing Class datatype
- Missing using SwinGameSDK
- Missing Class datatype
- _Fonts(font) -> _Fonts[font]
- foreach(obj in _Fonts.Values) -> foreach(Font obj in _Fonts.Values) (Remove Font obj = default(Font);)
- Missing Class datatype
- s = _Scores.Item(i) -> s = _Scores[i]
- VK_ -> vk_
- if (value > _Scores.Item(_Scores.Count - 1).Value) -> if (value > _Scores[_Scores.Count - 1].Value)
- VK_ -> vk_
- Missing Class datatype
- _menuStructure(menu).Length -> _menuStructure[menu].Length
- SwinGame.DrawTextLines(_menuStructure(menu)(i)...) -> SwinGame.DrawTextLines(_menuStructure[menu][i]...)
- Missing using SwinGameSDK
- switch (grid.Item(row, col)) -> switch (grid[row, col])
- case TileView.Sea: -> case TileView.Sea: (Delete .Ship)
case TileView.Ship:
- s.animationHasEnded -> s.AnimationHasEnded
ROW 105: row = Convert.ToInt32 (Math.Floor ((mouse.Y) -> ((mouse.Y - UtilityFunctions.FIELD_TOP)
ROW 147, 149, 160: Remove SwinGame.FillRectangle
ROW 79: _currentDirection = Direction.LeftRight; -> _currentDirection = Direction.UpDown
ROW 187 = Add new case: ResultOfAttack.ShotAlready: _shots -= 1; break;
ROW 256 = AddAnimation (row, col, "Splash"); -> AddAnimation (row, col, "Explosion");
ROW 314 = Added a delay of 1ms between animation cells using SwinGame.Delay(10) to improve the effect.
ROW 21: Add new font named "MenuLarge"
ROW 44: Create new variable (CURRENT_DIFFICULTY)
ROW 148: Draw current difficulty by adding new SwinGame.DrawTextLines(...)
ROW 292-300: Add new codes to change current difficulty in PerformSetupMenuAction() function. (CURRENT_DIFFICULTY = ...)
ROW 65: Instantiate variable: const int SCORE_TOP = 306, for Score's position.
ROW 79: Draw the score to the screen by adding SwinGame.DrawText (GameController.HumanPlayer.Score.ToString (), Color.White, GameResources.GameFont ("Menu"), SCORES_LEFT, SCORE_TOP);
Edit background image: add score's row
ROW 27 - 39: Add more SwinGame.DrawTextLines()
ROW 17: Add new font named "ArialSmall"
ROW 36 -> Add new image named PauseButton
ROW 49 -> Add pause area (if (row == -1 & col == 9))
ROW 92 -> Draw pause button by adding SwinGame.DrawBitmap()
Add pause button image
Create Guthub button image
ROW 135-144 ->
//If wiki page button is clicked
Point2D mouse = default (Point2D);
mouse = SwinGame.MousePosition ();
int mouseX = Convert.ToInt32 (mouse.X);
int mouseY = Convert.ToInt32 (mouse.Y);
if (mouseX > 700 && mouseX < 780 && mouseY > 200 && mouseY <246) {
Process.Start ("https://github.com/Manfredtham/Battleship/wiki");
}
ROW 233-234 ->
//Add navigator to Group Wiki page.
SwinGame.DrawText ("About Us", Color.White, GameResources.GameFont ("Menu"), 695, 160);
SwinGame.DrawBitmap (GameResources.GameImage ("GitHub"), 700, 200);
ROW 77 -> const int TIMER_LEFT = 510;
ROW 78 -> const int TIMER_TOP = 85;
ROW 108 -> SwinGame.DrawText (GameController.timeCount (480000), Color.White, GameResources.GameFont ("MenuMedium"),
TIMER_LEFT, TIMER_TOP);
ROW 33-61 ->
public static string timeCount (int _time)
{
SwinGame.StartTimer (_timer);
int _timeLeft = 480000;
_timeLeft -= (int)SwinGame.TimerTicks (_timer);
_timeLeft /= 1000;
if (_timeLeft < 0) {
_timeLeft = 0;
_time -= (int)SwinGame.TimerTicks (_timer);
_time /= 1000;
if (_time < 0) {
_time = 0;
SwitchState (GameState.EndingGame);
}
int _mins, _secs;
_mins = _timeLeft / 60;
_secs = _timeLeft - (_mins * 60);
_mins = _time / 60;
_secs = _time - (_mins * 60);
string _time;
string _timeLeft;
if (_secs < 10)
{
_time = _mins + ":0" + _secs;
_timeLeft = _mins + ":0" + _secs;
}
else
{
_time = _mins + ":" + _secs;
_timeLeft = _mins + ":" + _secs;
}
return _time;
return _timeLeft;
}
ROW 370-372 ->
case GameState.Discovering:
if (SwinGame.TimerTicks (Timer) == 0) {
SwinGame.StartTimer (Timer);
}
ROW 375 ->
case GameState.EndingGame:
SwinGame.StopTimer (Timer);