[Iphone game development] One of iphone-Cocos2D Game Development

Source: Internet
Author: User

(1) genie

Any two-dimensional bitmap image that can be freely moved on the screen independent of other things;

(2) genie table

Images containing more than one Genie are called Genie tables. A genie table is an image that contains a series of Sprite images in the form of grids ., Each genie can be accessed through its row and column locations in the big image. As follows:

 

A more complex genie table can be called a packaged genie table. It is an image that contains a series of more gender images. Each sub-image can be another genie table or image. As follows:

 

 

In a complex genie table, we cannot simply determine the location of each genie based on the location of rows and columns. We create a plist control file to determine their location. This control file can be generated using Zwoptex and other tools. Zwoptex can generate genie tables and control files from scattered images. The generated control file is as follows: we will introduce how to generate it later.

 

 

(3) Animation

I believe everyone is familiar with animation, but how does cocos2d create an animation?

We define images of different animation frames through the genie table, then use code to load each genie (FRAME) into the animation and display the rendered genie on the screen. The first genie table above shows the genie running in different directions.

 

 

The first line shows running down. The second line is displayed and runs up, the third is displayed to the right, and the fourth is displayed to the left.

 

(4) lattice words

Since OpenGL ES does not support fonts, fonts will be defined as a series of images. To do this, we can use tools such as Hiero and bmfont to convert fonts into sprite tables, JAVA-based Hiero version can be used on MAC. The generated png is as follows:

 

 

(5) Map

When developing a role-playing game, it is not feasible to store large images in memory. We can use a map, a two-dimensional grid. Each grid unit contains information about the position of the grid unit in the map. Textures usually have the following two elements:

1. A genie table that can be used to build an environment scatter map image.

2. A map file. Specifies the texture to be used at a specific position in a map.

In textures, we can use Tiled to create images.

(6) Particle System

Some special effects games we have played can be implemented in two ways.

One is to use an animated Sprite.

One is to use a particle system transmitter.

Particle systems are techniques used to imitate a natural phenomenon. Such as fire, smoke, river, and rain in reality. A particle system usually has a particle transmitter responsible for generating new particles and tracking their processes in the game until they are eliminated. After creating a particle, you can set the following particle parameters:

1. Speed: particle speed.

2. lifetime: the time when the particle exists.

3. direction: the direction of particle motion.

4. Initial color: the color just created by the particle.

5. Final color: The color when the particle is eliminated.

6. Size: particle size.

 

Today, we will briefly introduce the definition of some terms in cocos2d. Next we will explain in detail the process of each term. Welcome to shoot bricks.

A common cause and a common struggle can make people endure all forces. -- Ostrovski Excerpted from: qiaoshe

Related Article

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.