Background image change random after game reset

evertevert Member Posts: 266
edited December 2016 in Working with GS (Mac)

Hey, its me again with another question.

I have some different backgrounds in my game.
I made a change attribute in my game reset actor - when game reset, game.color to random(1,4).

In my background actor i have:

  • Rule game.color = 1
  • change image
    -Rule game.color = 2
    -change image
    ....

This does work when i make a separate button that does game.color to random(1,4)
But i want my color change when the game has been reset.

My reset actor looks like this:
Rule - game.reset = 1

  • Timer (this is because i want my menu to disappear/slide away first)
    Reset game
    change attribute: game.color to random(1,4)

Thanks

Comments

  • frdfrd Member Posts: 191

    If you are resetting the whole game then the change attribute wont work. It would work if the change attribute happened at the beginning of the scene instead of the end.

  • SocksSocks London, UK.Member Posts: 12,822

    I'd dump all those rules, rename your BG images 1, 2, 3 and 4, and place a change attribute behaviour in the BG actor that says Change self.image to random (1,4).

  • evertevert Member Posts: 266
    edited December 2016

    It worked! but differently, i just had to change my reset game to a reset scene :)
    My menu now slides over the last bg from the random pile and the background flows over into another background. Want to make my game seamless :)

Sign In or Register to comment.