Closed ItsStolas closed 6 years ago
I think this could also be optimized by only checking for SOLID objects. If an object isn't solid, don't even bother trying to see if we're colliding. In its current state, it checks if we're colliding with every single object.
I'm sure we can later on further improve this by checking only close-by objects etc.
Stewarts is much better than this, going to close this.
Re-opening because after testing Stewarts, this is more fluid.
Hey guys, Sorry I've been gone so long.
I implemented proper collision. So now when we move we first move the collision box for the player to the new position and check if it collides with anything. If it does collide with something we will not move the player.
There are obvious flaws in this, using the players collision box is TEMPORARY, because if we move this box AI will have trouble checking if they're colliding with the player. I suggest maybe we make an entirely new collision box to check for collisions when moving, unless someone else have a better idea?