ScrollY and collisions

Get help using Construct 2

Post » Tue Jul 24, 2012 2:10 pm

In an attempt to optimize my game, I decided to scroll an entire layer (setting the other layers parallax to 0) which contains sprite that moves in sync. The problem is that while touch still works, every collision with object that are on the other layers doesn't get detected.

I imagine has something to do with the coordinates that are now desynced, is there any way to fix this?

Thanks
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Tue Jul 24, 2012 4:24 pm

Bump please, I'm really lost here.
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Tue Jul 24, 2012 4:27 pm

Maybe have a look at this thread, and this manual entry?
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu Jul 26, 2012 9:10 am

Thanks @Nimtrix.
I understood the issue, but I'm stuck at making it work right.
Here is a capx with the exact same logic as my game: https://dl.dropbox.com/u/1606950/helpme.capx .

What I need is to check if the cloud is colliding with the blue bar and destroy ONLY the one which is colliding, not all of them like now. The problem is that I don't know how to pick that correct instance.
If there is another solution it's more than welcome, I need the scrolly because it increases performance tenfold on mobile.

Thanks to everybody that could help me.
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Thu Jul 26, 2012 2:01 pm

The way I'd work around this is to create a hidden copy of the hitbox on layer 1 and use that for collisions. Like this: parallaxCollisions.capx (r99)
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Thu Jul 26, 2012 3:33 pm

@ramones, thanks that seems like a nice solution.
B
29
S
9
G
6
Posts: 525
Reputation: 8,294


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 0 guests