How do I generate a random object?

Just started using Construct 2? Post your questions here

Post » Mon Mar 30, 2015 11:36 am

I want to randomly generate one of eg 10 different objects at a particular location x, y. When the correct answer is clicked on, both the answer and object will disappear, and then I will want to randomly generate one of the remaining 9 objects at the same location, and so on until all objects are matched with their answers.

So the first thing I need to do is work out how to randomly generate an object at location x, y.
B
3
Posts: 4
Reputation: 183

Post » Mon Mar 30, 2015 12:54 pm

you can set a variable's value to int(random(10)). then add sub event
if == 1 > create object 1
if == 2 > create object 2
.....
if == 10 > create object 10
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
49
S
11
G
2
Posts: 280
Reputation: 5,927

Post » Mon Mar 30, 2015 11:51 pm

Thx, I'll give it a go
B
3
Posts: 4
Reputation: 183

Post » Tue Mar 31, 2015 2:56 am

ok
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
49
S
11
G
2
Posts: 280
Reputation: 5,927

Post » Sun Apr 05, 2015 11:06 am

Learn more with demos:
https://www.dropbox.com/home/Demos
B
212
S
29
G
14
Posts: 1,865
Reputation: 36,939


Return to Beginner's Questions

Who is online

Users browsing this forum: LBiddiscombe and 2 guests