Drag and Drop Interactive Game

So I exported the earlier version of the game and was just trying out how it looks.
When I embed on to the website and checked the mobile version, it looked something like one in the image below. (This is a zoomed out version) I don’t want the black sections to pop out.
Do I need to upload it to a website like itch.io and then embed it to resolve the issue? Or change the resolution?
Because now I’ve directly embed the link to the GD web export, hosted on GD server.
I’ve set the resolution of this game to 720*1080

i assume your phone has a 16:9 ratio. you can google your device to find out.
so if you don’t want boarders, set the resolution to something in a ratio equal to your phone
you can set the resolution exactly to the res of your phone.

i tested the delete and it doesnt seem to work as i expected.
i will do some more testing, but its not working as well, as i hoped.

the repeat for each child is also not working super well,
firstly its not possible to use dynamic children, or children in general, or a variable as a variable to store the child data.

however, i got it working with the use of an extra structure where i store the data of the first structure as json and after the for each child loop, i parse it back to the first structure.

im not too happy of how it works, but it is working.
I´ll have to do some more testing before implementing it tho.

E:
i did some more testing, and the repeat for each child event in general ironically does not know what children is :confused:
so for both the mother and the children values i cannot use a dot(.) or structure[]
this means i have to rewrite the data with the children first into a new variable as JSON, so i do not have a mother to the structure anymore (data transfer count 1)
then i have to parse it into another variable, to not have it as a json anymore (data transfer count 2)
then i use the new motherless structure to check each child with the for each childevent and store it into childvariable (data transfer count 3) and then into another variable to have it sorted again. (data transfer count 4)
then i finally write the data back into the original structure (data transfer count 5)


save.shapes → test ->test2->child->shapes2->save.shapes
it is fully functional, but transferring the data 5 times just to resort it seems stupid.

1 Like

i did not find a much better way to do this.
i thought about a loop that rewrites all children with a higher count number into another structure and rewrite it back with a -1
i assume that it would actually work better then the mess i showed above.
but since the mess above actually works fine, even with 500+ objects, i do not feel the need to change it.
Here is the example using delete & pipette.

1 Like

That does seem a long process to achieve the desired the output, but eventually it serves the purpose.
It was fun to get lost in the events, to try and understand the logic behind each step.
However, can you explain me a bit about what is Parse JSON exactly? I’m unable to get a grasp on it.

On another note, the game is finally live on the platform.
I can’t thank you enough for helping me out with this. Wouldn’t have been possible without you.
It has been a mini-journey for me to try out various options, fail at them and eventually settle with GDevelop. Happy that it’s come to fruition. :blush:

With the mobile version of the website though, we’re facing an issue with the embed window. Black spaces are popping up, above and below the game. Can you suggest a workaround that? We tried tweaking our embed settings but they don’t seem to be working.

We’ve set it to 720*1080. Despite that the issue seems to come up.

with the expression ToJSON you translate the data of a structure to a single Sting.
In order to make the JSON string readable again and sorted into a structure, you parse (translate) the JSON string back to a structure. In order to see what happens there exactly i recommend to play around with the debugger, where you have visual access to the variables.

not despite, its because
a 16/9 ratio would be 576 x 1024 or 720 x 1280 for example.

E:
i tried the online version, and your values for your Yposition for the drag items to canvas is off.
Also the drags for color/alpha are not correctly calculated. i cannot set the alpha to 255 (therfore i assume nether the colors)

Sure, I’ll do that.

Yes, I encountered that too before putting it up. However, I had to push it since we had to publish it on the artist’s birthday, the one we’re celebrating. From whatever we’ve seen, not many seem to use those items. Nonetheless, will remove the bugs and update it.

For the record, this was a bug and has been fixed on newer versions of GDevelop.

yes, i am aware, saw it in the update notifications

GJ :+1:

1 Like