Tiled editor and connections between objects.
Posted by Marcin Karwat on 17-12-2015 at 19:48
On the screen you can see how the map creation process works.
Tiled editor provides a variety of tools to support the mapper, and is very simple to use.
So what can you see on the screen?
The red objects are pretty obvious to interprete, they are game actors such as Player, dynamic crates, or boulders.
The green objects indicate map colliders, so players won't fall through tiles.
The yellow objects are obvious as well, these are lights.
The blue objects are a bit more complicated, these are the connections between game objects.
Objects labeled as revoluteJoint are physical joints working pretty much like nails, they pin a object to world or connect two objects so they can rotate around one point and affect each other.
Objects labeled as observer connect logical state of Observer and Observable objects, this is an implementation of Observer design pattern. The actual magic happens in code, which determinates what happens on state change of Observable object. It lets me for example to make automatic doors reacting to player stepping on a pressure plate, or to make traps.
Tiled editor provides a variety of tools to support the mapper, and is very simple to use.
So what can you see on the screen?
The red objects are pretty obvious to interprete, they are game actors such as Player, dynamic crates, or boulders.
The green objects indicate map colliders, so players won't fall through tiles.
The yellow objects are obvious as well, these are lights.
The blue objects are a bit more complicated, these are the connections between game objects.
Objects labeled as revoluteJoint are physical joints working pretty much like nails, they pin a object to world or connect two objects so they can rotate around one point and affect each other.
Objects labeled as observer connect logical state of Observer and Observable objects, this is an implementation of Observer design pattern. The actual magic happens in code, which determinates what happens on state change of Observable object. It lets me for example to make automatic doors reacting to player stepping on a pressure plate, or to make traps.
Grappling Hook
Posted by Marcin Karwat on 16-12-2015 at 18:13
Player can now shot a grapling hook that will stick to any surface it touches.
Created rope is fully dynamic, it bends under applying force, etc.
Player can go up and down it, but movement isn't the only use of grappling hook.
You can also attach the hook to dynamic objects and pull them.
As you can see on the screenshot there are hearts in top left corner of screen.
These obviously indicate player's health, but there is no damage system implemented yet.
Created rope is fully dynamic, it bends under applying force, etc.
Player can go up and down it, but movement isn't the only use of grappling hook.
You can also attach the hook to dynamic objects and pull them.
As you can see on the screenshot there are hearts in top left corner of screen.
These obviously indicate player's health, but there is no damage system implemented yet.
Dynamic Shading
Posted by Marcin Karwat on 14-12-2015 at 16:37
I've never thinked that implementing dynamic shadows in LibGDX would be that simple.
LibGDX provides a Box2DLights extension which was created specifically for work with Box2D physics engine.
The extension draws overlaying lighting layer basing on created lights and Box2D bodies.
I had only one problem with lights, they were too bright and overlaying lights were too bright.
If you will ever have to deal with such problem use this line of code:
LibGDX provides a Box2DLights extension which was created specifically for work with Box2D physics engine.
The extension draws overlaying lighting layer basing on created lights and Box2D bodies.
I had only one problem with lights, they were too bright and overlaying lights were too bright.
If you will ever have to deal with such problem use this line of code:
RayHandler.useDiffuseLight(true);This simple problem was giving me headcaches for many hours, that's why I put it here.
Day 0
Posted by Marcin Karwat on 13-12-2015 at 22:54
Today was my first day of work, and it was very productive.
I've got all the game's base things to work:
- I can load and render layered Tiled maps
- I can spawn dynamic crates/boulders that are placed in Tiled editor.
- Player character can walk and jump
The workflow is simple and comfortable thanks to LibGDX which provides neat methods of rendering and actors management.