How do I hide an instance per second ramdomly

Just started using Construct 2? Post your questions here

Post » Mon Oct 16, 2017 7:21 pm

I am using this code to do this:

- For each myInstance
-- Pick a random myInstance
-- myInstance is active >> wait 1 second
-------------------------------->> myInstance set opacity to 0
-------------------------------->> myInstance set active to true

I believe it's easy, but not for me :D
B
4
S
2
Posts: 153
Reputation: 908

Post » Mon Oct 16, 2017 7:50 pm

Hey @Braus!

What exactly are you trying to do? What I understood was that you want to pick a random instance every second and hide it, right?

If that's the case, try something like this:

https://www.dropbox.com/s/lsqsroqel7t0i ... .capx?dl=0

Hope this helps. Cheers!
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 717
Reputation: 3,996

Post » Mon Oct 16, 2017 8:28 pm

Thanks Bruno. I had tried the "every X second" before but not in this way.
B
4
S
2
Posts: 153
Reputation: 908

Post » Tue Oct 17, 2017 5:59 am

Hi @Braus !

How about this :

(system)Every second :
(system)Pick random "MyInstance" object => Set invisible.

How would that work for you ?
B
12
S
5
G
1
Posts: 39
Reputation: 1,528

Post » Tue Oct 17, 2017 10:05 am

Hey @DiabloOvermind!

That would work too, but note that the random pick could pick instances that are already invisible. You should have another event that identifies which ones are visible and pick a random instance from among them only.

Cheers.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 717
Reputation: 3,996


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests