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 Image
B
164
S
49
G
112
Posts: 7,638
Reputation: 78,475

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
84
S
27
G
69
Posts: 4,919
Reputation: 49,030

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 Image
B
164
S
49
G
112
Posts: 7,638
Reputation: 78,475

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 1 guest