Free Random Dice Board Game

Race to the Rocket Course Screen Shot

Hi All!  

I help lead the St. Louis Articulate Storyline Special Interest Group (SIG), and I created this "Race to the Rocket" random dice board game to present at a recent session.  Here's the Race to the Rocket demo if you'd like to take a look. 

From a game perspective, it's pretty straightforward.  You click to roll the die, a random number is generated (using JavaScript), the game piece advances that many spots on the board and a random question is drawn from the question pool.  Whether you get the question right or wrong, you still get to roll again, but you'll reduce your fuel supply with each wrong answer.  If you deplete your fuel supply, you'll have to start over. 

Since I've gained so much from all the wonderful people in this community, I wanted to provide the full Storyline 2 source file to share with everyone.  You can update the question text and use it as it is, or you could build upon it to make playing more complex (only move the game piece forward after a correct answer, move backward for incorrect answers, etc.).  

Note:  I had to create alternate graphics for the download version.  If you want the original graphics, you can purchase them on Fotolia.  

Hope this helps, and let me know if you have any questions.  Cheers!  

39 Replies
Ridvan  Saglam

Hi Diana,

I must learn JavaScript, your game is really cool! 

I downloaded the source. I will work on it to understand the interaction better. I'm sure I will have a lot of questions while working on it and here is the first question;

- Is it possible to roll the dice faster?

Thanks again. 

 

Diana Myers

Hi Ridvan, thanks so much for your kind words!  The dice roll is just a Spin Animation on the audio (sound of dice rolling) layer.  I timed it to go with the audio, but you could certainly adjust it to make it faster if desired.

As for the JavaScript to generate a random number, I found that here on the forums :-)  but I've also included a screen shot.JavaScript to Generate One of Six Random Numbers

Absolutely let me know if you have any other questions - I'm happy to help however I can.

Diana Myers

Hi Paul -  thanks so much for your note!

As to your question, yes, as it's built now, they would have to answer fewer questions if they rolled a six each time.  On the flip side, they would have to answer a lot more questions if they rolled all ones and twos.

You could certainly build in a minimum number of questions that had to be answered, and you could also build a maximum number of questions if that fit the type of course or quiz you wanted to give learners.  To do this, you would need to add the appropriate variables and triggers to the course.

Hope this helps!

Nancy Woinoski

This is neat Diana, I recently created an interaction for a client in which the learner had to  "roll" a die 7 times and predict the outcome for each roll. So the rolls had to be random as well. I noticed in your example the JS you are using will generate numbers from 0 to 5. If you modify the code as shown in the attached image, the random numbers generated will from  1 to 6. 

Diana Myers

Well...  That's not very nice....  I'm not sure if it has to do with the traffic on that link or what else is causing the problem, but it seems to be an issue with Chilp.It.

HERE'S THE DIRECT LINK TO THE DEMO HOSTED ON MY CLOUDBERRY ACCOUNT (AMAZON S3)

HERE'S THE DIRECT LINK TO THE DOWNLOAD, TOO.

Hope this helps!  Cheers - and thanks for the heads up on the error.

Karina Souza

This is my first experience using a template or one with Java Script.  I have 11 questions that all need to present themselves during the process of roll-question show. In testing, I find that several are presenting themselves more than once and some not at all. Is there a way to ensure that all 11 are seen by the student? I could care less about what order they are shown, just that they are. Thanks for the support.

OWEN HOLT
Diana Myers

Hi Karina - thanks for your note.  

If you really need to show a set number of questions, you will probably have to modify this project quite a bit, and in the end, it might be better to use a different template or example.

Randomizing the dice roll means that you never know how many questions someone will have to answer in order for them to get to the end.  And playing a board game where the dice rolls aren't random (every time you play you get question1 on the first roll, question2 on the second roll, etc.) defeats the purpose of playing a realistic game in the first place

That said, if you want to keep this theme, in order to ensure your learners see all 11 required questions, you'll have to

  1. Show the questions in a set order and not use a question bank, or if you still want to use a question bank, change it from a random draw to a fixed draw.  If you need more help on question banks, check out this post by Nicole.  
  2. You may have to change the game board and add positions so they have to answer at least 11 questions.  For example, if they roll all 6s (which is not very likely), you would have to have at least 66 spots on the board...  If you go this route, you could adjust the rules and tell them that if they get X number of answers correct, they'll skip to the end.

Hopefully others in the community will chime in with ideas and answers for you.  Take care!

OWEN HOLT

If you use a numeric variable for each question, you can toggle it to "0" when the user sees the question (1 view only)  or when the user gets it right (keep it in the deck until they get the right answer).  Once the variable representing the question has a 0 value, it can be filtered out before you make a random selection.  
Here is an example of what the JavaScript would look like for 5 questions (remove the // before using).

//var player=GetPlayer();

//var nv1=player.GetVar("V1");
//var nv2=player.GetVar("V2");
//var nv3=player.GetVar("V3");
//var nv4=player.GetVar("V4");
//var nv5=player.GetVar("V5");

//var values1 = [nv1, nv2, nv3, nv4, nv5];
//var filtered1 = values1.filter(function(x) {return x>0;});

//var target = filtered1[Math.floor(Math.random() * filtered1.length)];
//player.SetVar("ShowCategory",target);

Karina Souza

Owen, thank you so much!

So here is the java script in this course, remember I am very green (baby shoot) when it comes to Java script. Where would I make the changes to this?

I recognize the need to get some training on Java Script, and how it can be used in eLearning, but the most critical point right now is to amend this so that it works.

Thank you for any support you can provide.
[cid:image004.png@01D27C74.397364C0]

Sincerely yours to count on,
[22+Logo+for+Email+Signature+001]
Karina Souza, CMC, CRMS, CLA
Instructional Designer
National Corporate Trainer
10500 Kincaid Drive
Fishers, In 46037
317.537.3810
Fax: 317.537.4810
karina.souza@freedommortgage.com

*This e-mail (including any attachments) may contain information that is private, confidential or protected by other legal privilege. Any unauthorized review, use, disclosure, alteration or distribution is strictly prohibited and may violate state or federal law. If you received this e-mail in error, please delete it from your system without copying it and notify sender by e-mail, so that my records can be corrected.

CONFIDENTIALITY NOTICE: This e-mail message, including all attachments, is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure, alteration or distribution is strictly prohibited and may violate state or federal law. If you are not the intended recipient, please contact the sender by reply e-mail, delete this email and destroy all copies of the message.

Karina Souza

Hi Owen,

Did you receive the email that I sent with the V2 course attached?
It was going to what looked like a personal email - not this one.

Sincerely yours to count on,
[22+Logo+for+Email+Signature+001]
Karina Souza, CMC, CRMS, CLA
Instructional Designer
National Corporate Trainer
10500 Kincaid Drive
Fishers, In 46037
317.537.3810
Fax: 317.537.4810
karina.souza@freedommortgage.com

*This e-mail (including any attachments) may contain information that is private, confidential or protected by other legal privilege. Any unauthorized review, use, disclosure, alteration or distribution is strictly prohibited and may violate state or federal law. If you received this e-mail in error, please delete it from your system without copying it and notify sender by e-mail, so that my records can be corrected.

CONFIDENTIALITY NOTICE: This e-mail message, including all attachments, is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure, alteration or distribution is strictly prohibited and may violate state or federal law. If you are not the intended recipient, please contact the sender by reply e-mail, delete this email and destroy all copies of the message.

OWEN HOLT

Karina, I made the following updates to your file and sent it back:

1) The file wasn’t playing for me until I removed the audio from slide 1 so be sure you add it back

2) I duplicated the question slides into a new scene and deleted the question bank entirely because you will be using JavaScript to select the questions

3) I added 11 new numeric variables (1 for each question). They are all in the same format Q01 has a value of 1, Q02 has a value of 2, etc.

4) On slide 4, I added a 2nd JavaScript trigger on the Audio-Java Layer. The script pulls in the values from the new variables I added, filters out any with a 0 value, and then makes a random selection from the remaining array of values. This determines which question will be shown. (see my example above in a prior response)

5) I updated the destination based on the new JavaScript on each of the 6 random dice layers and deleted the extra logic

6) I added an action on each of the success layers for the questions. On Q1, the success layer sets the variable Q01 = 0. This effectively removes any questions a person has answered correctly from the question deck. Because I did not add this same action on the failure level, a student will see questions they previously missed again and have another chance to answer them correctly.  If you want them to see each question once and only once, you should duplicate this action on each of the failure levels or just move it to the base layer of each question.

A word of caution with this approach. Your game board has 40+ spaces. Therefore, it is possible that a person could roll enough low numbers and get all of their questions right effectively running out of questions before they reach the goal. I would suggest adding more questions or shortening the board. 
If you add more questions, you will need to add variables, update the java, and add actions to each of the dice layers. I can help you through it if needed.