Matthew Koerber

Web and Software Developer

One Person Battleship

Languages

CSS JavaScript HTML

Frameworks

JQuery

battleship cheat
What the board shows when the cheat is active.

A single player version of battleship based on the 'Sinking Ships' mini-game from The Legend of Zelda: The Wind Waker. Like in sinking ships, the game has a limited mount of turns before the player looses. Unlike the sinking ships game it has all five ships from battleship. They are a two long, two three long, a four long, and a five long ship.

When a tile is clicked it will check if there is a ship on the tile and will act accordingly. After a tile is clicked once it will not count toward the turns counter, unless the game is reset. If a ship is hit it will turn red, and if the clicked tile does not have a ship on it, the tile will turn a lighter green.

The timer was just some left over code from the memory game. However, if you click the colon in the time when it reads 00:00 a cheat will toggle on or off. Turning on the cheat will show all the ships. After the game has started, triggered by the player clicking a tile, the cheat will be stuck on or off until the game is reset.