Vertical Sliding Platforms… Arrrggghh!

You know when feel so close to finishing something, so close to rolling through those final steps to completion? But there’s one thing that’s just stopping you from making that final sprint. Every day it holds you back it adds another day on the end.

That’s where I’m at right now!

After a really good week of biz dev and getting g a lot of things in place to ensure a smooth run to the finish line, I started this week with a plan of what was left to do. There’s a decent amount but none of it tricky. And then I had a realisation of something that was missing from the game that I think it really needs. Something that I think would be noticed if it wasn’t in the final product. Sliding platforms.

So I’ve got moving enemies, collision detection and standard platforms implemented. It should be too hard right?

I start making the horizontal platforms and after about an hour I’ve got the basic functionality working. Cool. I start adding in the behaviour for what happens when the player gets stuck between the unstoppable force and the immovable object. A bit tricky but nothing too difficult.

So I move on to vertical platforms. Should be pretty similar right? Turns out not. It’s completely different stopping a character in the vertical plane and moving them in the horizontal plane compared to stopping them in the vertical plane, against an object that is moving towards them and then moving them in the vertical plane in the same direction as the moving object without some funny behaviour.

First of all the character was falling through the platform regardless of using the same collision mechanics as everything else. I realised gravity kept on being reinitiated when I thought it wasn’t.

I then ended up with the player getting stuck in the platform. I realised that the character and platform moving towards each other there wasn’t enough space to detect the collision. So I added a buffer.

Now the character looks like they’re hovering above the platform. So I decided to directly change the characters location in sync with the platform.

Cool, the character now sits and moves on the platform nicely. Going up…

Going down the character drops every step and to add to that when the character is below the platform they teleport to the top!! What the!?

So basically I’ve been working on this for three days now. Not too long really to solve a tricky coding issue but a real pain in the butt when you’re counting down your days to release. I truly think it’s going to be a simple fix but Ithink I’m starting to get in that head space where my judgement is clouding. So I’m going to hammer it out tonight and if I don’t figure out a solution I might need a rethink.

To be continued…

Sign up free for the latest game dev tips and free beta test acces to all our games! Guaranteed no spam!

Scroll to Top