Hey everyone, new here and to gdevelop as well. I’m currently working on a mobile slide puzzle game to help promote my art and since I’m more of an artist than a programmer I decided to go with gdevelop to create it. The problem I’m having is with the movement. I just want to basically have slide movement on each piece where it can slide into the empty space when swiped in that direction. I’ve tried several different things and have installed quite a few extensions in order to try to achieve this effect but still having issues smh.
Right now I’m just experimenting with the tween and physics 2.0 features. I setup conditions that set the x and y coordinates to the objects x and y coordinates on touch, set the object from static to dynamic, when you start to drag the object it creates 4 objects at each of the 4 way axises at a distance of 450 pixels (the dimensions of the square pieces) and if you drag the object 30 pixels or more in any one direction it tweens the object to one of those 4 object it’s closest to and then destroys them. It also creates a object at the x and y origin spot and if you release the drag on the object less than 30 pixels from the origin it moves the object back to that origin location. All of my pieces origins have been placed in the center of each object and they are laid out on a 3 column 4 row grid of 450 by 450 squares.
Everything works fine when I have the controls enabled for the first piece but when I setup the same type of controls for the second piece and then try to drag the piece down the second piece I setup goes flying off the screen? The piece moves just as expected and doesn’t cause the second piece to fly off if I have the controls disabled for that piece? I think it has something to do with the collision area of the directional piece effecting the 2nd piece when it is created? I’ve tried the whole filter “enable mask” but still gives me issues. I’m not exactly sure what to do as seeing how this has been the only way I’ve discovered so far to get my piece to move correctly smh. I even tried having the piece tween to a location based on the y coordinate + 450 pixels but still doesn’t work smh.
I’m sure there’s probably a simpler solution than what I’m trying but if so I haven’t found it yet. I’ve included a screen shot of part of the control code and a link to the game with the second piece’s controls turned on to show you what it’s doing. Oh, the only piece that works is the piece right above the empty space btw. Any help woul be greatly appreciated!