Overlapping objects

Get help using Construct 2

Post » Sat Sep 09, 2017 3:40 pm

Oy lads!

Hopefully you are having great weekend.

I'm just looking for some help with my code. It's about overlaping of objects and unfortunatully, it does not work as I wanted. Well, it doeas not work at all by the way I want it :D Code of this is simple and if someone have better ideas how to make it work, shoot at me! :D

Image

Image

Those "squares" on that gear have Instance Variable setted with the numbers form 0 to 360. (6x60) And all I want is - Rotate the gear, overlap the "gear Arrow" and set layer with the value visible. Any ideas how to improve this?
SoftWork Group Ltd

Co-founders:
Robert Matik (UK Division)
Lukas Zyrek (CZ Division)

07399443703 (UK Division)

International(at)softworkgroup.wtf - for basic questions and information
Office(at)softworkgroup.wtf - email for questions about team and proposals
B
16
S
5
G
1
Posts: 49
Reputation: 1,656

Post » Sat Sep 09, 2017 3:53 pm

Looks interesting, but I don't understand how it's supposed to work from the picture.
Why are you testing collision with the Console_Gear (big circle?) and not with the gear arrow (triangle thingy)?
Could you share the CAPX file?
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
66
Posts: 1,010
Reputation: 36,081

Post » Sat Sep 09, 2017 4:06 pm

Ey Dop. Well, there is a condition pointing to the animation name "Gear_Arrow". So Collision should be OK for me.
SoftWork Group Ltd

Co-founders:
Robert Matik (UK Division)
Lukas Zyrek (CZ Division)

07399443703 (UK Division)

International(at)softworkgroup.wtf - for basic questions and information
Office(at)softworkgroup.wtf - email for questions about team and proposals
B
16
S
5
G
1
Posts: 49
Reputation: 1,656

Post » Sat Sep 09, 2017 4:13 pm

What about the CAPX file, can you upload it?
You can remove all unrelated things from it.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
66
Posts: 1,010
Reputation: 36,081

Post » Sat Sep 09, 2017 4:20 pm

Here you go.
SoftWork Group Ltd

Co-founders:
Robert Matik (UK Division)
Lukas Zyrek (CZ Division)

07399443703 (UK Division)

International(at)softworkgroup.wtf - for basic questions and information
Office(at)softworkgroup.wtf - email for questions about team and proposals
B
16
S
5
G
1
Posts: 49
Reputation: 1,656

Post » Sat Sep 09, 2017 4:59 pm

Looks like you have the same problem as the guy in this post.
When you first check collision with Console_Gear, the system picks 1 instance of Console_Gear (first available as there are multiple collisions). And then when you trying to check if this 1 instance is playing "arrow" animation, this condition obviously fails.


You need to change your code to this:
Image

On an unrelated note - why are you using one object Console_Gear with 4 completely different animations? And why do you distinguish them by animation name (which, by the way, requires special plugin)? This is so weird..

Wouldn't it be easier to have different objects - Console_Body, Console_Gear_Inner, Console_Gear_Outer, Console_Arrow? Or at least use instance variables?
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
66
Posts: 1,010
Reputation: 36,081

Post » Sat Sep 09, 2017 5:05 pm

It would be too many objects in the project so I decided to use animations instead of it.

Ok, I'm going to check that code and will fix it asap. And that special plugin you mean what exactly? We use one behavior - AnimationList but only for the planets in the game. I already have a lot of plugins and behaviors in my C2 so I'm not sure what you are talking about exactly. But thank you so much!
SoftWork Group Ltd

Co-founders:
Robert Matik (UK Division)
Lukas Zyrek (CZ Division)

07399443703 (UK Division)

International(at)softworkgroup.wtf - for basic questions and information
Office(at)softworkgroup.wtf - email for questions about team and proposals
B
16
S
5
G
1
Posts: 49
Reputation: 1,656

Post » Sat Sep 09, 2017 5:13 pm

Well. I changed the code as you showed me here and it didn't worked as it should. :/ Weird. I also added few sprites to each layer for check. Nothing.
SoftWork Group Ltd

Co-founders:
Robert Matik (UK Division)
Lukas Zyrek (CZ Division)

07399443703 (UK Division)

International(at)softworkgroup.wtf - for basic questions and information
Office(at)softworkgroup.wtf - email for questions about team and proposals
B
16
S
5
G
1
Posts: 49
Reputation: 1,656

Post » Sat Sep 09, 2017 5:21 pm

Yes, I meant that AnimationList behavior, I had to install it to be able to open your project. But I was wrong, it's not required to test which animation is playing.

Anyway, you shouldn't worry about having too many objects. I would definitely make your Console with 4 separate objects and maybe combine them into family. This should make many things easier and you wouldn't have this issue with overlapping.

SputnikCZ wrote:Well. I changed the code as you showed me here and it didn't worked as it should. :/ Weird. I also added few sprites to each layer for check. Nothing.


Could you share your new file? And I'm guessing last time when you prepared the CAPX, you removed the code where you pin squares to gears. Don't remove it this time, so I could test properly :)
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
66
Posts: 1,010
Reputation: 36,081

Post » Sat Sep 09, 2017 5:38 pm

Sorry buddy. :D My fault :D Too much things to do here and I'm losing time :D Will do. ;) Few mins and it's here
SoftWork Group Ltd

Co-founders:
Robert Matik (UK Division)
Lukas Zyrek (CZ Division)

07399443703 (UK Division)

International(at)softworkgroup.wtf - for basic questions and information
Office(at)softworkgroup.wtf - email for questions about team and proposals
B
16
S
5
G
1
Posts: 49
Reputation: 1,656

Next

Return to How do I....?

Who is online

Users browsing this forum: dop2000, Maako and 5 guests