A question from a noob...
xero907
Member Posts: 4
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!
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
Use COINSPAWNER:
Timer > Every (seconds)
>>Spawn an Actor Called COIN.
Position -> random(X,X) Postiion ^ random (X,X) Relative to: Scene
That should work
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, ...
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.
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
http://gamesalad.com/forums/topic.php?id=11552