Beginning Game Development: Battleship Puzzle ??? Scripts

This is the final of a three part series of articles that describe the pieces that make up a ‘Battleship’ inspired puzzle game. In the previous articles were discussed the construction of the game board and another described the individual buttons.

First, lets look at the script for the individual buttons.

— Variable Declarations
· Each Button has a unique ID assigned when it is created, see method
‘SetButtonID’ further down.
· Each Button has either been played or not been played. _buttonState
is the variable that tracks that status.
· _game is the variable that reference the main game
· These three variables reference the 3 (three) graphics that make up a
game Button.

Learn More