Collisions Acting Wonky

Get help using Construct 2

Post » Mon Oct 27, 2014 8:34 am

So I'm moving ahead with my game slowly, but there are a few things with the collisions that I can't figure out.

1) When the spikes are down the player can walk across them without dying.
2) Top left crate: If the player touches the crate on the sides the crate 'destroys'. It should only destroy when the player touches the top of it. Right now the player has to jump on it 2-3 times to destroy it. That I don't really mind.

I've tried increasing/decreasing the collision boxes on player/spikes/box but it's still the same result. I don't know if it's that or something in my events.

If someone could take a look and let me know what I'm doing wrong, it would greatly appreciated.

https://www.dropbox.com/s/tnjoq3h7qobavl6/Game_00.capx?dl=0
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Mon Oct 27, 2014 11:42 am

You need to use the PlayerBox sprite on your conditions instead of the actual player.
And for the box, add the platformer condition: is falling.
B
75
S
29
G
17
Posts: 256
Reputation: 15,250

Post » Mon Oct 27, 2014 3:21 pm

jeffige will this do try it and see. Let me know
You do not have the required permissions to view the files attached to this post.
B
252
S
39
G
15
Posts: 1,964
Reputation: 40,753

Post » Mon Oct 27, 2014 6:27 pm

Xavier wrote:You need to use the PlayerBox sprite on your conditions instead of the actual player.
And for the box, add the platformer condition: is falling.


When you say "conditions" is that under EVENT or ACTION? Sorry for the noob question, i've had C2 for over a year but still learning.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Mon Oct 27, 2014 6:51 pm

An event is formed by conditions (left side) and actions (right side).
I've changed it for you so you can see for yourself. Also the "is falling" condition I mentioned before wasn't working properly and I've changed that to compare Y between the objects, so it will only destroy the box when you are top of it.
You do not have the required permissions to view the files attached to this post.
B
75
S
29
G
17
Posts: 256
Reputation: 15,250

Post » Mon Oct 27, 2014 7:04 pm

Xavier wrote:An event is formed by conditions (left side) and actions (right side).
I've changed it for you so you can see for yourself. Also the "is falling" condition I mentioned before wasn't working properly and I've changed that to compare Y between the objects, so it will only destroy the box when you are top of it.


Aha, Ok i see now. So the 'PlayerBox' is the object actually affected by collisions...etc... and the 'Player' is actually the 'VISUAL' of what happens to the PlayerBox?

Also, thank you for the Y<sprite.Y I would have never figured that out. Most of the expressions i see in posts go over my head. I think some folks assume everyone has a higher knowledge of C2.

Again, thank you so much.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Mon Oct 27, 2014 7:47 pm

jeffige wrote:Aha, Ok i see now. So the 'PlayerBox' is the object actually affected by collisions...etc... and the 'Player' is actually the 'VISUAL' of what happens to the PlayerBox?


Both are affected by collisions.

The reason it didn't work before was because the spikes have the "solid" behavior: https://www.scirra.com/manual/104/solid

And the solid behavior was reacting to the Platform behavior from the PlayerBox object, so the collision with the player object wasn't activating properly. It would also have worked if in the editor you changed the Player position 1 pixel below the PlayerBox. That way, the player object would have collided with the spikes first, but since both objects are on the same Y position, it wasn't working properly.
B
75
S
29
G
17
Posts: 256
Reputation: 15,250


Return to How do I....?

Who is online

Users browsing this forum: Euduardo, tinhofiel, TRMG, Yahoo [Bot] and 31 guests