How to randomly generate multiples of anumberbetween numbers

Get help using Construct 2

Post » Sat Jan 28, 2017 10:05 pm

Hello, Its been awhile since I have been on the forums. :? I need a bit of help with something.
I am creating a simple platformer game, and I have my platforms randomly generate, but because of the sprite I use, sometimes they generate strangely.

Basically, I need to Randomly generate multiples of a number only up to a certain number. (If that makes sense).

Like for example, say If i wanted to randomly generate multiples of 6, but only up to ten times, so I would want it so it would only randomly generate these numbers:

6, 12, 18, 24, 30, 36, 42, 48, 54, 60.

Can anyone help?
B
3
Posts: 2
Reputation: 179

Post » Sat Jan 28, 2017 10:10 pm

if it's strictly as stated; choose(6, 12, 18, 24, 30, 36, 42, 48, 54, 60)

or
int(random(1,11)) * 6
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Sat Jan 28, 2017 10:43 pm

Works like a charm! Thanks!
B
3
Posts: 2
Reputation: 179


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 38 guests