A question from a noob...

xero907xero907 Member Posts: 4
edited November -1 in Working with GS (Mac)
I know this is kinda a dumb question, but I'm new to GameSalad, so bear with me.

I'm making this game, and I need a random spawner; I have a actor called 'COIN', and I need 'COINSPAWNER' to spawn COIN at random intervals, at a random area on the screen.

Help!

Comments

  • JlmCJlmC Member Posts: 129
    do this:

    Use COINSPAWNER:
    Timer > Every (seconds)
    >>Spawn an Actor Called COIN.
    Position -> random(X,X) Postiion ^ random (X,X) Relative to: Scene

    That should work
  • anithmukanithmuk Member Posts: 235
    If you want the coin to spawn at any random time then in the timer behaviour after "every" insert function "random" and then add your min/max values eg random (1,100) will spawn the coin at any time between 1 and 100 seconds. Then to spawn it anywhere at a random location, just do as Jlmc said.
  • xero907xero907 Member Posts: 4
    Thanks for the replies, it works, but...

    It isn't REALLY random. It chooses, say, a number between 1 and 4, and say it chooses 3. THEN, it spawns a coin every 3 seconds; I don't want it to be 3, 3, 3, 3, ..., I want it to be, say, 2, 3, 4, 1, 3, 3, 2, 4, ...
  • anithmukanithmuk Member Posts: 235
    Yeah the random function isnt entirely random, I'm still new to GS but I think you would have to reactivate the random expression every time you use it.

    Anyway have a look at this thread http://gamesalad.com/forums/topic.php?id=947 , its not exactly what you were asking about but it has some good discussion about the random expression in Game salad.
  • frariofrario Member Posts: 164
    This one is a well known bug in Gamesalad. You have to reinitialize the timer.

    This should work:

    Make an actor boolean attribute, and call it "initTimer".

    Rule:
    If initTimer is 0 then
    --- change initTimer to 1
    Otherwise:
    --- PLACE YOUR TIMER HERE
    ---- change initTimer to 0
  • xero907xero907 Member Posts: 4
    frario said:
    This one is a well known bug in Gamesalad. You have to reinitialize the timer.

    This should work:

    Make an actor boolean attribute, and call it "initTimer".

    Rule:
    If initTimer is 0 then
    --- change initTimer to 1
    Otherwise:
    --- PLACE YOUR TIMER HERE
    ---- change initTimer to 0

    I did say I was a noob right? I don't know how to make an attribute, let alone a boolean attribute...
  • simo103simo103 Member, PRO Posts: 1,331
    Hi xero907 ... tshirtbooth has short videos that will walk you thru 'everything you need to know' about stuff like attributes. Well worth taking a little time to watch a few.

    http://gamesalad.com/forums/topic.php?id=11552
  • frariofrario Member Posts: 164
    xero907 said:
    I did say I was a noob right? I don't know how to make an attribute, let alone a boolean attribute...

    Sorry, may I come there and do it for you? I could also learn objective-c if you wish.
  • xero907xero907 Member Posts: 4
    simo103 said:
    Hi xero907 ... tshirtbooth has short videos that will walk you thru 'everything you need to know' about stuff like attributes. Well worth taking a little time to watch a few.

    http://gamesalad.com/forums/topic.php?id=11552

    frario said:
    Sorry, may I come there and do it for you? I could also learn objective-c if you wish.

    tshirtbooth said:
    Xero907 you have some homework to do my friend.

    http://www.youtube.com/user/GameSaladCookbook

    start watching and dont stop. Also check back as there are new videos going up every few days.

    cheers

    _________________________________________________________________________________

    FREE VIDEOS and AWESOME TEMPLATES FOR SALE BY TSHIRTBOOTH.

    imageimageimageimageimage

    Sorry for all the confusion and stuff. It's okay; I've found out the attribute thingy. Sorry, and thanks for all the help :D. It was that I didn't start learning from the basics, like a pyramid; if you don't start with the base, it falls. Or, euh, something like that.
  • simo103simo103 Member, PRO Posts: 1,331
    xero907 said:
    Sorry for all the confusion and stuff. It's okay; I've found out the attribute thingy. Sorry, and thanks for all the help :D. It was that I didn't start learning from the basics, like a pyramid; if you don't start with the base, it falls. Or, euh, something like that.

    No problem .... I also jumped in that way and eventually backed up a bit to get a feel for the basics. Luckily it's all there in videos (I have 1000+ page books for other stuff I've had to learn over the years .. ie: no fun ... that's why I praise tsb, weswog, Darren and others!).
Sign In or Register to comment.