Re spawning help!

iDeveloperziDeveloperz Member Posts: 1,169
edited November -1 in Working with GS (Mac)
Hi, I was wondering if anyone could help me with my problem. I am currently making a game where rocks come from the left and you have to tap them before they touch the earth on the right. But I am having problems where once you tap the rock thats it. Does anyone know how to add an unlimited, or a chosen limited number of rocks that will re spawn on the left hand side?

Thank you.

Comments

  • JGary321JGary321 Member Posts: 1,246
    Sure thing:

    In your Spawner (Whatever actor spawns your rocks)

    Create Integer Attrib: Rocks Left

    Timer: Every 3-5 secs
    Rule:
    If Rocks Left > 0 then

    Spawn Rock
    Rocks Left = Rocks Left -1

    You just need to set the Rocks Left Attrib to however many rocks you want to spawn. You can even have:

    Rule:
    Change Attribute Rocks Left to Random (25-50)

    That way every time the level starts it will randomly set the number of rocks.

    Want it to spawn unlimited??

    Rule:
    Timer: Every 3-5 secs
    Spawn Rock

    etc....
  • iDeveloperziDeveloperz Member Posts: 1,169
    Ok, ill try it now.

    Thanks a lot.
  • iDeveloperziDeveloperz Member Posts: 1,169
    Sorry. But Where do I add the attribute?
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    you'll need to create a game attribute, you do this in your inspector pane. i.e. go into one of your scenes, you'll see the actors list, above that will say game and scene, make sure game is selected and then under that you have actors, attributes and devices, select attributes and then there is a plus (+) sign in the middle left of your overall screen (same way in which you add actors etc), select this and choose the type of attribute you want
  • JGary321JGary321 Member Posts: 1,246
    I would just create the attribute in actor itself. I try not to clutter my game.attributes.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    yeh true, many ways to do things, suppose it just depends on how much you got going on etc
Sign In or Register to comment.