Sliding Puzzle Game

Oct 12, 2017

Background: For the Austin Articulate Roadshow session, I developed a simple "sliding puzzle" game to demonstrate the logic used by StoryLine triggers. The file uses variables, triggers, motion paths, and 1 tiny (easy to understand) piece of JavaScript. I also show in the video how I use other tools like Excel to explore and essentially "storyboard" my logic.

How the published game works: Click a piece next to the open/empty space and the piece will slide over to occupy that space. Only pieces adjacent to the empty space can move. Keep sliding pieces around to unscramble them into the proper picture.

How the mechanics work: Each piece has 4 motion paths and 1 variable to track its current position on the board. The empty space also has a "position" variable and there is one additional "control" variable. When you click a piece, a quick bit of math is performed to determine the distance between the piece and the empty space and the result is sent to the control variable. A piece will move along the appropriate motion path IF the control variable is equal to certain values (as explained in the video). 

Simple enough? Enjoy!

10 Replies
Ben Johns

I tried this in Storyline 360. It works fine in first time click. Second you click on the same puzzle it moves 2 times the width. This happen when i create line animation in Storyline. While publishing the file you shared it works fine. But if i create new line animation in it, it works the way i mentioned first.  Can anyone let me whats wrong here please. 


I'm looking to see if I kept a copy of the excel file.

Regarding your motion path behavior, there have been some weird quirks going on for a while with relative paths that articulate has not addressed for almost a year now. I would need to see your .story file to see if you are a victim of this bug.