aiFew weeks ago, i have done a post on how doing a smarter pathfinding for I.A. from results given by A*.

Someone asked me to show some code, so you will find below the method I use in my game. It is very rough but if you are a developer and you want to improve yourself on this subject, this will help you even if you can’t use it out of the box.

The method findPath() called in the first line is an A* implementation which gives a list of tiles index to reach the target modelized as a GridPoint2 objects. The “smarter” method returns a list of Vector2 objects which are real 2D coordinates in my world. Notice that the “area” parameter object passed to the method represent the surface of the sprite located at (x,y) which want to reach the target point (tx,ty). The area is relative to the position of the sprite. The parameter “collisionDetector” is an utility object which can check if the tile is solid or not (like a wall).

So finally i have finished (well, for the moment because i know myself: i will have another idea in two months and i will change again UI….) my main user interface for the Cthulhu game.


  • On the left the main character portrait with 2 gauges: one for life and one for mental health.
  • Then the number of Gold
  • On the center of the screen, the two objects held by the character.If you click on them, inventory is open and you can change them.
  • On the right, followers’ portraits. If you click on one of this portrait, the character clicked become the new main character.
  • On the bottom of the screen classical control button: on the left a pad and on the right two action buttons to use the two objects held by the character.
  • On the bottom / center, a slide button to show the map.

I just finished to implement a better version of path finding for my cthulhu game.

The basis is still based on A* but i add some additional steps to make the path used by hostile smoother and clever: I describe my enhancements in drawings below:

  1. The first drawing explain the real situation: you have one hostile located at point A. This hostile is modelized as a rectange (the collision area); The hostile need to reach point B behind a wall.
  2. The second drawing explains a path finding result using A*. A* is based on tiled so you will have a tiled vision of the path to used to reach point B. But remember, our hostile is a rectangle on a map with x,y coordinates and not integer tile indices.
  3. My first enhancement take A* tile path result and remove unecessary tiles (see third drawing) to keep only turn points.
  4. Then i do some additional process to compute real points (x,y coordinates) which takes care of hostile collision area and mnimizes the path regarding turn points.

The result in action:

Few weeks ago, “followers” feature was implemented in my next game project “Cthulhu”. The code is still under development to be perfect but this video give an idea of the result.

I have not post to much on this blog but i have a good reason: I have move from France to Montréal, Canada for a new life ! New job and new city 🙂
I will try to post some artwork for my new game soon. So keep in touch !

blocks gameplayOne years ago, i just released my first android game on Google store. At a first sight, Blocks looks like a Tetris or a Bejeweled clone but the gameplay is indeed more complicated if you want to reach high scores.

As i explained in the game description, the goal is to group four blocks or more with the same color. If these blocks have only one color, they disappear. Otherwise the external color fade and the block is now made of one color. Seems pretty simple and you are right. But if you just play the game without trying to do chains, you score will remain low. So you will have to think about how to group block together and then drop the final block which will make all other dissapear in a row.
Game ends when the game area is full of blocks.

I just port my game to LibGDX to solve many issues and release as a 2.0 version. The game is free on google store, so please, enjoy ! 🙂 Blocks on Google Play!



Tiled map is a really good tool to create a classical 2D game. Everything already exists from editor to rendering. You just need to produce some tilesets, create a map with a tool like Tile map editor and with some few lines of code from libgdx, you have a 2D area game. You can find tons of tutorials explaining how to do this, including the official libgdx wiki.

Sadly nothing exists to render a fake perspective:BNyonmNCYAA6JYY if you put a wall tile on the map and use a sprite for a character behind the wall, the sprite will not be hidden because all tiles form the map are drawn before sprites.

After a discusion with @_TylerChurchill on twitter, I have implemented a solution using 2 different layers in my map, one for all the basic stuff (floor, walls, objects) and one for all elements that should hide all things drawn before – the “perspective”.

My standard map definition looks like the screenshot below:


I just added a new layer named “perspective”


And isolate all perspective elements in this layer:


In order to use this trick, I create a new TiledMapRenderer class from libgdx to ignore the “perspective” layer when the method #render() is called and add a new method to call to render it at the end of my drawing iteration process.

In my game initialization method,  I have initialized my new TileMapRenderer specifying that the layer to ignore is named “perspective”

In the rendering iteration process, i have called the #render() method from the map renderer, then i drew all sprites and then i have called the new #renderPerspective() method. Notice that you need to order all sprites using their “y” coordinates from the farest to the closest in order to keep a correct perspective for sprites.

The result: BOwerG0CEAAtsML

  • always add a padding between tiles to  avoid texture glitch. Texture smoothing could take adjacent pixel in consideration. A gap between tiles will avoid this problem.
  • consider using only one atlas image to render all the scene: switching between images on graphics processor take a lot of time.
  • using atlas help you manage only power of two size images even if content has not power of two size (open gl 1.x).
  • merge all animations for a sprite in one atlas image.
  • if you are using libgdx, the library propose a class which create automatically atlas image when called.

Like the post i did about tools i used, here the list of web sites which can help you to make a game. Some web site are talking about general development, not relative to any specific framework,  some are more relative to libgdx, and to finish some usefull links concerning graphics design: