Randomizing the death screen

andrewhnovak@gmail.comandrewhnovak@gmail.com Member, PRO Posts: 77

In my endless runner, I have a screen that appears (image) when the user dies. I want it to have a random taunt and play again button. I want to have like 20 taunts and so it randomizes which one appears. Same screen, but different words/taunts. Is there a way I can do this? It doesn't really give me much information when I click into the game over screen as you can see in image so...
Any Ideas?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2014

    The easiest way to do this is to number your images, for example:

    taunt1.png taunt2.png taunt3.png ... taunt20.png

    And then have a rule that changes the attribute self.Image to "taunt"..random(1,20).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.