What's the syntax for "RANDOM"

For questions about using Classic.

Post » Mon Apr 16, 2012 7:33 pm

Hi all,

I'm having trouble with Construct Classic.

Actually I want to spawn sprites in random positions, in Construct 2 the syntax is "Random(value , value)" but in CC it seems to be different...
Can anyone say me what's the syntax to spawn sprites between two values please.

Thanks. :)TopsyKretts2012-04-16 19:35:51
B
4
Posts: 20
Reputation: 365

Post » Mon Apr 16, 2012 7:46 pm

Just random(value).
If you need that ranged use random(value)+ offset.
Image ImageImage
B
169
S
50
G
173
Posts: 8,316
Reputation: 110,276

Post » Mon Apr 16, 2012 7:52 pm

That's if I want to random between two values, right ?
B
4
Posts: 20
Reputation: 365

Post » Mon Apr 16, 2012 8:01 pm

I'd like to random between two values, like this:
TopsyKretts2012-04-16 20:01:58
B
4
Posts: 20
Reputation: 365

Post » Mon Apr 16, 2012 8:10 pm

random(320-10)+10
B
92
S
32
G
109
Posts: 5,290
Reputation: 70,991

Post » Mon Apr 16, 2012 8:12 pm

Well 320-10 is 310, so if you were to use random(310)+10,.... try it you'll like it I swear.

Edit: ninjahoundnewt2012-04-16 20:14:06
Image ImageImage
B
169
S
50
G
173
Posts: 8,316
Reputation: 110,276

Post » Mon Apr 16, 2012 8:16 pm

Great, thanks guys !
B
4
Posts: 20
Reputation: 365


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests