Hello guys! I have encountered a problem. I am making a game where pancakes appear on a plate. The first pancake lies on the plate, the second on the first pancake, the third on the second, and so on. How can I make the pancakes appear sequentially on the plate? And how can I make it so that pancakes can be transferred to an empty plate? First the top pancake, then the one underneath, and so on.
The game is controlled using a timer. For example, once every 5 seconds, a pancake appears on plate number 1. Then we can press a button so that once every second, the top pancake from plate number 1 is transferred to plate number 2.
The thing is, I don’t understand how to make the top pancake transfer to the plate and then move the previous pancake, which was under the first, on top of the first pancake on the second plate. Maybe someone can help me?
I played around with the concept.
try me: the main plate is fixed but the other plates are draggable. Add, delete, move,
https://gd.games/keith_13579/craven-gun
Source project (click green [code] then [download zip] then unzip and open JSON file.
https://github.com/doug13579/gdevelop-pancake-onto-plates
I used a straight tween, You could probably move the pancakes in an arc shape either with another extension or by setting the Y using sin(). I wanted to keep it straight forward.
It uses a main plate and then generic plates. The plates are picked based on a ray cast from the respective buttons. This could be changed to a collision with a hidden object or point is inside or object IDs or object Booleans marking plates as done or selected. I used the sticker behavior to stick the pancakes to the plate. The counter on the plates is used to control the quantity and set the location.
When you invert the ray cast, it picks the farthest pancake or the top one. Alternatively, you could cast the ray from above.
There might be leftover scene variables. I think the only variable is the plate and main plate PancakeCount variable. You may need to play around with the z-order
Hello!
Thank you very much for your help!
I will try to do it the way you showed.
1 Like