Destroying actors in a certain order??

TechNoirTechNoir Member, PRO Posts: 117
edited June 2012 in Working with GS (Mac)
Hey guys,

I have 3 actors in my game that randomly appear (like a fruit machine display)..
There are 3 more actors above that will also have the same symbols but are displayed in no particular order (or no order related to my fruit machine) .. But I want to destroy them in the same order that is being displayed on my random fruit machine..

So using rules within the actors of the fruit machine display, I can identify when the apple is first in line or second,, etc.. but what is the next step how do I let the actor above (say apple symbol again) know the order below?

Many thanks,

TN

Best Answer

  • MobileRocketGamesMobileRocketGames Posts: 128
    edited June 2012 Accepted Answer
    Sorry to be a grammar/spelling nazi but what is a "fruit machine display". Do you mean a slot machine with fruit symbols?
    Holy hell!
    Second sentence "...will also have the same symbols.." which symbols are you referring to? When you say "have the same symbols", you have to have already mentioned a symbol previously.

    Sorry to be a d*ck but its so hard to help people when they are not clear about what they need.

    So because I'm not sure exactly what you are doing I'm going to assume you want 3 actors on top and 3 actors on bottom. You want your players to be able to select the actors on top, and then having the 3 actors on bottom randomly spin and land on fruit symbols.

    Create 6 integer attributes in your game attribute list, call them Current1, Current2, Current3 and Random1, Random2, Random3.

    In your top left actor (the first non-random actor) create a Rule:
    Attribute Current1 = 1
    -----Change image (to fruit #1)
    Attribute Current1 = 2
    -----Change image (to fruit #2)
    Do this again for all 5 fruits in all 6 actors.
    In the top 3 add this Rule:
    Attribute mySymbol = Current1
    -----Destroy this actor
    Change the Current1 to Current2 and so on for the next two actors at the top. Do the same for the ones at the bottom but change Current1,2 and 3 to Random1,2 and 3 and leave out the destroy actor rule on the bottom 3 as well.

    In the bottom three actors (or wherever you are generating the random numbers) use a change attribute and change the corresponding Random1, 2 or 3 to whatever number the random fruit is. So if you have 5 fruits, strawberry is (1), banana (2), pineapple (3), pear (4) and peach (5) and they random banana, pear, pear:

    Random1 = 2
    Random2 = 4
    Random3 = 4

    All you are doing is having the top actors check if the fruits that come up (Random1,2 and 3) are the same as the numbers you are storing for your soon-to-be-destroyed actors (Current1,2 and 3). Whenever they come up the same, they will destroy the actor on top.
    Now you may also want to have a delay, so that they only destroy the top actors when something happens (like the reels stop spinning or whatever) so you may want to add another condition to your Rule statement saying when another attribute is set to True. So you set that attribute to True when you want it to check if the bottom actors are the same as the top actors.

Answers

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    You need to assign outside attributes like a Boolean true it is alive or false it's dead.
  • TechNoirTechNoir Member, PRO Posts: 117
    Thanks for your reply @mobilerocketgames I appreciate it.. but I still have my problem,, I will try and explain more clearly...

    I have 3 actors on the bottom of my screen they appear in a random order.. lets say its an Apple, Orange and a Pear..

    I have the same number of actors on the top of my screen that look similar to the actors below.. i.e an Apple an Orange and a Pear..

    I want to be able to destroy the actors above in the same order that the randomly generated actors have appeared..

    So if an Apple, Orange and a Pear appear on the bottom of the screen,, in that order..for example.. Apple (position 1) Orange (position 2) Pear (position 3)

    So I want to be able to destroy the corresponding actors above in the same order..
Sign In or Register to comment.