Hello guys,I am back. The little website is so deserted before because of my laziness. So now,I want it to be changed. I will use English by now so maybe I can improve my English. And I want all of people over the world can enjoy my little website. Closer to home. About 5 months ago,as I had just resigned,I decide to be an android developer. I want to do something different with my work before. So between software and game,I choose the game. After trying a lot framework,I choose libgdx and begin the great journey. I do not want to say how wonderful the libgdx is(please google and you will know why).I just tell you how I use it. So, let's begin. Ther are some articles in the web,but I will just write my own. Key 1: Preparing. As we know, if you want to make a game,you must have the resources(images,audio and so on). Because I am not good at painting,so after waste a lot of time in painting,I decide use other's image to be my game's actor. So I found a PC game called "Little Fighter" and it is perfect. I borrow some images from it in order to save my time in painting. Then I make a menu screen like that image below.
By the way,it is easier to draw a screen by libgdx than by android's xml. You know,it is difficult to draw a screen as you want by edit an xml. Key 2: The map. I want to make a game,so I need a map. The best way is tilemap which is easier to build. Libgdx offer you a tool so called "tiled-preprocessor". All of your tile map must recod so the libgdx can use it. You must import it in eclipse and rebuild the "Java Build Path" of this project. You need to change the inputDir and the outputDir to your own path as I do below. For example:
inputDir = new File("D:/maps"); outputDir = new File("D:/maps/output");
And comment all "System.exit(0);" in order to run it. Then run it and you will get three files and they are want you need. In my application, I found the tile map is loads so slowly and it has something different with the original. So I change two places. The one is add this line settings.stripWhitespace=false; into the main method of the "TiledMapPacker.java" to make it look like the original . And change the last two num to "100" like tileMapRenderer = new TileMapRenderer(map, atlas, 100, 100); so it could loads quickly.
TO BE CONTINUE......
Comments
请在后台配置评论类型和相关的值。