Help with variables/conditions for Battleship type math game

Sometimes I have great ideas but am not sure how to execute them once I get started. I am currently working on a game-based approach for a math lesson in which I want to use something like the Battleship game. The learners are looking for buried pirate treasure. They must answer a math question correctly in order to be able to select an area of the grid to see if they can find five pieces of the treasure. What I'm having trouble figuring out is the how to design the true/false variables and conditions.

1) They must answer the question (from a question bank) correctly to go to the grid. That's just a trigger on whether to go to the correct (grid) slide or incorrect layer. I think.

2)  I have the grid set up on a separate slide rather than use a layer. This way the learners always return to the same slide if they've answered the question correctly. I've set up a grid of rectangles with triggers to hide and disable when the user clicks. I need to figure out how to make sure they can only click ONE box each time. Also how to set up the true/false variables and conditions so that when the learner returns to the grid slide, the boxes they've selected remain hidden and disabled. I am thinking that all I have to do is have the continue button link back to the question bank. It would appear only after they've made their selection.

3) There are five pieces of treasure hidden with15 boxes arranged in a grid. The learner does not have to complete the entire 15 questions if he/she uncovers all 5 pieces before then. I need to figure out the variables/conditions that will take indicate they've found all the treasure and allow them to continue to the Results slide.

4) I would like to have the learners be able to play again with a different grid, since I have the questions set up to randomize. I wish there were a way to randomize the location of the hidden treasure under the different boxes. Not sure if I should just copy the same interaction (just change the locations of the treasure on the new grid) so I wouldn't have to figure out the new triggers/conditions or how easy it would be to build a variable to send the learner to new grid slide.

5) Not sure if I haven't forgotten something.

2 Replies
Kevin Hart

Awesome idea.  Totally doable. 

This is probably not the most elegant solution, but it should work.  

1.  Have your one main grid slide with the map on the bottom and individual square shapes laid on top.  Name each square.    And then create as many duplicate slides as there are squares on the grid.  

2. Name each duplicate slide for the square on the grid it will correspond to.

On the Main Grid slide-

3.  Create a true false variable for each grid square.  initially set to false.  

4.  Set initial state of all the grid squares as hidden. 

5.  Create slide triggers that change the state of  squares to "normal" when the timeline (the slide timeline) begins on condition that 'name of square variable" is "equal to false."

6.  Create triggers on each square that will adjust each square's corresponding variable to true when clicked

7.  Create triggers on each square that will jump to the corresponding "square name" duplicate slide. 

On each duplicate slide-

8.  Delete the grid square that the duplicate slide is named for.  So it will always be uncovered on that slide. 

9.  Copy and paste all the variable slide triggers from the main grid slide that will tell the other squares whether they should be hidden or not.  Do NOT copy and paste any of the square triggers that would take them to another slide.  (thus, not allowing them to click on any other squares while they're on that slide)

10.  Create back buttons on teach of the duplicate grid slides.  Set the initial state of this button to hidden.  Create a shape trigger that is "change the state of back button to normal when timeline starts (slide timeline) on condition that state of variable "AllTreasureFound" is false"  (see below).  Set a trigger that will take them back to the question page when pressed.

To get to the results slide:

11.  Create a variable that is something like "AllTreasureFound"   Set it to false.  One one of the duplicate grid slides, create a slide trigger that is "Adjust variable AllTreasureFound to True when timeline starts (slide timeline) on condition of: A4Square is true and B3Square is true..."    The conditions would be the square variables that are covering the treasure. 

12.  Copy that slide trigger to all of the duplicate grid slides.

12.  Create a results slide button that has it's initial state set to hidden.  Create slide triggers that will change the state of the results slide button to normal when timeline begins (slide timeline) when the variable "AllTreasureFound" is true. 

13. Create a trigger for that button that will take them to the results slide.

14. And here's step 14 because I didn't want 13 steps. 

As for repeating the whole thing, my only solution would be duplicating the whole darn thing. I think you'd get into a some really complicated variable changes if you wanted to reuse the same slides for a new map and new questions. 

Like I said, someone else may have a more elegant solution.  And, heck, this may not even be the solution you're looking for.  But I hope it helps!

-Kevin