Newbie Collision Detection question
Posted: Fri Jan 24, 2014 2:12 am
Hi,
I read up on all the collision detection questions that have been previously posted. None of them addresses my issue, and a lot of the code samples supplied to solve issues are more complicated than I understand.
I am working on an a simple 2D shooter game, set up sort of Mario style. My character has an issue that I cannot resolve, and I was hoping one of you might have a tidbit stuck somewhere in those brilliant heads of yours that could help me out.
The basic issue is collision detection. Everything in my game works except this one thing, and I cannot figure it out. I think I need an function to override the player/tiles collision, but everything I try does not work. The player is bleeding into the next tile and then auto-jumping on top of it, instead of stopping because the tile is blocking its path. The above image shows two tiles, and a player. The player is moving in the direction of the arrow. When the back side of the players personal space reaches the front of tile 1, the player jumps up on to tile two automatically.
Or...... If there is no tile two, the player will bleed ¾ into tile 1 then jump up on to tile 1.
In both cases, the player should dead STOP at before passing tile 1 and be unable to proceed unless the jump button is tapped. Can you help me with a simple function that will resolve this issue?
Thank you.
CO
I read up on all the collision detection questions that have been previously posted. None of them addresses my issue, and a lot of the code samples supplied to solve issues are more complicated than I understand.
I am working on an a simple 2D shooter game, set up sort of Mario style. My character has an issue that I cannot resolve, and I was hoping one of you might have a tidbit stuck somewhere in those brilliant heads of yours that could help me out.
The basic issue is collision detection. Everything in my game works except this one thing, and I cannot figure it out. I think I need an function to override the player/tiles collision, but everything I try does not work. The player is bleeding into the next tile and then auto-jumping on top of it, instead of stopping because the tile is blocking its path. The above image shows two tiles, and a player. The player is moving in the direction of the arrow. When the back side of the players personal space reaches the front of tile 1, the player jumps up on to tile two automatically.
Or...... If there is no tile two, the player will bleed ¾ into tile 1 then jump up on to tile 1.
In both cases, the player should dead STOP at before passing tile 1 and be unable to proceed unless the jump button is tapped. Can you help me with a simple function that will resolve this issue?
Thank you.
CO