How do I spawn two new objects and know which is which

Get help using Construct 2

Post » Tue May 06, 2014 6:29 pm

Hello good people of the construct2 world

I have just started working with this tool and must say it is great.
As all beginners i have ran into some problems trying to develop my game

I have a cloud sprite object that acts like a platform that needs to spawn 2 rain drops
I have made 15 objects that are called drops1, drops2 ---- drops15
now i must make it so the cloud spawns drops1 and another dropsX random, the problem is when the player catches the drop I don't know how to make so I can detect witch one he has cached, and if it is the right one (first drops1 then drops2) then make it so the next right drop to catch is lets say drops3
If the player has not cached the right one he missed or caught for example drops9 then the cloud must spawn again the right drop and one other random


I am not sure if I have described this right, but I am thankful for any help or insight that you can provide.

Thanks in advance
B
4
S
1
Posts: 4
Reputation: 258

Post » Tue May 06, 2014 6:41 pm

This isn't the way to do this. Use a single object and either use a different frame for each, if they display a number, or give it an instance variable with the number you care about. The frame number or instance variable then tells you which is which.
ImageImageImage
B
71
S
22
G
249
Posts: 3,762
Reputation: 138,575

Post » Tue May 06, 2014 6:44 pm

the problem is that all the drops are diferent
number one is blue, 2 is red and so on

also is it possible to differentiate between objects based on name lets say drops1 and drops2
Last edited by Bebra on Tue May 06, 2014 6:45 pm, edited 1 time in total.
B
4
S
1
Posts: 4
Reputation: 258

Post » Tue May 06, 2014 6:45 pm

That is dealt with by using different animation frames for each.
ImageImageImage
B
71
S
22
G
249
Posts: 3,762
Reputation: 138,575

Post » Tue May 06, 2014 7:00 pm

RE: "also": no. You'd have to have 15 checks - that's the problem. You'd need to do everything 15 times. You can do it in one.
ImageImageImage
B
71
S
22
G
249
Posts: 3,762
Reputation: 138,575

Post » Tue May 06, 2014 7:03 pm

thank you, I will try it and post how successful it was :)
B
4
S
1
Posts: 4
Reputation: 258

Post » Tue May 06, 2014 9:32 pm

Wow thank you blackhornet, i managed to make it that way, now I just have one object and look for what frame is it

Thank very much
B
4
S
1
Posts: 4
Reputation: 258


Return to How do I....?

Who is online

Users browsing this forum: worm1 and 21 guests