Skip to main content
replaced http://gamedev.stackexchange.com/ with https://gamedev.stackexchange.com/
Source Link

You can use a raycasting (or linecasting) based collision detection system. At a very high level, you cast rays from your player (preferably from the edges of it's collider box) into the game map. When the ray hits something, you can check to see what its hit, and if it's a collidable surface, resolve the collision and adjust player movement as appropriate. This method is pretty agnostic to how your game map is built (tilemap, models, geometric shapes, etc).

For more technical details, you can view my own questionquestion on a similar topic. While the code presented is C# (and for Unity), you could easily adapt it for any language.

Here's an image to help visualize the system

Source: Yoann Pignole

Some resources:

You can use a raycasting (or linecasting) based collision detection system. At a very high level, you cast rays from your player (preferably from the edges of it's collider box) into the game map. When the ray hits something, you can check to see what its hit, and if it's a collidable surface, resolve the collision and adjust player movement as appropriate. This method is pretty agnostic to how your game map is built (tilemap, models, geometric shapes, etc).

For more technical details, you can view my own question on a similar topic. While the code presented is C# (and for Unity), you could easily adapt it for any language.

Here's an image to help visualize the system

Source: Yoann Pignole

Some resources:

You can use a raycasting (or linecasting) based collision detection system. At a very high level, you cast rays from your player (preferably from the edges of it's collider box) into the game map. When the ray hits something, you can check to see what its hit, and if it's a collidable surface, resolve the collision and adjust player movement as appropriate. This method is pretty agnostic to how your game map is built (tilemap, models, geometric shapes, etc).

For more technical details, you can view my own question on a similar topic. While the code presented is C# (and for Unity), you could easily adapt it for any language.

Here's an image to help visualize the system

Source: Yoann Pignole

Some resources:

added 104 characters in body
Source Link
General Waters
  • 1.6k
  • 2
  • 21
  • 30

You can use a raycasting (or linecasting) based collision detection system. At a very high level, you cast rays from your player (preferably from the edges of it's collider box) into the game map. When the ray hits something, you can check to see what its hit, and if it's a collidable surface, resolve the collision and adjust player movement as appropriate. This method is pretty agnostic to how your game map is built (tilemap, models, geometric shapes, etc).

For more technical details, you can view my own question on a similar topic. While the code presented is C# (and for Unity), you could easily adapt it for any language.

Here's an image to help visualize the system

Source: Yoann Pignole

Some resources:

You can use a raycasting (or linecasting) based collision detection system. At a very high level, you cast rays from your player (preferably from the edges of it's collider box) into the game map. When the ray hits something, you can check to see what its hit, and if it's a collidable surface, resolve the collision and adjust player movement as appropriate.

For more technical details, you can view my own question on a similar topic. While the code presented is C# (and for Unity), you could easily adapt it for any language.

Here's an image to help visualize the system

Source: Yoann Pignole

Some resources:

You can use a raycasting (or linecasting) based collision detection system. At a very high level, you cast rays from your player (preferably from the edges of it's collider box) into the game map. When the ray hits something, you can check to see what its hit, and if it's a collidable surface, resolve the collision and adjust player movement as appropriate. This method is pretty agnostic to how your game map is built (tilemap, models, geometric shapes, etc).

For more technical details, you can view my own question on a similar topic. While the code presented is C# (and for Unity), you could easily adapt it for any language.

Here's an image to help visualize the system

Source: Yoann Pignole

Some resources:

Source Link
General Waters
  • 1.6k
  • 2
  • 21
  • 30

You can use a raycasting (or linecasting) based collision detection system. At a very high level, you cast rays from your player (preferably from the edges of it's collider box) into the game map. When the ray hits something, you can check to see what its hit, and if it's a collidable surface, resolve the collision and adjust player movement as appropriate.

For more technical details, you can view my own question on a similar topic. While the code presented is C# (and for Unity), you could easily adapt it for any language.

Here's an image to help visualize the system

Source: Yoann Pignole

Some resources: