Spawning actors based on another actor?

In my game, I have stars spawning based on a timer in random positions along the ground. What I want to do is to have only one star in the scene at a time, so once the actor collects the star, a new one will spawn right away, but in a new random location (very similar to classic SNAKE games)

Can someone help me out?

Answers

  • GOG_GamesGOG_Games Member Posts: 130
    You could:
    -Make an boolean attribute in the 'Game' page
    -Have a rule that if the character hits the star, he changes the attribute to 'True'
    -If the attribute is true, spawn a new star in a random place
    -Set a timer to reset the boolean attribute to 'False' after:
    -A new star is spawned because the attribute was true
  • sak0213sak0213 Member Posts: 7
    Make a rule that has for when your actor collides with a star, then make it do a spawn actor function?
  • GOG_GamesGOG_Games Member Posts: 130
    @sak0213 - That would just spawn a star on the character.
  • sak0213sak0213 Member Posts: 7
    Ah, i see what you mean. I didn't think of that. Is there a way to randomize the direction it spawns from that step? (I'm still relatively new to using game salad)
  • WingmanappsWingmanapps Member Posts: 458
  • SoxProcsSoxProcs Member Posts: 11
    GOG Games, I am following up to the last step , what do you mean by:

    -Set a timer to reset the boolean attribute to 'False' after:
    -A new star is spawned because the attribute was true

    Once I get to this step I become confused on what you mean, could you maybe help clarify that?
  • GOG_GamesGOG_Games Member Posts: 130
    Sure. So, go to the Gamesalad Creator, and click on your actor. In your rule about changing the attribute to true, put a timer there. Set the timer to this rule set:

    •After 0.1 seconds,
    •Change attribute '(whatever your attribute's name is here)' to false.

    In the star, put a rule that if the attribute is true, spawn a new star in a random location.


    Does this make sense? :) Sorry, I was a little unclear. :)
Sign In or Register to comment.