Jump to content

Construct2: Different collision box for jumping, stopping and hit the enemy

Recommended Posts

Construct2: Different collision box for jumping, stopping and hit the enemy

When my character jumps, I would like the platform behavior collisions take into account the actual position of the feet.

As can be seen in the animation, the collision zone (purple colored) corresponds to the position of walking. I want to match any time zone taken into account by the platform behavior when landing with the area of the feet and the body itself.

The brown zone corresponding to the sprite collision itself and not in the collision zone.

I tried to place a different animation when jumping and then a different collision zone but it does not work well.

An idea ?

thank you in advance


Translated by Google translation ^^



Link to post
Share on other sites

OK. I though it may be C2 but the Tag info is not easily visible for posts, so I suggest you put it in the title and body text from now on.

In general it's a bad idea to change or animate the shape or size of a collision rectangle for platformers on the fly, (regardless of authoring system) as it's highly likely to create strange and erratic behavior as suddenly the player is partially inside a wall, floor etc or vice versa based entirely on a sudden shift in the collision rectangle shape.

I recommend you just tweak your jumping animation so that the upper body and head go down a bit as the legs and feet go upward a bit... but favoring the feet going upward.  Every game engine I've ever seen, made, or partook in making had a consistent collision rectangle for the player throughout walking, jumping and falling.

If you're worried about having more realism than all Mario , Castlevania, Megaman games ect in the feet collisions while jumping, then I suggest you program in a ledge grab and pull up animation, as otherwise if your player character made it onto the higher platform in your GIF they would trip and fall or take a long time to get to a standing position. (because their feet are near their chest and their legs compressed...they'd be fighting gravity and their own compromised posture).

In other words, I think you might be worrying about a problem that only exists because you're making it exist. I suggest you just play test all your favorite platformers and you'll see their jumping behavior is exactly like in your embedded GIF above. They just carefully designed the art, platform height, and character jump strengths to all work well together.



Link to post
Share on other sites

I was wondering about 2 things.

First, did you save the background layer for your Sprite? That makes a block instead of just the sprite. I usually delete that layer when I don't need it anymore.

My other concern is for when you are in Construct2. In the animations block (I think) , when you set the origin, did you try to set it for the bottom right? I am not sure if that will work if you use it for both directions.

 Just thoughts as I haven't been over there for over a week.


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...