Recent Blogposts | Page 8

[WIP]Koloniigo - Animation

Sept. 3, 2015, 5:30 a.m. Gamedev Koloniigo WIP

I've just complete implementing animation for Koloniigo. :D

Well, it has taken me a while to figure out how to make it work under ECS architecture pattern.

Here is how does the animation looks like:

[WIP]Announcing Koloniigo - Turn-based Strategy game

Aug. 28, 2015, 5:35 p.m. Gamedev Koloniigo WIP

Hey guys! I'm developing a new game - Koloniigo.

It is a turn-based strategy game. At the beginning, each player owns a building. Each building generates population over time. Each player can send population to another building to reinforce/conquer it. The objective is to take control to all buildings in the map.

Currently implemented:

  • What you can see in the screenshot :P
  • Complete game logic
  • AI(it's pretty strong. Probably the strongest AI I've ever made in my life)
  • Random map generation


  • UI. e.g. menu screen
  • Graphic, including background and button icon
  • Animation
  • More will be added later :p

This game will be available in HTML5 and Android. No schedule of release. I will release it when it is ready. :p

FYI: This is my first time announcing work-in-progress game in this blog.

Ludumdare 33 Entry Completed

Aug. 23, 2015, 2:41 p.m. Gamedev Ludum Dare Product Release

My entry of LD33 is done! :D

You can play it here!

Not sure whether it's a good game. But it's the most funny game I've ever developed. :p

BTW, here's the timeline of the development:

1020    implemented bird movement
1200    implemented pooping
1250    implemented victim(without collision detection)
1545    implemented attack upgrade button
1625    implemented all upgrade buttons and its associated functions
1710    bugfixes
1810    implemented blackcloud and thunder
1910    implemented text fadeout; did some game balancing by reducing HP of the boss
2100    implemented police car; implemented win/lose scene
2150    implemented cloud; bugfixes
2200    bugfix on pooped.p practicle
2250    money eyes candy
2310    fix window config of jar version
1000    start working on sprite.png
1310    drew sprite.svg
1330    drew background.svg
1400    lose.svg
1440    win.svg
1540    synthed all sfx
1630    implemented siren of police warning
1710    implemented all sfx and tested it
1720    added disclaimer
1850    finished testing on different platforms
1910    submitted!

I'm in

Aug. 22, 2015, 3:21 a.m. Gamedev Ludum Dare

I'm joining Ludumdare 33! This is my first time joining Ludumdare. I'll use libgdx. I'm now working on my game project. Will post update here!

libgdx pinch to zoom

Aug. 15, 2015, 12:40 p.m. Programming libgdx

I was looking for the code for pinch to zoom on libgdx that zooms with the origin at the center of two fingers. Then I found this. Unfortunately, it seems that the solution there is far from being elegant. Then I figure out a new solution using the camera matrix myself. Here is the code:

this.gestureDetector = new GestureDetector(new GestureAdapter(){
        private Vector2 oldInitialFirstPointer=null, oldInitialSecondPointer=null;
        private float oldScale;
        public boolean pan(float x, float y, float deltaX, float deltaY) {
                game.getCamera().unproject(new Vector3(0, 0, 0))
                .add(game.getCamera().unproject(new Vector3(deltaX, deltaY, 0)).scl(-1f))
            return true;
        public boolean pinch (Vector2 initialFirstPointer, Vector2 initialSecondPointer, Vector2 firstPointer, Vector2 secondPointer){
                oldInitialFirstPointer = initialFirstPointer.cpy();
                oldInitialSecondPointer = initialSecondPointer.cpy();
                oldScale = game.getCamera().zoom;
            Vector3 center = new Vector3(
            zoomCamera(center, oldScale*initialFirstPointer.dst(initialSecondPointer)/firstPointer.dst(secondPointer));
            return true;
        private void zoomCamera(Vector3 origin, float scale){
            Vector3 oldUnprojection = game.getCamera().unproject(origin.cpy()).cpy();
            game.getCamera().zoom = scale; //Larger value of zoom = small images, border view
            game.getCamera().zoom = Math.min(2.0f, Math.max(game.getCamera().zoom, 0.5f));
            Vector3 newUnprojection = game.getCamera().unproject(origin.cpy()).cpy();

The method Camera.unproject() is used to convert the coordinate of the points you touch(let's say it's coordinate A) to the coordinate that you use for displaying objects(let's say it's coordinate B). For example, if you draw a object on a SpriteBatch, and the batch has set to use a camera, then the coordinate used there is probably in coordinate B. However, another coordinate system, coordinate A is used for touch input. That's why we need to do an unprojection for the conversion between two coordinate systems. Remember to update the camera before using the unproject method. Otherwise, it may do that unprojection based on an outdated transformation matrix of the camera, which make the calculation inaccurate