Ancient guard/cocos2d-x source code/tower anti-game/High imitation of the Kingdom guard, cocos2d-x high imitation

Source: Internet
Author: User

Ancient guard/cocos2d-x source code/tower anti-game/High imitation of the Kingdom guard, cocos2d-x high imitation

:

This source code is highly imitation of the defending war of the IOS game Kingdom. It was developed by raywenderlich internal engineers at the foreign IOS Commercial Development tutorial website. It has a complete level design and combat process, with up to 12 levels and various enemy soldiers, monsters, arrow towers, turret, and magic systems, achievement systems, and background databases have almost reached the commercial game level that can be launched. The code is strictly standardized and provides a complete set of anti-tower game implementation solutions, such as how a wave of monsters go out, how they walk, how our soldiers act AI, tower search and attack the enemy's AI, the code is strictly in accordance with the MVC (model, view, controller) specifications, so that users can see at a glance and have a high degree of reusability. Unfortunately, the original author only provided MAC machine to run the cocos2d-iphone version, no cocos2d-x version, I alone spent more than two months to translate into domestic can use the cocos2d-x 3.x/ win version, all kinds of troubleshooting to find the error, the difficulties in Environment conversion and construction are unknown. Now it is dedicated to the majority of cocos2d-x development enthusiasts, learning together progress


Application Platform: IOS, Windows, and Android

Development tools: Eclipse/Visual Studio2012

Programming Language: Objective-C/C ++

Game Engine: Cocos2d-x 3.x

Source code content: Cocos2d-iphone/Cocos2dx two sets of source code + a full set of complete resources

Completion: high level for advanced users

Usage: first copy the cocos2dx directory from another project and drop it to the source code directory. Then double-click chaosWar. sln under proj. win32 to open the project.

Note: Please contact the manager immediately after taking the photo, so that you can send the baby download link to you in a timely manner. I am online at any time and will reply when I see the message.


Start Interface

Achievement System

Help System

Loading

Level Selection and magic selection before entering the game

Battle Interface

Game victory

Source code highlights:
1. Simple and Easy-to-use lightweight database sqlite
For sqlite3, I didn't know it was a chicken fault. I thought it was mysql. What else can I do? Only through this source code can it be found that it is so easy to use. It is easy to use because sqlite3 does not need to install any database background, only one. db files can be used as the entire game database and are extremely suitable for local configuration files of the game. sqliteStudio visualization tools are provided to query, add, delete, modify, and operate frequently used databases, which is very convenient for planning, it can replace plist, json, and other configuration files that are hard to understand. But it is not that simple for our programmers. Fortunately, this source code provides a complete set of operations to create databases, search for data, and add, delete, and modify data, the source code seems to be very long, but once and for all, it can be used everywhere. We will copy/paste it later and call the function. There will also be a lot of trouble when the sqlite3 library is transplanted to the android environment. This source code tutorial also provides a perfect solution, so you don't have to worry about porting problems.

2. Tower anti-game construction, tower defense against enemy attack AI, small soldiers defend against AI and enemy walking AI

1. How are enemy monsters out of the waves and how should they be controlled by arrays? How does one control the arrival time and order in terms of time?
2. How do monsters know what route they should take? Where can I go and where can I? How can I avoid going outside the road?
3. How does our defense Tower know that the enemy has entered our ambush circle? For example, the arrow tower is ideal for the first enemy to launch an attack as soon as it enters the ambush ring, then when there are a lot of enemies and we want to escape from the ambush circle, Our arrow Tower will chase the small soldiers who are at the end of the fight, rather than the brainless one, to fight new monsters, or let go of any strange thing, otherwise, it would be a pity to let the blame slip away. But what should I do?
4. How do our soldiers lock their enemies and launch attacks? How does the enemy know that they are locked and fight back? How can we quickly escape when a soldier is killed and the enemy knows how to supplement the defender in our barracks?

When the hacker runs on the mobile phone, does the Combat Process achieve the above effect?

The Code volume is very large. You will know it when you purchase it. It can reach 128. cpp, each file is very large, and the amount of code has exceeded the horizontal Combat Game Beatup Em, but you do not have to worry about how to learn to read, I have put a "sub-chapter source code" directory under the root directory, which is divided into twelve chapters for classes. You can learn in sequence and the classes of each chapter can be run, however, you need to refer to the final project to establish the directory structure by yourself.

Because there are a lot of code, and it is from mac cocos-iphone version to cocos2d-x 3.x/ c ++ version, there is a bug is inevitable, forgive the treasurer, I have spent three weeks in order to correct the error, we have reached the point where we all want to vomit blood !! In this way, the game process does not have a serious downtime BUG, so normal customs clearance can be achieved, and small issues cannot be guaranteed. However, if you encounter a bug, you can debug it by yourself, it is also an important way to improve your programming skills!

APK download:
Http://pan.baidu.com/s/1mgnEUGK
You can download and play first, and then decide if you want to buy

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.