0 Favourites

How do I Fall between blocks

  • Unnatural20

    It's still not as good as coming to a full stop due to the gap and falling down it. Rojohound's .capx was the closest to get there, but even it has its problems (mostly corners and if the tilemap is 8x8, the dummy wall needed to be 8x8 which doesn't stop the player.

    The best possible thing would be if someone took the platformer behaviour and modified it to exclude the autoclimb slope detection, or at least make an option to disable it.

  • I had to hard-code this in my old metroid engine. If I remember correctly, I had a variable that was set to 0.1 when Samus walked off a ledge, and it was subtracted by dt. If this var was > 0 and Samus overlapped a wall at an offset of ~(4,8) in the direction she was facing, I would push her down a pixel or two, set her y velocity to ~100, then reset the var to 0.

    Was pretty stupid but it worked...

    edit: Just checked out R0j0's .capx...That's probably your best bet.

  • I had to hard-code this in my old metroid engine. If I remember correctly, I had a variable that was set to 0.1 when Samus walked off a ledge, and it was subtracted by dt. If this var was > 0 and Samus overlapped a wall at an offset of ~(4,8) in the direction she was facing, I would push her down a pixel or two, set her y velocity to ~100, then reset the var to 0.

    Was pretty stupid but it worked...

    edit: Just checked out R0j0's .capx...That's probably your best bet.

    Speaking of your old Metroid engine, I never got to see it.

    So the events went like what,

    Variable > (Greater than) 0

    Samus is overlapping wall at offset x,x | Move Samus X Down

    ...................................................................| Set Y Velocity to 100

    ...................................................................|Set Y Velocity to 0

    Something like that? I have trouble making events out of descriptions, kind of a visual learner over textbooks.

  • Nesteris - here's how I solved this, where the player sprite is my invisible player object:

    player.platform is moving & player.platform is not on floor & trigger once

    -player set platform vector x to 0

    -player set platform vector y to (whatever your default fall speed is)

  • Nesteris - you probably want to use delta time, too, and a lerp, just to keep the falling from feeling really fast... so here's what I did:

    lerp(self.platform.Gravity/2, self.platform.Gravity, dt)

  • mudmask

    You genius! I love you!

    Had to tweak it a bit so it doesn't activate when I jump, my only problem now is that the events activate when I walk off a ledge.

    Any suggestions?

  • mudmask

    Made it work great with ledges, made an event prior to it and set your stuff as a sub-event.

    The event was basically checking that the player is overlapping with the tilemap on both sides to make sure it's a gap and not a ledge.

  • Nesteris - haha not yet... but you could probably use an offset collision so it happens ONLY when you run into a gap. So like, if you're going right...

    if collision at offset, player.width, tile.height(or something)

    I don't know if I noticed anything happen when I jumped though... I'll have to recheck that.

  • Nesteris - oh man, looks like you did what I just mentioned in my last post before I could hit submit. awesome. I'll drop that into my engine right now...

  • mudmask

    Hehe, well I'm not completely useless. I just have trouble coming up with solutions since I'm still fairly new to the engine, so my code is fairly basic but very easy to read. Btw I'm still up for the swap if you're interested, could add each other on facebook or skype if you want.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I made a custom engine using loops, it seems to be performing great with no glitches. It may or may not be a good solution for your problem

    https://www.scirra.com/forum/solved-retro-pixel-quantized-platform-engine-using-loops_t129733?start=10

  • I made a custom engine using loops, it seems to be performing great with no glitches. It may or may not be a good solution for your problem

    https://www.scirra.com/forum/solved-retro-pixel-quantized-platform-engine-using-loops_t129733?start=10

    I solved it by adding in an event that checks if the player is overlapping the tilemap at two offsets (left and right) and is not on the floor, if this proves true then the player falls down.

    I swear to god though, I was looking at your thread last night

    You should make a Behaviour similar to Platformer that eliminates the slope detection.

  • oh cool! Would you mind sharing your solution as a .capx ? I'd really like to see it!

  • No real need for a .capx

    You can replace "Tilemap" with anything you use to make the gaps.

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