How to randomize actors?

triton13triton13 Member Posts: 161
edited March 2012 in Working with GS (Mac)
Hey guys, I just asked this question and Tynan helped me out and I also watched some videos on it but I'm still a little confused. The videos I watched from the Cookbook aren't exactly what I need. I want my actor that's a red square to change into my blue square actor and other colored square actors at random. I realize that I need to make it spawn those other actors but here's my problem. In the videos, he has a spawner that the actors are coming out of. What I want is my actors already in there place and when the game starts, then they start changing colors and stuff. I'm quite the noob and I apologize for that.

Comments

  • MantoManto Member Posts: 796
    edited March 2012
    I made a template for you. http://www.mantuapps.com/gs/rc.zip

    Edit: Do you want the actors change or are colors enough?
  • triton13triton13 Member Posts: 161
    Well here's how the game would be. I have a screen that you tap and then the game starts. You can already see the actors before you press the screen to start because they are already spawned. When it starts, they move around. When you press, lets say the red square, it adds a point and deletes itself. When you press any other, it resets the level. I want the red actor to be changing colored actors so you have to be careful when you press it otherwise you will press it when it's a different color and it will reset. See what I mean? Thank you very much though making me that template.
  • MantoManto Member Posts: 796
    You mean the red actor would be changing like every one second?
  • triton13triton13 Member Posts: 161
    Yeah, to one of the other actors.
  • MantoManto Member Posts: 796
  • triton13triton13 Member Posts: 161
    Yeah man, that's similar to what I want. Thank you so much. If I have any problems, I'll let you know but I don't think I will. Thanks again man =)
  • MantoManto Member Posts: 796
    No problem. Great it was the right one. If you need more help ask me :)
  • triton13triton13 Member Posts: 161
    I ran into one slight problem. I have it with my game that when you press a red actor, it deletes obviously and any other color, it resets the level. When all the red are deleted, it advances to the next level. Well, I start up my game and after one second, it switches levels on me. It's somehow deleting my red actor without me pressing it.
  • MantoManto Member Posts: 796
    Could you send me the project or share it here? It would be easier to help if I could see it.
  • MotherHooseMotherHoose Member Posts: 2,456
    are you using image changes for the color change?

    Rule: when
    Event: touch is pressed
    --Rule: when
    --Attribute: self.image = red.png
    ---changeScene: NextScene
    --Otherwise:
    --Reset Scene

    @};- MH
    "Games lubricate the body and the mind." — Benjamin Franklin
Sign In or Register to comment.