Beginning Game Development: Battleship Puzzle — Scripts
<p>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.</p>
<p><img alt="" src="https://miro.medium.com/v2/resize:fit:770/1*cj71HbOLdl_NmhnNE8Wvfw.png" style="height:1211px; width:700px" /></p>
<p><strong>First, </strong>lets look at the script for the individual buttons.</p>
<p>— Variable Declarations<br />
· Each Button has a unique ID assigned when it is created, see method<br />
<strong>‘SetButtonID’</strong> further down.<br />
· Each Button has either been played or not been played. <strong>_buttonState</strong><br />
is the variable that tracks that status.<br />
·<strong> _game </strong>is the variable that reference the main game<br />
· These three variables reference the 3 (three) graphics that make up a<br />
game Button.</p>
<p><a href="https://medium.com/@lemapp09/beginning-game-development-battleship-puzzle-scripts-a59f17e20023"><strong>Learn More</strong></a></p>