Collisions Acting Wonky

0 favourites
  • 7 posts
  • 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

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • jeffige will this do try it and see. Let me know

  • 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.

  • 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.

  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)