Make an ingredients list?

You guys remember those cooking games on coolmath where a customer asks you for an order and you cook it as pictured? (I think it was like papa’s burgeria or whatever idk)

How would you do that in gdevelop?

Capture

There’s obviously a lot of different ways to do it, but my first thought would be to create each ingredient as a draggable sprite with an object variable for each sprite that contains its “name” or “number”. I’d then create an target object where you want each layer of ingredient to end up and assign each instance of the target a number (starting with 0/1 at the bottom). Then, maybe a scene variable for which layer you are currently on. if an ingredient is in collision with one of the “targets” and the target number matches the current layer number, then i’d move the ingredient to the target location, and record that ingredient/layer data somewhere. You could store it in a variable array, or in object variables on each target (or lots of other ways). Then the trick is to have a way to test whether it was correct against some stored “correct” list (could be an array… or you could assign each target layer a “goal” number at the start of the level and then you could test if the object in collision with it has a matching goal (and if not, maybe change the animation of the ingredient to be red or something indicating it is wrong?)…

Dunno if that rambling description makes sense, but that’s how I’d approach it.

1 Like

I would probably have a structure variable with each child denoting each steps of the burger. And depending on what was put first, (or just a simple position comparison), I would fill up the structure and if the structure’s child’s value (from top to bottom) is what I want, I mark it as success, else fail.

If you search for “Array Tools” under extension and install it, there is a “Shuffle Array Children” action that will randomize the order of the elements of the array.