× Main Menu

C# Tutorial – Create a Simple Battle Ship Game in Visual Studio

In this tutorial we will show you how to create a Simple old school battle ship game in visual studio using C# programming language. This game is a complicated one and can be a little daunting for the beginners. If you are unclear about some of the concepts then try out few other tutorials here and come back to this, it will still be here when you are ready. In this game you will create an AI player where you can play against them to win your sea battles.  The old joke “you sunk my battle ship”, may apply here but it’s entirely up to you.

Lesson Objectives –

  1. Complete the simple battle ship game in visual studio
  2. Use custom background on the windows form
  3. AI make decisions in the game
  4. Player controls their ships from list of moves
  5. Keep track of AI movements
  6. Using windows GUI to create a game
  7. Using LIST arrays in C#
  8. Using LOOPs in C#
  9. Searching indexes of the list arrays and matching them to integers
  10. Using System Diagnostics show system debug information in the outputs window
  11. Using multiple timers and controlling them dynamically
  12. Showing customised win, lose and draw message box

Download the BattlShip game assets here. 


One response to “C# Tutorial – Create a Simple Battle Ship Game in Visual Studio”

  1. charlie says:

    if (enemyPosition[index].Enabled && rounds > 0 ) system.argumentoutofrangeexception: ‘Index was out of range. Must be non-negative and less than the size of the collection

Comment on this tutorial and let us know how you got on -

%d bloggers like this: