Looking for a way to practice CSS and JavaScript, I stumbled upon an idea to recreate the classic game Battleship. It was a game I played in my youth and seemed simple enough to get my feet wet with. Boy, did I know not what I got myself into.
Battleship: GitHub
Project Requirements:
- the browser will randomly hide ships on the board
- the ships must not overlap
- obtain the user's guess
- check the users' guess vs the ship's location
- display the results
- record how many guesses were needed
- report the results when the game ended
Lessons Learned:
Making this game was a pleasure, and if I had to summarize the three major takeaways, I'd have to say:
- How to organize a program.
- How object oriented programming works in larger programs.
- How to build something one block at a time and sometimes redoing code is necessary.
Continued Development:
This game is not quite done yet. Here are some things I'd like to do in the future with it:
- add background music
- add a start screen with instructions
- add a menu so the user can adjust the volume
- add a mode to play against the computer
- allow the user to place ships on a board to play against the computer
- add logic for a computer to play against the user