Overlapping same object type and checking variables?

Get help using Construct 2

Post » Fri Jan 29, 2016 1:08 am

I tried changing it to work but it still doesn't. If a sprite with a powerup overlaps another sprite with a powerup only the 1st one should change to 50,50 but it's not working.

Link: http://www.mediafire.com/download/hg4fv ... ables.capx
B
10
S
4
G
6
Posts: 80
Reputation: 3,623

Post » Fri Jan 29, 2016 1:14 am

:) You've subtly changed your wording, so it's the opposite of what I *thought* you were wanting. So the problem is, if two object overlap, how do you define the "first". They both overlap at the same time, so there is not really a first and second.
ImageImageImage
B
71
S
20
G
190
Posts: 3,533
Reputation: 108,340

Post » Fri Jan 29, 2016 1:27 am

I think of it as the second sprite being a different object.

Like instead of the 2nd sprite being a green sprite, what if it was a red sprite? If the second sprite was a different object the event would work perfectly, but I need both sprites to be the same object type.
B
10
S
4
G
6
Posts: 80
Reputation: 3,623

Post » Fri Jan 29, 2016 1:59 am

What about the 'power' value? Is that supposed to change with the change in size also - that will make a difference.
ImageImageImage
B
71
S
20
G
190
Posts: 3,533
Reputation: 108,340

Post » Fri Jan 29, 2016 2:15 am

No the power value doesn't change with the change in size, but what if I needed it to? Can you show me how to do both?
B
10
S
4
G
6
Posts: 80
Reputation: 3,623

Post » Fri Jan 29, 2016 2:26 am

www.blackhornettechnologies.com/Constru ... _BHT2.capx
Here's your first request. I'm still not sure this is actually what you want. If you look at the console, you see the green sprite that downsizes keeps getting downsized, since the conditions remain the same, even though the size has changed.
ImageImageImage
B
71
S
20
G
190
Posts: 3,533
Reputation: 108,340

Post » Fri Jan 29, 2016 2:39 am

It's almost working, but I actually need the sprite moving right to change it's size to 50,50 not the one that's moving left.

And why does the sprite in the top left corner, This sprite:

Image

Why does it have its size changed to 50,50? It should stay the same since it doesn't overlap a sprite with a powerup.

Sorry about all the questions guys!

It's just that getting the same object type overlap to work is extremely confusing for me since it doesn't work like a normal overlap between two different object types.
B
10
S
4
G
6
Posts: 80
Reputation: 3,623

Post » Fri Jan 29, 2016 3:36 am

You have not provided enough detail to solve this. How is C2 supposed to know that you want the right-moving one to resize? The objects are the same. You need to specify something else to identify the correct object.
ImageImageImage
B
71
S
20
G
190
Posts: 3,533
Reputation: 108,340

Post » Fri Jan 29, 2016 4:07 am

You are right. C2 doesn't know the right moving one needs to be resized so I specified a "ChangeThisOne" variable to tell the difference.

Also my second request is fixed as well, and it's in the second layout. Here's the finished cap:

Link: http://www.mediafire.com/download/hx8uc ... fixed.capx

Thanks blackhornet! You fixed everything! :)
B
10
S
4
G
6
Posts: 80
Reputation: 3,623

Previous

Return to How do I....?

Who is online

Users browsing this forum: RaiSen and 6 guests