GithubHelp home page GithubHelp logo

jojomickymack / box2d_tiledmap Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 2.97 MB

this is an example that uses box2d as a physics engine and a tiled map with collision detection on polylines

Kotlin 100.00%

box2d_tiledmap's Introduction

LibGdx/Ktx Example Using Box2d and Tile Map Polyline Collision

box2d example

This example loads a tiled map which contains some object layers (floors, walls, shapes) that are made of polygon and polylines objects. The objects are converted into box2d shapes.

Box2d can easily render the shapes in the world by calling debugRender, and the box2d map can be rendered just by calling render(). These end up sharing the same coordinate system because they share the same camera.

The 'player' is just a dynamic body in the world whose linearVelocity is bound to key input. On mobile, the left and right sides of the screen act as a controller (this is taken from the superkoalio example).

If you are trying to get arcade style physics for a 2d platformer game, you probably don't want to use box2d. I read an article at some point that explained how box2d is 'too realistic' for those types of games, and I agree. If you want to knock things over and see them scatter realistically, box2d is perfect - if you want to have precise control over a characteer jumping around and stopping when touching a wall, you're not going to like box2d.

box2d_tiledmap's People

Contributors

jojomickymack avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

jmpala

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.