I already got the bodyeditor for libgdx, and I'm experimenting with the following code, but honestly I have no clue of how I should handle this. The sharks width and height are variable, but maintain the same ratio's. SharkAnimation is a TextureRegion, and shark is an object with an X, Y, width and height. Game-development for browsers : HTML5/js Frameworks: Pixi js, Phaser Environment : Typescript/Git/Webpack Tools: Texturepacker, PhysicsEditor, visual code. It doesnt seem to be a complete level design. Physics Body Editor : Here is also an interesting free tool to create box 2d shapes that even come with a loader for libgdx. Shark.getY(), shark.getWidth(), shark.getHeight()) So id recommend to test the trial and see if you can easily use the output for your libgdx game. Right now, I am drawing my shark like this in my render method: batcher.draw(sharkAnimation, shark.getX(), This example application demonstrates how you can use physics bodies defined with PhysicsEditor with the Box2D physics engine of LibGDX. This is a complete sample project using PhysicsEditor to create physics shapes for. The tutorial on the phycics body editor website uses a different approach than I do. How to get position of every fixture of one body in Libgdx Box2d. I already have the code for the image drawing of the sharks and other stuff, but now I have no clue of how to implement the detection of collission with the json file. As a shark is a custom shape, I used the Physics Body Editor ( ) to transform the shape into a json format. This approach works well for LibGDX 1.2.0. In my case, I want to detect the collision of a shark with other objects. LibGDX is a cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux, Mac OS X, Android, iOS and your WebGL enabled browser. Now, I'm looking at collision detection for custom shapes. Its part of the ongoing LibGDX Tutorial series (. I have recently started developing with Libgdx. This tutorial shows how to create and use a particle system in LibGDX.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |