Skip to main content
Tweeted twitter.com/#!/StackGameDev/status/288767595035906048
Changed title to better reflect question being asked, some clean up.
Source Link
House
  • 73.3k
  • 17
  • 185
  • 273

What is the appropriate way to enforce the bounds ofimplement collision in 2D mapsworlds?

Perhaps not the best way to phrase the question, but very easy for me to explain.

ifIf I want to create a 2D game map which features areas traversable by a player through standard up/down/left/right inputs, and then have areas that are NOT traversable... perhaps just a bush, or a sign post, or a rock..

whatWhat is the appropriate agent to enforce these rules?

It seems like the trendy thing is to ship off these responsibilities to Box2D..., but that seems wrong to me. Is there a technique with lower overhead to produce the same effect... is? Is it as simple as simply inventorying and enumerating through every rock and making sure the player can or cannot walk to the space they are trying to walk to? That's how I am doing it now.

What is the appropriate way to enforce the bounds of 2D maps

Perhaps not the best way to phrase the question, but very easy for me to explain.

if I want to create a 2D game map which features areas traversable by a player through standard up/down/left/right inputs, and then have areas that are NOT traversable... perhaps just a bush, or a sign post, or a rock..

what is the appropriate agent to enforce these rules?

It seems like the trendy thing is to ship off these responsibilities to Box2D... but that seems wrong to me. Is there a technique with lower overhead to produce the same effect... is it as simple as simply inventorying and enumerating through every rock and making sure the player can or cannot walk to the space they are trying to walk to? That's how I am doing it now.

What is the appropriate way to implement collision in 2D worlds?

If I want to create a 2D game map which features areas traversable by a player through standard up/down/left/right inputs, and then have areas that are NOT traversable... perhaps just a bush, or a sign post, or a rock.

What is the appropriate agent to enforce these rules?

It seems like the trendy thing is to ship off these responsibilities to Box2D, but that seems wrong to me. Is there a technique with lower overhead to produce the same effect? Is it as simple as inventorying and enumerating through every rock and making sure the player can or cannot walk to the space they are trying to walk to? That's how I am doing it now.

Source Link

What is the appropriate way to enforce the bounds of 2D maps

Perhaps not the best way to phrase the question, but very easy for me to explain.

if I want to create a 2D game map which features areas traversable by a player through standard up/down/left/right inputs, and then have areas that are NOT traversable... perhaps just a bush, or a sign post, or a rock..

what is the appropriate agent to enforce these rules?

It seems like the trendy thing is to ship off these responsibilities to Box2D... but that seems wrong to me. Is there a technique with lower overhead to produce the same effect... is it as simple as simply inventorying and enumerating through every rock and making sure the player can or cannot walk to the space they are trying to walk to? That's how I am doing it now.