The second issue: http://www.cocos2d-x.org/forums/6/topics/51024
The third issue: http://www.cocos2d-x.org/forums/6/topics/51141
The fourth issue: http://www.cocos2d-x.org/forums/6/topics/51363
The fifth issue: http://www.cocos2d-x.org/forums/6/topics/51440
The topic of the game design idea is always making people exciting. In my opinion, an apprentice
of the game design or developers independently should take a small classic case to analyze than
read one hundred article on the pure theory. It will be more practical. In this series, I am going
to show you how to use the Cocos2d-x-3.0 game engine to write a simple Tile Map Game, small Pokemon.
When I say Tile Map Game, probably you already know some of these classic games, or you just simply
couldn’t recognize them. These pictures will help your memory. Both of them are the Tile Map Game.
Battle City Pokemon
In this issue, I going to show you how to use the Tiled Map editor to build and upload the map.
Manage the different layers and the objects. Upload the character. And make it move. Upload your
enemy and make them move, too. Also give you the way to defend yourself.
1.Make arrangement:
Game Engine: Cocos2d-x-3.0: (http://www.cocos2d-x.org/download)
Tile Map Editor-9.1: (http://sourceforge.net/projects/tiled/files/)
VS2012: (http://www.visualstudio.com/zh-cn/visual-studio-homepage-vs.aspx)
First thing first, we need a game engine —Cocos2d-x-3.0, written in C++ and OpenGL ES 1.1/2.0,
runs on iOS, Android, BlackBerry, Bada, Marmalade, Windows, Windows Phone, Linux and more.
Then we still need a edit tool to do the coding and show me the result. (I chose the tool VS2012).
The Tile Map Editor: the version is 9.1. It can create the map you want.
The Tile Map picture materials: the pictures that show the effect and create the map.
The Character/Enemy Sprite: the pictures (use PNG graphics) that represent the character and the
enemy.
The Music: including the background music and the different effect sounds.
And if everything is done, those music and photographs resources should be put into the file of Resources.
2.Use Tile Map tool to create a map
The cocos2d-x-3.0 supports the map (use TMX format) which creates by the Tile Map editor.
After install the tool. Double-click the shortcut on the desktop. Click the File/New. Input the
parameters as shown. Then click on the ‘map’ menu and choose the ‘New Tileset’, you will see:
Use the ‘browser’ button to choose the sample pictures that we already have. And set the
‘Margin’ and ‘Spacing’ to 1. The ‘Margin’ will cut off the picture’s edge. And the ‘Spacing’
will cut off the pixels every pixel between two tiles you had set. For example:
Set Margin: 1 & Spacing : 1
Set margin: 200
Set the Spacing: 50
Once we have done the drawing. Change the layer’s name. Rename it ‘Background’. It will be
convenient for us to manage those layers. (Don’t mind about other layers and objects in the picture I have shown you. We will do it later.) And click on File/Save button. Save it and name it ’01.tmx’ (or
whatever you like.)
Rename the layer
To be continued~~
Next: http://www.cocos2d-x.org/forums/6/topics/51024
The resource I used, is released in 4L
05.png (92.3 KB)
06.png (10.0 KB)
00.png (223.9 KB)
01.png (148.4 KB)
02.png (78.9 KB)
03.png (528.5 KB)
04.png (137.8 KB)