programming battleship issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi, im trying to program the game battleship but i cant figure out how to
code how people can place the ships and keep track of it. Ive been trying and
researching for a couple days now and am at the end of my rope...if anyone
cal help thatd b awsome.

i have a 10x10 picturebox grid initialized into a 2d array to hold them. i
just need to have a way to have them pick where they want their ships and
keep track of it....thanks to anyone that can help
 
Does this answer your question:

(*) Have a box on the side with the still-to-be-placed ships
(*) User clicks on one of these (removing ship from box), then a location in
the grid.
(*) Ship is placed there in current orientation (allow it to clip).
(*) have two rotate-buttons for each rotation direction.
(*) Hitting these buttons rotates the last placed ship about its placement
point.
(*) Have a 'finish' button. This is only active if all ships have been
placed legally.
(*) Have a "delete" button also. Clicking on a placed ship and then 'delete'
will remove it from the grid and place it back in the side box.
(*) Clicking on a ship already placed in in grid 'selects' it. It can now be
rotated (again), and clicking on an empty locatin in grid will place it
there at current orientation if legal.

'Legally" mean no clipping and no overlapping.

You can get fancy by not allowing rotations to stop in illegal positions,
and/or disallow placing ships for which no orientation is legal.

That should get you started... : )

[==P==]
 
Back
Top