Need help for basic spawn sprite on specific position

so I have 4 different drinking glass.
when I click release on each glass, it would create an object on the area of the glass.
glass 0 = on pink area
glass 1 = on magenta area
glass 2 = on blue area
glass 3 = on yellow area
and if all list of areas all empty, it should be created on list 0, if list 0 is filled it should be created on list 1, and if list 1 is filled, it should create on list 2, and if all is filled, nothing hapend.

If you have something similar to this let me know or if you want to make a simple example to implement it?

What you can do is use some collision checkers.
Put a start_checker on the glasses, and a death_checker above the colors.
If click on start, place object on start. While object is in collision with checker, move it up 123 pixels. If object is set in a free slot, add a checker there for the next objects.
If object collides with death, delete object.
All of this will be done in the same frame, so you won’t see the objects moving up.

If you get stuck, share your events.

PS: the colors are magenta, purple, blue and green, just in case you didn’t know you are colorblind. :sweat_smile:

thanks for the help, I try using the collision checker, and I am pretty satisfied with the result. I succeed to add the glass, deleting the glass, and make the checker position move to the next box container of glass. the problem is the order of the container is pretty weird here.
please look at image below:
preview ss

the checker starts at the top of the blue container. while the other container starts at the bottom. event though I place it at the bottom on gdevelop layout game.
layout ss

here is my event screenshoot:

anyway, thank you so much for the idea.

Maybe this:

If you have only two or three columns, it’s okay to proceed like this (i.e. hardcode each column), but if you have more, or you want to avoid such anomalies, it’s better to find a system that deals with all columns at once, using object groups, variables, custom functions, etc.

Anyway, keep up the good work. :+1:

I made it more efficient by using some system to add the glass and change it is position, thanks
now it’s all done