Introduction to Cocos2d-x physical engine: HelloPhysicsWorld,Let's take an example to introduce the development process of using physical engines in Cocos2d-x 3. x and get familiar with the use of these Apis. In the running scenario of this instance, after the scenario is started, the player can touch and click the screen. Each time the screen is touched, a new genie will be generated at the touch point, the running of the
specifications.
2. Start testing various adaptation methods
The screen adaptation should actually start with Opengles. I skipped it here. If you are interested, read this article to learn about 2D Development Using OpenGL ES in Android (drawing the first triangle outside the article)"
Glview-> setDesignResolutionSize (960,640); the third parameter is ignored first. What does setDesignResolutionSize mean? Is to setFixed AreaProgram layout and art design. Then, you can use Opengles to project to
, thus improving development efficiency and making operations easier. Unity provides a built-in Wizard editor to extract sprite images from a large picture. This allows us to use an external graphical editor, such as Photoshop, to edit multiple image components in a single texture. For example, we can put the character's arms, legs, body and so on as a separate image element, stored in a large picture. the 2D Sprite object needs to be used Genie Rende
are many operate_dictionary object functions. Below is a summary of common functions:
_ Array * allKeys (). Returns a _ Array container containing the "value" of all "keys.
Unsigned int count (). Returns the number of elements.
Bool writeToFile (const char * fullPath ). Write _ Dictionary to an attribute list file. The written "value" must be string type.
6. traverse the _ Dictionary container
The Cocos2d-x provides two macros for the traversal _ Dictionary container:
CCDICT_FOREACH. Traverse
container.6. Traverse _ Array containerThe Cocos2d-x provides two macros for traversing the _ Array container:? CCARRAY_FOREACH. Forward traversal.? CCARRAY_FOREACH_REVERSE. Reverse traversal.Instance :__ Array containerNext we will introduce the related functions in the _ Array container through an example. Scenario: Click Go in the lower-right corner to add 100 genie to the scenario._ Array container instanceTo implement the above functions, we do
write a program in what format should be maintained for mappy. Generally, a map consists of a 45-degree angle, a top-down angle, and a side view.
4. main character design
The main character in the game becomes "genie" here. of course, the genie covers a wide range, not only the main character, but also the npc and props. Since it is a genie, there must be many a
. Traverse _ array container
The Cocos2d-x provides two macros for traversing the _ array container:
? Ccarray_foreach. Forward traversal.
? Ccarray_foreach_reverse. Reverse traversal.
Instance :__ array container
Next we will introduce the related functions in the _ array container through an example. Scenario: Click Go in the lower-right corner to add 100 genie to the scenario.
_ Array container instance
To implement the above functions, we do n
functions:
_ Array * allkeys (). Returns a _ array container containing the "value" of all "keys.
Unsigned int count (). Returns the number of elements.
Bool writetofile (const char * fullpath ). Write _ dictionary to an attribute list file. The written "value" must be string type.
6. traverse the _ dictionary container
The Cocos2d-x provides two macros for the traversal _ dictionary container:
Ccdict_foreach. Traverse the _ dictionary container.
Instance :__ dictionary container
Next we will
Tutorial 08-
Weather
This tutorial demonstrates special effects and lighting simulation.
Gradient of the sky
We use genie to render the sky without textures.
hgeSprite *sky;
sky=new hgeSprite(0, 0, 0, SCREEN_WIDTH, SKY_HEIGHT);
It has different colors on the top and bottom vertices for smooth transition.
hgeColor colSkyTop;
hgeColor colSkyBtm;
sky->SetColor(colSkyTop.GetHWColor(), 0);
sky->SetColor(colSkyTop.GetHWColor(), 1);
sky->SetColor(colSk
system. Finally, we decided:
XML is used as the configuration scheme of the desktop system, providing highly customizable and scalable.
Use netscape4.76 as our browser.
Use browser to implement webmail.
Use some sui ideas to add a desktop genie program.
Always on top is supported to support better desktop features and sprite program requirements.
MP3 and VOD programs are used as the plug-ins of Netscape.
Then, I estimated the workload and human reso
the UI system. Finally, we decided:
XML is used as the configuration scheme of the desktop system, providing highly customizable and scalable.
Use netscape4.76 as our browser.
Use browser to implement webmail.
Use some sui ideas to add a desktop genie program.
Always on top is supported to support better desktop features and sprite program requirements.
MP3 and VOD programs are used as the plug-ins of Netscape.
Then, I estimated the workload
: http://blog.csdn.net/ml3947,my personal blog address: http://www.wjfxgame.com. Someone has no idea about copying without copyright. Insert personal information in the middle.
Create it as prefab
All reused objects are used as prefab for performance consideration. No translation here.
Create static level genie
Next, we will make concrete, ladders and ropes genie. We will use the same iner, but because th
Let's take an example to introduce the development process of using physical engines in Cocos2d-x 3. X and get familiar with the use of these Apis. In the running scenario of this instance, after the scenario is started, the player can touch and click the screen. Each time the screen is touched, a new genie will be generated at the touch point, the running of the genie is a free-body movement.
Hellophysi
Let's take an example to introduce the development process of using physical engines in Cocos2d-x 3. X and get familiar with the use of these Apis. In the running scenario of this instance, after the scenario is started, the player can touch and click the screen. Each time the screen is touched, a new genie will be generated at the touch point, the running of the genie is a free-body movement.Hellophysicswo
should know that the genie is actually a texture in the 2D world. Now, let's create a new project to demonstrate how to use the Sprite component! The first exciting feature is that we can decide whether a project is a 3D game or a 2D game when creating a project. Here we choose 2D directly, because what we want to explore today is the Native2D feature of Unity3D.
After entering Unity, we will notice that there will be a 2D/3D option button on the to
addition, there are many operate_dictionary object functions. Below is a summary of common functions:
_ Array * allKeys (). Returns a _ Array container containing the "value" of all "keys.
Unsigned int count (). Returns the number of elements.
Bool writeToFile (const char * fullPath ). Write _ Dictionary to an attribute list file. The written "value" must be string type.
6. traverse the _ Dictionary container
The Cocos2d-x provides two macros for the traversal _ Dictionary container:
CCDICT_FO
) ccTouchesMoved :( NSSet *) touches withEvent :( UIEvent *) event {
// Obtain the touch object
UITouch * touch = [touches anyObject];
// Obtain the position of the touch in the UIView.
CGPoint uiPoint = [touch locationInView: touch. view];
// Convert to OpenGL coordinates
CGPoint glPoint = [[CCDirector shareddire] convertToGL: uiPoint];
}
The following uses a small example to combine the above method. Suppose there is an genie on the layer,
An available version
Genie Configuration
In the wizard configuration, the Wizard is first classified to specify the direction and animation of each category. Mirror indicates that there is a corresponding image relationship and can be automatically generated.
Determined by spriteconfig. XML, the editor cannot be modified.
The genie list is saved in spritemgr. You can right-click to add a new
, we also discussed the applications to be integrated and the solutions to build the UI system. Finally, we decided:
XML is used as the configuration scheme of the desktop system, providing highly customizable and scalable.
Use netscape4.76 as our browser.
Use browser to implement webmail.
Use some sui ideas to add a desktop genie program.
Always on top is supported to support better desktop features and sprite program requirements.
MP3 and VOD
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.