Search Instagram Twitter Facebook Spotify Grid Tag Date Folder Chat Pencil

Development Update – Box Falling

Continuing to work on box acceleration.

Started off the day with some weird bugs I wanted to fix.

This is one of them: for some reason, after you release a box, it would fall slightly faster than the player, eventually passing the player.

It’s not really a game breaker, but it’s kind of weird and inconsistent. Also, it means player only has a small window of time to catch the box again, otherwise it falls out of reach.

The problem was that even though I had set a terminal velocity on the box, I didn’t set a terminal acceleration. So it was reaching a slightly faster speed earlier than the player. I fixed this by assigning both player and the box a terminal acceleration, which, when reached, both will stop accelerating.

Also, notice how the box flies upwards after it’s released. The reason why this was happening is because when the box is given the position from the last frame, when released. This was a pretty simple fix. I just had to move the segment of code where the position of the box is assigned to after where the new position is calculated and updated.

There was also another problem:

I can’r really remember how I fixed this, as I was trying a bunch of different things and eventually it stopped happening. I believe it’s because of an issue with layers. I had to make the box ignore certain layers, otherwise it kept mistaking some invisible triggers as the floor which was screwing it up.

Anyway, it’s fixed now, and you can fall with a box, release it, and catch it again, and it falls at the same speed. Also notice that when released, it stays in the location relative to the player where it’s release at:

This means that you can release a box, move away, then move back close, and catch it again, which is really cool. This actually opens up a lot of game mechanic possibilities. Like imagine trying to construct something while in free fall, having to fly around and pick up objects and bring them to one another. I’d probably need a way to speed up and slow down fall speed though…

Anyway, it also opens up a ninja move, where you release the box while in free fall, and then use that box as a surface on which to rotate and change gravity:

Could probably be used for some crazy speedruns.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.