Demos, Design Tips and Tricks

Random Number Generator

A little blast from the past. Before the random fortune teller and the random word generator, I started out pairing together Storyline and Javascript with this simple random number generator. It creates a whole integer between 1 and 10.

randnum

Click here to view

How to do this:

  1. Create a variable in storyline called “randnum”
  2. Add a trigger to execute Javascript when the generate button is clicked. Enter in this Javascript:

var randomnumber = Math.floor((Math.random()*10)+1);
var player = GetPlayer();
player.SetVar(“randnum”,randomnumber);

3. Add in a reference to the storyline variable (%randnum%) where the random number will be displayed.

Easy peasy!

Demos, Storyline Challenges

Time To Draw! – Random Word Generator (E-Learning Challenge #174)

This week’s elearning challenge was to create a random word generator. I decided to combat that horrible feeling of wanting to draw but feeling uninspired by developing something that would generate odd or funny drawing prompts.

example2

Click here to try it out!

This challenge was perfect timing for me, since I’ve been trying to learn some Javascript basics over the past month. A few weeks ago I was messing around with random numbers, so a random word generator is a great next step!

Most of them make sense (even if they are a bit silly!) but if you get a nonsense phrase, you can click to have another go.

If anyone feels inspired to draw any of these weird creations, do let me know.

Stuff I’ve Learned, Stuff I’m Thinking About.

Timers

I put in a timer function so that you can set yourself a challenge by completing your drawing in either two, ten or thirty minutes. This works, although at the moment there is no indication of how far through your allotted time you are. You just get a message when your time is up. I was planning on creating an animated timer, but I found out that Storyline isn’t fond of animations which last for 30 minutes!

I’m putting finding a workaround for that one on pause for now.

Javascript

Have you reached the point when learning a (regular, non-programming) language where you’re thrilled because you understood a sentence perfectly, but then you realise you don’t have the skills to actually respond yet?

That was my feeling when encountering the Javascript I used in this piece, which was from a guide by Matthew Bibby.

It was great to be able to look at the Javascript and understand what it was doing and how, but I’m not at a point where I could have created it from scratch.

I’m hoping to update this post with other challenge entries which catch my eye, so stay tuned!