Random number generator in Thyme
5 posts • Page 1 of 1
Random number generator in Thyme
Is there a way to generate random numbers in Thyme?
- hpstricker
- Posts: 16
- Joined: Wed Jan 03, 2018 11:10 am
Re: Random number generator in Thyme
rand.boolean
rand.direction2D
rand.normal
rand.normal2D
rand.uniform01
rand.direction2D
rand.normal
rand.normal2D
rand.uniform01
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Random number generator in Thyme
I am really sorry for bumping this post, I know nobody likes bumping post, but can someone please explain how these five functions work?
onCollide:
(e)=>{
System.exit;
}
(e)=>{
System.exit;
}
- HumanoidX
- Posts: 3
- Joined: Tue Jun 23, 2020 10:39 am
Re: Random number generator in Thyme
Rand.uniform01 generates a random number between 0 and 1. You can manipulate the result to create any number range you want such as:
Rand.uniform01*10-5 for all numbers from -5 to +5
Rand.normal generates numbers in a normal distribution, i.e as if you were throwing darts at a target. Near the center (zero) the propability is the highest, the further away you go (positive and negative direction), the lower it drops(at roughly 6 its low enough to be assumed zero chance)
Rand.normal2D is rand.normal but this in 2D coordinates around [0,0]
rand.boolean is a random yes/no result
Rand.direction2D results in a vector (a [x,y] number] that's always a random point on a circle with radius one around [0,0]
Rand.uniform01*10-5 for all numbers from -5 to +5
Rand.normal generates numbers in a normal distribution, i.e as if you were throwing darts at a target. Near the center (zero) the propability is the highest, the further away you go (positive and negative direction), the lower it drops(at roughly 6 its low enough to be assumed zero chance)
Rand.normal2D is rand.normal but this in 2D coordinates around [0,0]
rand.boolean is a random yes/no result
Rand.direction2D results in a vector (a [x,y] number] that's always a random point on a circle with radius one around [0,0]
- FRA32
- Posts: 229
- Joined: Wed Dec 03, 2014 9:51 pm
Re: Random number generator in Thyme
Oh yeah, thanks for replying, that's enlightening. I thought that this forum is no longer active. Thanks!
onCollide:
(e)=>{
System.exit;
}
(e)=>{
System.exit;
}
- HumanoidX
- Posts: 3
- Joined: Tue Jun 23, 2020 10:39 am
5 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest