What is the best mechanism for placing the contents of the burger on top of each other in the order of the player’s choosing?
I want to make a game but I don’t know the right technique
Hi!
Here is a very simple example, how the game could work.
- Add extension “Button States and Effects”
- Create ingredients (beef, cheese, lettuce, tomato etc.) as sprites
- Add “Button States” behaviour to all ingredients
- Add object variable “Name” to all ingredients, and give the name of the object as its value, here is one example:
- Create an object group “Ingredients” and add all ingredients there, like this:
- Create a scene layout, something like this. The object “Bun_bottom” is already on the plate, and other ingredients will be placed on top of it.
-
Create scene variables “Y_Position_Now” (number), “Z_Value_Now” (number) and “Burger_is_ready” (string)
-
Finally, the code:
Now when you click the ingredients on the right side, they are added to the burger. When you put “Bun_top”, the burger is ready and you can’t add ingredients any more.
When playing the game, the result might be something like this:
Btw. Here is one marvelous asset pack for this kind of game: Burger maker game kit
Hope this helps.
1 Like