Why are enemies falling through a jump through platform?

From the Asset Store
Template for an alternative to falling shapes, fully documented in comments and video
  • A student in my games class is implementing a basic platform game following the same basic guidelines that are at the core of the official C3 tutorial for this type of game. (The only difference is that we're using sprites to create the environment rather than using tile maps for the environment.)

    Enemy movement is handled by simulating platform controls and using collision with an invisible barrier to reverse the direction.

    This is mostly working but the enemy is falling through the island when it reverses direction. Everything is fine when we make the terrain 'solid' instead of 'jump-through,' but we want to have jump through functionality.

    The link to her C3P is:

    trinitycommdepartment.com/~adelwich/temp/falling-through-jumpthru.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I cannot access the link (403 forbidden)

    Generally there is some weirdness with jump-through that´s been going on for a while with a variety of quirks. Possibly the hitbox of the enemy changes enough when mirroring that the engine thinks it´s not on the platform anymore. Maybe the platform itself has the hitbox off in some way. Sometimes you can work around such things but it´s hard to say without the file.

  • Thanks, wackyToaster! I just fixed the permissions issue on that file so you should now be able to view it.

  • I´ve looked at it and yes, it´s a shifting collision polygon. It´s the animation that causes one part of the enemy to poke below the platform and the engine thinks it dropped through. A simple fix is to set it at least semi-consistent by making it look like this and use "apply to whole animation"

    The same goes for the player btw. but he seems fine, probably just by chance. Ideally you would want to use an invisible sprite for the hitbox that is consistent and have the visible sprite pinned to it.

  • Ah! Fantastic. We're using an invisible sprite to handle collisions with player, so it's easy enough to do the same thing with the enemies. Thank you!

  • Hey Wacky Toaster -- Quick question: Using an invisible sprite to handle collisions for the player object is pretty easy to implement with an 'every tick' event. It's more complicated when we have multiple instances of an enemy object. What would you recommend as a strategy for keeping the collision box instance tethered to the enemy sprite instance? Should we use containers?

  • There´s the new scene graph feature that should work great for this. Containers + pinning works aswell but I think scene graph is the way to go. construct.net/en/make-games/manuals/construct-3/behavior-reference/pin

    Select both the invisible sprite and the enemy sprite and right click to get the option. You can also do this via events. Check out the example projects in construct.

  • Thanks! I've been away from C3 for the past eighteen months and am excited about digging into this new functionality.

  • 18 months? You missed quite a bunch of new stuff!

  • I know! I'm a college professor who teaches on other topics as well, so most of my time is focused on other things. About once a year -- or once every 18 months -- I get the opportunity to immerse myself in C3 for the games class. It's always impressive to see how many new features have been rolled out during my absence from the community.

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