Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

In my experiences, the easiest way to handle jumpthroughs is something like this:

  • If you're moving upwards (yspeed < 0), do nothing
  • Else, if current position is colliding with a jumpthrough, do nothing, because this means we're currently falling through one we didn't land on
  • Else, treat them as normal solid platforms and return true if the to-be-checked point is a jumpthrough.

checking the calling instance's current position doesn't quite belong in a general-purpose function like pixel_vacant so perhaps doing the check in-instance and then supplying a "check_jumpthroughs" argument to pixel_vacant would be cleaner - this argument would be set to !place_meeting(x,y,parent_jumpthroughterrain) && (yspeed >= 0)


The drawback with this approach is that you need a player-sized berth around jumpthroughs and can't stack them directly on top of each other vertically, but since they usually have pretty thin hitboxes to begin with (only the top) it's not usually an issue.


Oh, and if you want to be able to fall through jumpthrough platforms, you need to check if you're standing on one and pressing down+jump, if true, move the player down enough pixels that they're now colliding with the jumpthrough (at least 2 to account for rounding errors when checking the pixel directly below the player for ground) and now they should ignore the jumpthrough they're currently standing on.