Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

game world boundary, pixel-to-meter mapping #5

Open
thoraxe opened this issue Jan 15, 2021 · 0 comments
Open

game world boundary, pixel-to-meter mapping #5

thoraxe opened this issue Jan 15, 2021 · 0 comments

Comments

@thoraxe
Copy link
Contributor

thoraxe commented Jan 15, 2021

Box2D worlds have no boundaries, but we need a boundary for the area of play. For now, the simplest thing to do is:

  1. decide on a size of the play area in meters/kms/whatevers
  2. figure out a mapping of the size of the play area to the pixels of the client "screen"
  3. create a physical box2d boundary at the edges of the play area
  4. make players bounce off the boundary

See https://stackoverflow.com/questions/8020093/box2d-world-size for creating boundaries on the play area

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant