Leo
03-27-2007, 12:00 PM
Hello.
I have been working on this for quite some time, and have run into a slight issue with my lists.
The name of the game is Battleship. Most people know how to play it. In this Alice version of mine, The grid appears, and the player clicks a square to select a possible space. After the selection is made the square will turn 1 of 2 colors, depending on if the enemies "ship" is there. If it's a hit on the enemy, the square should turn red. If it's a miss, it turns green. Afterwards, the grid blanks out, the player cannot click, and the enemy fires randomly on your ships. After the enemy's turn, the player is able to see the grid and click it. The proccess repeats. Your ships are fully sinkable, though, I haven't coded the Enemy Ships sinking.
My problem is this: When the player is choosing the square to fire upon, it does not register a "hit" on the enemy. The squares will only turn green, not red. The way the spaces were designed, a random setup is selected from 5 different options. However, the squares will only turn green. The code for my entire game is below, feel free to tinker with it, and use it as you can.
Thank you!
Ryan S.
I have been working on this for quite some time, and have run into a slight issue with my lists.
The name of the game is Battleship. Most people know how to play it. In this Alice version of mine, The grid appears, and the player clicks a square to select a possible space. After the selection is made the square will turn 1 of 2 colors, depending on if the enemies "ship" is there. If it's a hit on the enemy, the square should turn red. If it's a miss, it turns green. Afterwards, the grid blanks out, the player cannot click, and the enemy fires randomly on your ships. After the enemy's turn, the player is able to see the grid and click it. The proccess repeats. Your ships are fully sinkable, though, I haven't coded the Enemy Ships sinking.
My problem is this: When the player is choosing the square to fire upon, it does not register a "hit" on the enemy. The squares will only turn green, not red. The way the spaces were designed, a random setup is selected from 5 different options. However, the squares will only turn green. The code for my entire game is below, feel free to tinker with it, and use it as you can.
Thank you!
Ryan S.