Spawn Images for actors
aliz94
Member, PRO Posts: 19
I have the following:
self.block_id = random(1,4)
but I want to spawn the images in the order 1, 2, 3, 4
How do I do that
Comments
Do you want spawn new actors or just change the image of an actor?
If you want to change actorr's image, use something like this:
change self.block_id to self.block_id+1
When self.block_id = 1 -> change attribute self.image to imagename1
When self.block_id = 2 -> change attribute self image to imagename2
Etc..
Only the image.
self.block_id+1 isn't valid for some reason it's removed after I preview the app.
I want the same as random(1,4) except without the random but that doesn't work either. Whats the proper format?
Is self.block_id integer attribute? When do you want to change the actor's image? Do you want to animate it during time? Image1 -> image2 -> image3 -> image4 -> image1 etc..?
As the game progresses and the user clicks I want the image to go through a series of images starting from 1-10. Currently is works but only randomly. I want it to go in order.
Then just add one to the attribute each time the user clicks. Get rid of the random function. Also make sure you are selecting attributes from the drop-down menus rather than typing them in (which doesn't work).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User