TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Spawning coins
Pages:
1
Spawning coins
tomicz
Posts: 106
February 17, 2015, 04:20:05 am
Hello there.
How do i spawn coins same way as in Temple run, my game is from top view though. So i have 3 lanes, and i want them randomly to spawn in all three lanes, but not in the same time, so only one lane at the moment.
tomicz
Posts: 106
February 17, 2015, 11:41:55 am
Anyone ?
TravisRoot
Posts: 6
February 26, 2015, 03:17:27 pm
Hey tomicz!
I would assign each lane a number attribute (0, 1, or 2) and have a "random number between __ and __ " decide which lane to spawn a coin in.
You could have the spawn behavior set to occur every, say, 4 seconds.
That's just the way I'd do it!
Squirrel Lord
Posts: 25
February 27, 2015, 06:14:57 pm
Travis is right. For a more detailed explenation:
Every {spawn coin time} seconds
--Set {LANE} to random number between 1 and 3.
If {LANE} =1
--Draw {COIN ACTOR} at {Lane 1 X} {Lane 1 Y}
Otherwise If {LANE} =2
--Draw {COIN ACTOR} at {Lane 2 X} {Lane 2 Y}
Otherwise If {LANE} =3
--Draw {COIN ACTOR} at {Lane 3 X} {Lane 3 Y}
Pages:
1