I need help please

Hello

I’m trying to create a sliding puzzle made of 8 painted squares and 1 white.
Each time that there is a pointerdown on a painted square, it switches its position with the white square’s.

On the first pointerdown event it works but that’s it, it is not working if I tap again.

This is my code:

var pos1 = symbol.nodes.image1.position(); // This is a part of the puzzle position
var bPos = symbol.nodes.image9.position(); // this is the blank square position

symbol.nodes.image1.on(“pointerdown”, (e) => {
symbol.nodes.image2.position(bPos);
symbol.nodes.image9.position(pos1);
});

I don’t understand why it doesn’t set the new position if I tap again.
Or if there is something to do with the layermode ?

I would like to be able to switch position everytime I tap on the object.

Also, I would like to switch position only if the image is next to the blank square (like next to the left, right, top or bottom)

I think that I have to use trigger Region but I am not sure and I don’t know how.

You can have a look at the project Tintin Puzzle.zpp (363.5 KB)

tintin

If someone would have the kindness and time to help me, I would be very grateful.

Thank you very much.

First I’m sorry I didn’t get to you sooner. I started playing with this back when you asked for help with it from the zappar video. I went camping and then got sick :nauseated_face:
But I think you will be happy :grin: Here is a working slide game! I did take out your extra coding so if your still looking to use https://www.cluekeeper.com/ you will have to re added it. (By the way that’s something I didn’t know about. Will have to looking in to them more!!

Good Luck winning the game!! I had 2 blocks left and gave up :rofl:

Tintin Puzzle Working.zpp (360.6 KB)

Steve

1 Like

Hello Steve

I can’t express how much grateful I am towards your gesture.
This is so great and kind of you.
You are my HERO !

Thank you very much for this, if there is anything I can do for you I will be glad to !
I’ll take a look at the zpp file tonight.

I love you, thank you !

2 Likes

Your welcome. :blush:

Steve

1 Like

Just thinking I did not add a check to see if you win to it.
Let me know if you need help with that.

Steve

1 Like

Thank you very much.

I’ll try to check this tonight or this week-end as I am very busy.
I think I will be able to do.
But in case not, I’ll let you know.

Thanks again !

1 Like

I created an array abd a function to compare the correct positions to the current ones and it is working. Thanks again !

1 Like

Hello Steve
I am struggling with my last project which is a small matching flipping cardgame.
So far I managed to do this but it is really not looking good.
Could you give me some advice or a guidance so I can try to achieve it please ?
The Mint.zpp (699.9 KB)

Thank you very much.

1 Like

I’ll try to take a look at it when I get home. If not tomorrow.

Steve

So I made a sub symbol for the cards. It controls whats on each side of the card and it’s match number.
Then using some of your code and new code I have it running the checks.

Enjoy :wink:

Steve
The Mint Help.zpp (914.8 KB)

Hey Steve.

I can’t express how grateful I am.
You have been such a great help !

Thank you so very much !

I would very much like to send you a gift to thank you and also for christmas.
How can I do that ?

1 Like

Your very welcome :blush:
You can email me at stevesanerd@gmail.com
If you like.

Steve

hi Steve, i need your help, it seems the puzzle works but it is unsolvable, i´m trying to move the position of the pieces on “randomized” state but the puzzle fails, could you help me with that? i would appreciate that so much.

Ivansmedia

Sorry it’s been over a year since I played with this code.
The puzzle is solvable - it’s a pain - I’ve only been able to do it one time.
But hope this helps.

So there is more then one place you have to edit.
The “randomized” state is more for the start off of the tiles.
You will also have to edit the location info in the slide script.
var blockArray = [“1,2”,“2,0”,“0,1”,“1,0”,“0,2”,“1,1”,“2,1”,“0,0”];
The Array is set to = Row , Col
The grid is like this.
So Image #1 is set to Row 1 Col 2. If you move it you have to update the Array to match.

0, 1, 2
0, x x x
1, x x x
2, x x x

Hope this helps

Steve