Quantum Collision Issues Followup
So, remember those quantum collision issues I had recently? I managed to somehow fix them _without_ hiring an exorcist. For those interested, the problem was in the order and way collisions were handled.
All objects that collide with blocks and other solid entities are stored in a list. The collision check simply goes down that list and checks if an object is colliding with the block. So far so good. However, after some testing I found that if an object is colliding with a block, the collision for the next objects in the list won't be handled; simply put, only one object was able to properly collide with a block, and whatever object came first in the list got the honor of getting proper collision detection.
This also explains this mysterious .gif:
The barrel I'm throwing on the block is higher in the list than the left barrel, so the moment the thrown barrel collides with the block, the left barrel's collision isn't handled any more and it drops to the ground. And no, I'm not sure how I've never stumbled upon that during testing until recently.
So, what caused this behavior? To be honest I don't know. I was using HaxeFlixel's built-in `collide()`function which checks for a collision and then separates the two objects if necessary, but as you can see it didn't seem to detect multiple collisions in this case. Once I simply replaced the function with my own (which forced the separation without checking first) everything worked as intended.
I might dig deeper into the HF codebase to try and figure out what exactly happened, as I'm pretty sure I just did something wrong. But at least I managed to fix it for now...
Get [Speer]
[Speer]
Use your Speer as a platform!
Status | Released |
Author | and0 |
Genre | Platformer |
Tags | 2D, 8-Bit, Colorful, Difficult, Minimalist, one-hit-kill, portal, Puzzle-Platformer |
More posts
- Update 1.1.1: Disabling the GamepadJan 19, 2018
- Update 1.1.0: Key Config and Mac Builds!Jan 17, 2018
- Update 1.0.6 is Live!Jan 13, 2018
- Updates and BitsDec 23, 2017
- [Speer] RELEASED!Dec 20, 2017
- Tools (Part 2) - Level CreationDec 09, 2017
- Preview Build Now Available for Linux!Dec 06, 2017
- Preview Build UPDATENov 24, 2017
- Preview Build Released!Nov 21, 2017
Leave a comment
Log in with itch.io to leave a comment.