Cocos2d-x Tile Map Games (i) tiled

Source: Internet
Author: User

1. Refer to several concepts:

Tile Map

In the game development process, we will encounter more than the screen size of the map, such as real-time strategy game, so that players can scroll the game screen in the map. This type of game often has a rich background element, if you use the background map to switch the way, you need to prepare a background map for each different scene, and each background map is not small, which will cause the waste of resources.

The tile map was created to solve the problem. A large map of the world or a background image can be represented by several terrains, each of which corresponds to a small picture, and we call these small topographic images tiles. The tiling of these tiles together, a complete map of the combination, this is the principle of tile map. Tilemap Solutions

In Cocos2d-x, the tile map implements the TILEMAP scheme, and tilemap requires each tile to occupy a quadrilateral or hexagon area on the map. By stitching together different tiles, you can form a complete map. We need a lot of smaller textures to create tiles. Usually we will put these smaller textures in a picture, which will improve the performance of the drawing. Tile Map Editor

Cocos2d-x supports a map created and saved in the TMX format by the tile map editor tiled. Map Direction

The tiled map supports a right angle aerial map (90° map), an isometric squint map (oblique 45° map), and a hexagon map, which does not support the hexagonal map of the left or right or upper and lower boundaries. Map Resource suggestion Tile map material size 32*32 Multiple tile Footage group cannot be mixed with other pictures only tile footage can be imported into TMX files each layer supports up to 1 sets of tile material groups. Tile Layer There is no limit on the number of tile layers in a TMX file each tile layer can be composed of only one tile material each tile layer may be represented by the Tmxlayer class-for Spritesheet subclasses each single tile is represented by a sprite-the parent node is the Tmxlayer object layer Tile Map Support object groups are used to add game elements other than the background-objects in objects such as props, obstructions, etc. in the TMX file are in the form of key-value pairs, so you can modify them directly in the TMX file. tile Map coordinate system

The coordinate system for a 16*16 tile map file is (0, 0): Upper left corner (15, 15): Lower right corner



2. Tiled tile Map Editor Download address: http://download.csdn.net/detail/wwkaven/7789893


3. Installation:














4. Start the interface:



5, the next article describes how to use.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.