Working buttons
In this post we already bound functions to the pressing of either the "Deploy mine" or"Repair" buttons. Now it's time to make them really work! First, the easier one: Repair button. In this case it's just a matter of completing the Repair() function; I want all these actions to happen only when we are in the player's turn, which means being in gameState == 0. If we're not in it, simply return. We also have a boolean variable called repairAvailable , that updates itself based on how many resources we collected; if it's false , let's return as well. In case none of the above happens, we can actually repair our ship: this means adding 1 life to the player ship, and removing 2 resources from our collection. Please note that calling the AddLives() and RemoveResources() methods, will automatically take care of updating the UI and the repairAvailable variable. (In this case the UI will be redrawn twice, but it's not a problem). Here...