• Create Account

### #Actualstoffe1100

Posted 02 June 2012 - 08:39 AM

What do you mean by strange? What are the exact problems you are facing?

Tile collision is pretty easy. Usually you have a 2d array representing the map, checking for collison simply invovlves getting the player position in the tile map
and indexing the array to check if this tile is passable.

Your code looks a bit overly complicated. Why do you have a for loop when checking for collisions?

Actually my map is stored in a 2 dimensional vector called map.

For the moment it works pretty well when colliding Up, Down and left. But i only get slowed when i collide from the right side. And if i push towards a wall i get pushed to the top of the wall without pressing up key. And sometimes i just fall under the whole map when colliding.

What i am really looking for is like a whole new structure for how my collsion should look like. I dont understand why it is over complicated? please tell me and i will try to explain.

Also when im colliding my ball is bouncing very quickly. Which it shouldnt because everything should be calculated and set back within one frame!

Ive been playing around with some stuffs and i updated the player::move() function. When it is like this the collision in the Y axis is working great. but the X axis collisions are super weird.

Please help me, i have no clue on how to continue. I cant stop thinking of those problems. its really anoying

### #2stoffe1100

Posted 02 June 2012 - 08:26 AM

What do you mean by strange? What are the exact problems you are facing?

Tile collision is pretty easy. Usually you have a 2d array representing the map, checking for collison simply invovlves getting the player position in the tile map
and indexing the array to check if this tile is passable.

Your code looks a bit overly complicated. Why do you have a for loop when checking for collisions?

Actually my map is stored in a 2 dimensional vector called map.

For the moment it works pretty well when colliding Up, Down and left. But i only get slowed when i collide from the right side. And if i push towards a wall i get pushed to the top of the wall without pressing up key. And sometimes i just fall under the whole map when colliding.

What i am really looking for is like a whole new structure for how my collsion should look like. I dont understand why it is over complicated? please tell me and i will try to explain.

Also when im colliding my ball is bouncing very quickly. Which it shouldnt because everything should be calculated and set back within one frame!

### #1stoffe1100

Posted 02 June 2012 - 08:21 AM

What do you mean by strange? What are the exact problems you are facing?

Tile collision is pretty easy. Usually you have a 2d array representing the map, checking for collison simply invovlves getting the player position in the tile map
and indexing the array to check if this tile is passable.

Your code looks a bit overly complicated. Why do you have a for loop when checking for collisions?

Actually my map is stored in a 2 dimensional vector called map.

For the moment it works pretty well when colliding Up, Down and left. But i only get slowed when i collide from the right side. And if i push towards a wall i get pushed to the top of the wall without pressing up key. And sometimes i just fall under the whole map when colliding.

What i am really looking for is like a whole new structure for how my collsion should look like. I dont understand why it is over complicated? please tell me and i will try to explain.

PARTNERS