July 18, 2019
Classic Sliding Tile Puzzle
Comments
(7)
July 18, 2019
Classic Sliding Tile Puzzle
I am currently a provider of technical training and support in the electronic manufacturing industry. My prior training and work experience as a teacher, network administrator, web design, and instructional design make me well prepared to design it, develop it, and deliver it. I am a father of five, a US Army veteran, and I enjoy playing the guitar as well as performing in local community theater. 
Legend 99 posts
Followers: 154 people
(7)

This was a very enjoyable project for me and is a part of a much larger fun project that I decided to start working on which is one of those “Escape the Room” style of games.

This will be one of those puzzles you need to solve in order to successfully get out.

Many of you have probably seen one of those cheap plastic puzzles where you need to basically unscramble the numbers and have them all in the correct order.
This is done by sliding the tiles around until you have them all in the correct position.

Here is my rendition of the classic sliding tile puzzle.
Have fun!

Play

Basic Theory of Operation

The project is made up of 17 variables. Sixteen of them are basically location variables to track which tile is in which spot in the grid. One additional variable is used to specifically track the one grid square that is currently open.

For each grid location – there are either two, three, or four blocks of code for each of the possible directions that a particular tile can slide based on its position in the grid. The block that executes depends on which grid square is currently open. Every tile slide also does a check for the correct solution which will reveal the prize.

Other Applications?

Alternatives to this might be to replace the numbers with pieces of an image that need to be rearranged to construct the right picture or a series of numbers and math operators that need to be positioned so as to be correct.

Are there any applications for something like this that you can think of?

I would be interested to hear them.

Please leave any comments or questions that you might have.

7 Comments
2019-07-27 19:11:40
2019-07-27 19:11:40

This is slick! Runs smooth, loads fast, looks great!

Like
(1)
>
Wayne McDonald
's comment
2019-07-27 21:02:15
2019-07-27 21:02:15
>
Wayne McDonald
's comment

Thank you.

Like
2019-07-20 21:38:04
2019-07-20 21:38:04

Amazing job Greg.

Like
(1)
(1)
>
Paul Wilson
's comment
2019-07-22 11:57:10
2019-07-22 11:57:10
>
Paul Wilson
's comment

Thanks, Paul – I appreciate it.

Like
2019-07-19 11:47:02
2019-07-19 11:47:02

Have been playing that puzzle quite a lot of times. 

I wonder if using the CpExtra widget, one of his features is about coordinates, could be an alternative in combination with advanced actions. Motion and other paths start from the center point of the objects. No time at this moment, but keep it in mind.

Did you use PNG’s?

 

Like
(1)
>
Lieve Weymeis
's comment
2019-07-19 12:43:55
2019-07-19 12:43:55
>
Lieve Weymeis
's comment

Yes, I used PNG for the wood grain objects and the prize.

Like
2019-07-19 05:09:45
2019-07-19 05:09:45

Hours of fun

Like
Add Comment