0 votes

Hello,
I'm trying to make it so a random order of a set of images spawns after the player fulfills the previous order like a cooking game. What would be the best way to spawn an array of images randomly in specific place on the screen? I thought I could have 3 sprites and randomly set different textures to them but I feel like this is probably the wrong way to go sbout it?
Any advice is welcome.
Thank you!

Godot version 3
in Engine by (21 points)

1 Answer

0 votes

Is it really images You want to spawn ?
Because I would imagine, that in game like this, You would want to spawn some objects, that relate not only to visual appearance, but to a certain data. For example You will spawn "bread" "tomato" "fries", and each of these data will :
1. Be displayed as certain image
2. Expect player to collect certain object to fulfill next order

So I would create some UI with 3 image slots. Whenever a new ingredient condition would be initialized, signal with condition name would be emitted. UI would receive this signal and display image that is named similarily in free slot ( for example "tomato.png" would be created from condition.name + "png" ).

by (8,101 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.