Ancient Guardian/cocos2d-x Source/Tower Defense game/high imitation of the Kingdom defend

Source: Internet
Author: User

source code height imitation iOS game Kingdom battle, by the foreign iOS Business Development tutorial website Raywenderlich In- house engineer, with a very complete level design, battle process, up to 12 levels, a variety of enemy soldiers, monsters, Arrows Tower, turret, as well as magic system, achievement system and back-end database, almost reached the level of business game can go online. Code strict specification, provides a complete set of tower defense game implementation of the solution, such as how to get out of the way, strange walking route, our creep action AI, tower search and attack the enemy's AI, code in strict accordance with the MVC (model, view, controller) specifications, so that people at a glance, the reuse of very high. Unfortunately, the original only provide Mac machine to run Cocos2d-iphone version, no cocos2d-x version, I alone spent two months translation into the domestic can use the Cocos2d-x 3.x/win version, all kinds of error-seeking, environment conversion and construction, One of the hardships is unknown. It is now dedicated to the vast number of cocos2d-x development enthusiasts, learning and progress together


Application Platform: ios/windows/android

Development tools: eclipse/visual Studio2012

Programming Languages: Objective-c/C + +

Game engine: Cocos2d-x 3.x

Source content: cocos2d-iphone/cocos2dx Two sets of source code + full set of resources

degree of Completion: very high for advanced users

Usage: from another project copy COCOS2DX directory to the source directory, and then double-click Proj.win32 under the ChaosWar.sln can open the project

Note: after filming please immediately contact the shopkeeper, convenient I will be the baby download link to you, I am always online, see the message will reply.


Start interface

Achievement System

Help system

Loading

Level selection and magical selection before entering the game

Combat interface

Game win

SOURCE Highlights:
1. Easy-to-use lightweight database SQLite
about Sqlite3, before I do not know that it is a chicken, thinking that there is MySQL and what it does? After this source code only found that it is so useful. Say it works because Sqlite3 does not need to install any database background, only one. db file can be used as the entire game database, extremely suitable for game-local configuration files, with Sqlitestudio visualization tools The use of the database commonly used queries, additions and deletions to change the operation, it is very convenient for planning, can replace plist, JSON and other difficult to understand configuration files. But for our programmers is not so simple yo, it is good source code provides a complete set of database, find data, additions and deletions modify operation, the source code looks like a long but after the realization can once and for all, everywhere use. We will copy/paste later, the function is OK. The Sqlite3 library also has a lot of trouble porting to the Android environment, and the source code tutorial also provides the perfect solution, you don't have to worry about porting the problem

2. Tower defense game towers, towers defend enemy soldiers attacking AI, creeps defense ai and enemy soldiers walk AI

1. How did the enemy monsters waves out, and how should the formations be controlled? How do you control the time and order of entry in time?
2. How do monsters know what route they should take? Where can I go and where can't I go? How can you not walk outside the road?
3. How did our defense tower know that the enemy had entered our ambush ring? such as the Arrow tower, our ideal state is the first enemy into the ambush ring to launch an attack, Sean, and then the enemy many and will escape the ambush circle when our Arrow tower will chase away at the end of a single soldier and not without brains to play new in the strange, or let any one strange, or let the blame slip away that is a very regrettable thing , but how can all this be done?
4. How do our creeps lock up their enemies and attack them? How did the enemy know that they were locked out and fought back? And the soldiers were killed. How does the enemy know how to escape and how our barracks know we should add the guard?

    This pile of problems is a great headache, but it has to be solved we can not escape, all this in the code has a wonderful embodiment, You can download the next I turn around. APK on the phone run to see if the battle process is realized I said the above effect

    Code is very much, you know, when you buy Up to 128. cpp, each file is very large, the code is more than the horizontal version of the fighting game Beatup Em, but you do not have to worry about how to learn to read, I have put a "sub-chapter source" directory in the root directory, divided into 12 chapters to place classes, you can gradually learning, Each chapter of the classes can be run, but the directory structure you have to refer to the final project itself, and no trouble

due to a lot of code, and from the Mac Cocos-iphone version to cocos2d-x 3.x/c++ version, there are bugs unavoidable , forgive the next the shopkeeper, I have spent a full three weeks for the wrong time, has come to see the game all want to vomit the degree!! This is the game process without serious downtime bug, can normal customs clearance, small local problems can not be guaranteed, but encountered a bug everyone could do their own debugging, but also to improve their programming ability level of an important way!

APK Download:
Http://pan.baidu.com/s/1mgnEUGK
Everyone can download first play, and then decide whether to buy

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Ancient Guardian/cocos2d-x Source/Tower Defense game/high imitation of the Kingdom defend

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.