Is there a fast way of... ?
BonepileGames
Member Posts: 194
Hello to GS Community,
I am working on a project where I have 102 different pictures. Depending on a randomly chosen number (e.g 25) a picture with name "25" will show up. Is there any way faster than creating 102 separate rules (if game.picture = 1...2...3...4...102) to put that in one or two rules?
I bet there is some way to save some time rather than going through this tedious way of creating 102 rules...
Thank you in advance.
Comments
I think if you name your images the actual numbers (1, 2, 3, etc..). You could place a dummy image on screen and then use a Change Attribute to change the image to the value of the random number.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Use either change like jamie_c says or constrain. (constrain if the image needs to be updated constantly)
In this example the images are named car1, car2, car3, etc.
Lump Apps and My Assets
It should be as simple as:
Change image to game.picture
@Socks
if I have 27 pictures of 300kb average and another 102 pictures of 60kb average, will it lag when game.picture changes? I see once game.picture changes, the picture isn't changing immediately, I am not even certain under what circumstances it does.
I have an actor PICTURE (where a picture should randomly pop up depending on game.picture (1-27)) and another actor QE (where another set of picture should randomly pop up depending on game.qe (1-102)).
Will what lag ?
I'd guess it's probably the way you have your project set up.
Sounds good.
Will what lag ?
I'd guess it's probably the way you have your project set up.
Sounds good.