random result

gotyoursgotyours Member Posts: 246
edited March 2012 in Working with GS (Mac)
Hello,

I am working on a project, that has a animation in it, I can get the animation to run for the amount of time i want, but at the end i want it to display a result from 1 of the 2 end game scenes i created, My project has a total of 4 scenes, scene 1 is the choice, kicks into scene 2(animation) scene 3 and 4 are my results. Any help would be great

Thanks again

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    edited March 2012
    Have an attribute called randomScene and have it set to 0

    when the animation stops playing change attribute randomScene to random(1,2)

    then have a rule when randomScene=1
    -change scene to scene 3

    then another rule when randomScene=2
    -change scene to scene 4

    Also make sure when you reset the game change randomScene back to 0, or else itll change scenes as soon as it starts

    cheers
  • gotyoursgotyours Member Posts: 246
    ill give it a try thanks
  • CloudsClouds Member Posts: 1,599
    Have an attribute called randomScene and have it set to 0

    when the animation stops playing change attribute randomScene to random(1,2)

    then have a rule when randomScene=1
    -change scene to scene 3

    then another rule when randomScene=2
    -change scene to scene 4

    Also make sure when you reset the game change randomScene back to 0, or else itll change scenes as soon as it starts

    cheers



    Could you not lose the attributes and rules simply have :

    Change scene to scene random (3,4)

    ?
  • gotyoursgotyours Member Posts: 246
    I tried what John had suggested with no luck, it finishes the animation loop and then stays there, I put the attributes into the scene with the animation and also the rules? Sorry for bugging you guys this is my 1st crack at this. If anyone has anymore suggestions let me know, i could e-mail the file to somome if they want to look at it to see if i did it correctly, its just over 1mb
  • MotherHooseMotherHoose Member Posts: 2,456
    you may need to tell the computer that the animation is done

    Rule: when
    Attribute: self.Image = lastImageName.png
    --do this (your random and changeScene)

    @};- MH
Sign In or Register to comment.