Random spawning actors, in the same location

thelogobarthelogobar Member Posts: 93
edited February 2012 in Working with GS (Mac)
Hello there, I am brand new to Game Salad and have been messing about learning bits and bobs. I have a vague idea for a first game, mainly as a learning exercise. It's based on the whack a mole games, but instead of a mole just popping up and down I'd like different moles to appear in the same spot, some worth more points to hit than others and some firing a weapon, while some are friendly so you lose points if you whack them.

I have seen the spawning random actors tutorial on YouTube and thats really helped me out so far, but the problem is actors are spawning over each other. How can I stop this happening? A check of some kind to see if an actor is already there? The locations don't change so will that make it easier?

Thanks in advance.

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    on moleActor:
    Rule: when
    Event: overlaps or collides with actor type Mole
    --Destroy this actor

    see also:  http://forums.gamesalad.com/discussion/40193/creating-a-safe-place-on-a-play-area#Item_6

    @};- MH
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Instead of spawning a random actor, you could spawn a single actor (Mole) and have a rule in the Mole actor that changes an attribute self.Random to a number in a range (say 1-6). Then, have rules that say if self.Random=1 then... and if self.Random=2 then... That way, the Mole actor selects a random number and changes itself based on that selection.
Sign In or Register to comment.