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
→
Random Numbers Just Like The Rolling Dice In Snake And Ladders
Pages:
1
Random Numbers Just Like The Rolling Dice In Snake And Ladders
krazziebone02
Posts: 113
August 09, 2014, 06:26:39 pm
I want a random numbers 1 - 6 just like the rolling dice in snake and ladders but i will apply it in actor's animation is somebody can help me??
i want to be the best user of stencyl
krazziebone02
Posts: 113
August 09, 2014, 06:28:51 pm
for example i will click an actor to random the numbers 1-6 and then automatically will stop is there anyone can help me??
i want to be the best user of stencyl
Indigo
Posts: 23
August 09, 2014, 11:29:12 pm
First make an attribute (game attribute if the number needs to be used across scenes or be stored between plays) and make sure the attribute is a number.
Now start with an event triggered by clicking on the actor.
In that event put the setter for your attribute. in your setter put the random number block and set your upper and lower bounds
Let me know if you have any problems
krazziebone02
Posts: 113
August 13, 2014, 08:35:04 am
what if i will use it in time event??
i want to be the best user of stencyl
Indigo
Posts: 23
August 18, 2014, 04:26:13 pm
I don't quite understand what you mean by using it in a time event? can you describe what you want your game to do?
You could put the same sort of code in a "do every ___ seconds" loop, or in a "do after __ seconds" loop if that's what you mean?
Callan S
Posts: 147
August 18, 2014, 10:15:18 pm
I think he might mean an 'always' event.
Krazzie, the following should work in an always event (you'll need to add a draw event that draws it as well)
krazziebone02
Posts: 113
August 20, 2014, 12:10:57 am
i want is to roll the dice and then after the roll the dice will step and for example the dice reveal the number 5 so the player of the snake and ladders will move a 5 steps
i want to be the best user of stencyl
krazziebone02
Posts: 113
August 21, 2014, 08:53:50 am
sir Callan S your code is correct but itis slow rolling what will i put to make faster rolling the numbers
i want to be the best user of stencyl
Pages:
1