Hi I am making a 2d scrolling beat em up, I am working on the collision with obstacles like drums and platforms.
So far I have the player jumping and falling from platforms but having problem stopping the player when colliding with the left and right side of the platform.
For each player you can assign a bounding box (rect) around player which I use to do the collision. The bounding box position is updated that of the player.
At the moment when I do the collision it always moves the player too far when hitting the platform from the right side. Now when my player looks left I have to offset the bounding box more to the left as the player sprite is mirrored left, which I think where the problem resides.
Also issue happens with obstacles with same width.
I was wondering if anyone can look at my code (full source: https://github.com/lodossDev/gameengine), please don't laugh :(. The main part to look at is the CollisionManager.cs and its checkbounds method lines 220-228.
Project is done in mono game. To control player user arrow keys, space bar = jump, a = attack, k = drum3 move left, l = drum3 move right