Change image to random image

veltanveltan Member Posts: 1

I'm making a game with a deck of cards, and I need to have the image change to a random card for when you flip a card. I read that GameSalad has a RNG, but I can't figure out how to use it with Change Image behavior as there's just a drop down box with all of my images there. Can anyone help me with this?

I'm using GameSalad for the PC.

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934

    you actually would not use it with the change image behavior. There is a random function. but it only works for defining a value. so you would actually use it with the change attribute behavior. You would basically be changing the self.image attribute to

    random(1,52).png

    You card images will need to names just like that. 1.png 2.png etc....Now you will want to check out the cookbook videos or maybe gshelper to find the video that tells how to not repeat your random number a second time in the cycle.

  • veltanveltan Member Posts: 1

    ah ok, thanks ^^ was confused cuz I thought I was suppose to use change image.

Sign In or Register to comment.