# [DEMO] Farkle game (Storyline)

Nov 30, 2012

Hello everyone,

I'd like to share a "simple" Farkle dice game I created months ago as my first experiment with Storyline.

It started out as a simple concept that ballooned outward until I couldn't justify spending more time on it...but it was kind of fun to build.

It's not fully visually designed - I was mostly testing the (new at the time) variables, triggers and JavaScript. I am aware of a couple errors in scoring, but my limited JavaScript knowledge prevented me from truly fixing them (programmers would probably have a good laugh at my clumsy code...).

If you don't know how to play, there are instructions within the game (see tab on the right side).

Let me know what you think, and enjoy!

Matthew Kliewer

###### 15 Replies

I like it.  As someone who plays Farkle, it was fun.  However, if you were wanting to make it more like the game, you need to fix the dice values.  Numerous times I tried it and the scoring was incorrect.

I do like the sound effects you put in there.

Overall, I really liked it!

Hi Matthew,

I have to admit, I had to run to wikipedia to even remotely understand farkle rules.

But as far as the implementation goes, hats off. I thoroughly enjoyed it!

Most of all I loved the look & feel and how your gray background tones matched the typography. Fantastic!

wonderful storyline skills. kudos

Matthew,

I have a game that I created in Storyline that takes the player around a board. I have duplicated the movement of the players, questions, cards, etc. but not rolling the dice. Can you share how you did that? We only have one die in our game but it would be great to have it roll electronically.

Jeffrey Riley

Matthew: Nice use of gradients, creates a subtle, elegant look I think. I also nice touch on the "swoosh" sound of the "instructions" layer.

Hi all, thanks for the kind words and feedback.

@Jeffrey - sorry I didn't see this earlier. The die rolls were made with JavaScript:

• sets the Javascript variable to a random number 1-6

var die = Math.floor(Math.random()*6 + 1);

• gets the player so it can set the JavaScript variable to the Storyline variable

var player = GetPlayer();

player.SetVar("rollDie",die);

The variable names can be anything you want, of course (except for "player" - here's a link to more on Storyline JavaScript best practices.) If you want more than one die, just make and set more variables (die1, die2, etc.).

Hope that helps. Here's a link to the Storyline file if anyone is interested (beware - it's pretty messy!)

farkle.story

Matt

I forgot to mention - I changed the states of each die to show or hide based on the numbers that resulted from the code above. There was a "spin" animation so each time you hit "roll", it would run the code and reveal a random die image and animate it in. It would also tally those values in my case, to determine scoring.

If you're not animating the dice at all, you could have all the dice (1-6) as different states on one object, and change the state based on the random number. It's cleaner and easier to deal with in your project, but I wanted the spin animation badly enough to complicate my life, apparently....

Matthew this is great! I don't even know how to play and I enjoyed messing around with it. Definitely a great look as well.

Thanks for posting!

Great game!! First time to see how Storyline works with Javascripts! Really amazing!

Dear Matthew, It is a great work, you encouraged me to add a games section on our company LMS Contents, beside knowledge, skills and company processes.

Thanks Matthew for sharing your idea.

This is absolutely fantastic, awesome job, well done! Looks brilliant!

I'm going to dissect it to really understand the concepts used, fantastic inspiration.

Thanks everyone - still one of my favorite (non-client) projects!

Great job.  I think I was more entertained looking at the animations, listening to the sounds, and trying to figure how you did this.

Again awesome job.

How did I miss this... I am going to steal those dice.