[Game]Naval Battle[WIP]



I’ve got my Naval Battle game to a playable state.

Here’s the screen from a little earlier in development. I developed on the Pokitto hardware, so I took the image with a camera.

How to play:
Use the yellow block cursor to place the ships on the grid on the right.
Pressing A will select the ship that is closest to the cursor.
Use the direction arrows to move to a location on the grid.
Press A again to release the ship.
Press B to rotate the ship between horizontal and vertical orientations.
Once all ships are in the grid, select the box next to “Done” to start playing.
When playing, select a point in the left grid and press A to fire a missile.
The computer will alternate fire, making somewhat sophisticated choices.
Once all the ship grid points on one side are hit, a winner is declared.

Here is the binary (updated 20180105) nbattle.bin (40.9 KB)

Source at mbed.com is here.

It’s a simple game, but a fun way to get familiar with programming the Pokitto. I’m planning on continuing to work on the button handling, graphics, sound and AI.
Questions and comments are very welcome.

Edit: Updated with reasonable AI
Edit: Updated to new library, graphics, AI

See the code from other programms

Great stuff! Thanks!

Edit: played it through


  • a very enjoyable little game
  • the computer player does not hunt down the ships it has found
  • best sound effects ever on a Pokitto!


@RichardAmes Would you mind if I included this as an example in the PokittoLib Github repository? It works really nicely in the simulator also.

Edit: made a gif for you. Hope its OK?


Hi Jonne – Thanks for putting together the runs under the simulator! They look great, and it helps me see some details I may have missed. I’m surprised how much it reminds me of an Atari 2600 when watching it now.

Feel free to use this project in any way you like. I’ve got an idea on how to make an effective computer player using a heat map of possible ship positions, and I hope to update the target_pgrid() function soon.