(1) Genie
Anything that can be independent of others on the screenEastWestward free migrationDynamicIIDimension bitmap image;
(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. By creatingPlistControl files to determine their locations. This control file can beZwoptexAnd other tools.ZwoptexYou 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,Cocos2dHow does one create an animation?
We define images of different animation frames through the sprite table, and then useCodeLoad each sprite (FRAME) into an animation and display the rendered Sprite 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
BecauseOpenGL ESFonts are not supported, so fonts will be defined as a series of images. To do this, we can useHieroAndBmfontAnd other tools to convert the font to a Sprite table.MacBased onJavaOfHieroVersion. GeneratedPNGAs 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 table contains the genie 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 useTiled.
(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: the particle size.
today's brief introduction cocos2d , next we will explain in detail the process of each term. Welcome to shoot bricks.