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
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

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
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

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
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

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 3 guests