Timer and Random problem
tufire
Member, PRO Posts: 17
So i have this set up where
Timer every 2 seconds
Spawn a Blue Ball
Works fine
New Set up
Timer every 2 seconds
Ball Spawn Value = random(1 to 4)
Ball Spawn Value = 1
Spawn Blue ball
Ball Spawn Value = 2
Spawn Red Ball
Ball Spawn Value = 3
Spawn Green Ball
Ball Spawn Value = 4
Spawn Yellow Ball
Problem. Random balls are spawning but sometimes its not every 2 seconds. so i have like gaps in my ball drops
The balls are moving at the right speed.
Timer every 2 seconds
Spawn a Blue Ball
Works fine
New Set up
Timer every 2 seconds
Ball Spawn Value = random(1 to 4)
Ball Spawn Value = 1
Spawn Blue ball
Ball Spawn Value = 2
Spawn Red Ball
Ball Spawn Value = 3
Spawn Green Ball
Ball Spawn Value = 4
Spawn Yellow Ball
Problem. Random balls are spawning but sometimes its not every 2 seconds. so i have like gaps in my ball drops
The balls are moving at the right speed.
Comments
heres a screen shot. the balls are being drop from above. ball 1, 3 and 4 are at the right distance. but the ball 2 at the top is way off. the gap between ball 4 and ball 2 is not at the correct space
Hi @tufire
My guess is the gaps are when you get the same number more than once (a sort of a glitch then...) - so try this: add the following to make your attribute Ball Spawn Value zero after each round. This should fix it for you hopefully.
Timer every 2 seconds
Ball Spawn Value = random(1 to 4)
When Ball Spawn Value = 1
Change Attribute Ball Spawn Value to 0
Spawn Blue ball
When Ball Spawn Value = 2
Change Attribute Ball Spawn Value to 0
Spawn Red Ball
When Ball Spawn Value = 3
Change Attribute Ball Spawn Value to 0
Spawn Green Ball
When Ball Spawn Value = 4
Change Attribute Ball Spawn Value to 0
Spawn Yellow Ball
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
i thought it was something else since i change the random value to a bigger range. 1 to 100. 1 to 25 would be blue ball. that way i wouldnt get repeated number as much. but the gap still happen then.
I'm glad I could help then. :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps