Cocos2d-x 3.0 game instance learning notes "tower guard" Step 0th --- knowledge point summary & Effect Preview

Source: Internet
Author: User

New entry C ++ cocos2d-x3.0 tower anti-instance game

/* Description:

** 1. This game instance is the last game on the cocos2d-x game development journey, which is rewritten and noted down here with 3.0

** 2. I have also asked me about Wood himself. He said: Write it casually. First, do not copy the code completely. Second, it can be noted that it is learning notes.

** 3. Here With cocos2d-x 3.0 version rewriting, many places are different, but from the rewriting process also good learning cocos2d-x

*/

Environment: win7, cocos2d-x 3.0 final, C ++, vs2012

Note thinking: I will write notes based on this idea later.

1. First, give the effect of each implementation.

2. Then give the design ideas

3. Post code + code details

4. Resources and code are provided separately for each subsequent note.

Note content:

1. knowledge point summary (what have you learned)

2. Preview (image)

3. Overall game design ideas (figure) --- draw by myself

4. Summary & knowledge preview next time

I. Knowledge Point Summary

After more than a decade of hard work, I finally achieved a basic goal. I personally think that the first thing about games is imitation. I learned about the design and implementation of this type of Games through examples, I learned a lot like I used 3.0 to rewrite "parkol. Let's summarize the learned knowledge points:

1. edit a map

Editing a map is to give a background, and then you can modify and set the location of the fort and the walking route of the monster. The location of the Fort indicates the location where the hero can be placed, in the following game, you can click the turret to add a hero.

2. File Operations

Now that you have edited the routes of the gunshots and monsters, you have to perform file operations. I used to listen to other people in the group to discuss the plist configuration file. I didn't understand it at the time !! In addition, the attributes of the hero monster (attack power...) are also configured through the CVS file. The configuration file parsing and other operations are well known through the instance.

3. Screen Drawing

You have to touch the screen to determine the position of the gun, so you need to draw a picture on the screen to display your preset gun position.

4. Game implementation

You can learn how to move monsters and lock them in the attack scope. Attacks and heroes can be upgraded...

Ii. Let's see:


The main game interface. Well, in the game scenario, I designed the monster route at the gun station location, configured the monster attribute myself, and immediately acted as the background of the main interface. You can see several monsters and actions on the hero (upgrade, delete, and close buttons)


After the start button on the main interface, you can select the game level to enter the game:


The back button can be used in the game to return to the main interface.


After editing the operation on the main interface, you can edit it on your own.

Iii. Overall game design ideas

Okay, you have to figure it yourself. I do not know whether it is a game design idea, but the new calf is shameless...


Iv. Summary & preview of next note knowledge

In the course of learning, I first read some of the contents in the wooden book to see what to do, that is, the design idea. Then write it on your own. If you cannot write it or have bugs, debug it on your own, consult Baidu, and check the source code. After discovering the overall implementation effect, the code is messy... and debugging and modification in many places feels messy. Write the statement in a complete and organized manner and take corresponding notes.

Next preview:

Next time, we will design the main game interface, level selection, and editing interface-Next Resource & next time the Code will be given below the article after the test

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.