Is this easy to do?

hrsmediahrsmedia Member Posts: 522
edited November -1 in Working with GS (Mac)
I have managed to make an actor spawn when mouse is clicked, pretty easy.
But how do I limit to spawn only 1 actor if clicked? Then after a few seconds you can click to spawn another.

Also is it possible to select different actors to spawn by mouse click?

Hope this makes sense. Thanks

Comments

  • mrfunkleberrymrfunkleberry Member Posts: 424
    AllowSpawn (game attribute) = 0

    when mouse click
    and allowSpawn = 0

    spawn actor
    set allowSpawn = 1

    after timer
    set allowSpawn = 0
  • hrsmediahrsmedia Member Posts: 522
    ok so create new game attribute = AllowSpawn (integer) Value = 0 ?

    Then create rule when mouse click change attribute game.AllowSpawn to game.AllowSpawn0 ?

    Do I put this on the invisible actor on the stage that I am using to spawn?

    Sorry i'm bit confused. I started with the how to make a simple drawing game how to in the wiki...
  • hrsmediahrsmedia Member Posts: 522
    ok. i've managed to make it spawn only once. but it won't spawn after the timer.

    I've set the rule like this:

    mousebutton is down
    game.allowspawn = 0

    spawn actor

    change attribute: game.allowspawn to game.allowspawn=1

    timer: after 5 seconds
    change attribute: game.allowspawn to game.allowspawn=0
  • hrsmediahrsmedia Member Posts: 522
    change attribute: game.allowspawn to game.allowspawn+1

    timer: after 5 seconds
    change attribute: game.allowspawn to game.allowspawn-0
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Make sure run to completion is checked in the Timer.
  • ChristianpowerChristianpower Member Posts: 12
    this is kind of random but don't you just feel smart when you talk about this stuff
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Stop dragging up old posts please.

    Ace
This discussion has been closed.