Welcome to reprint, please note the address: http://blog.csdn.net/fylz1125/article/details/8558956
Project address: https://github.com/fylz1125/MoonWarriors
This project was originally a project where I learned about cocos2d-x and was prepared for open source at the beginning.
It is because some of the problems have not been solved, and now the occasional crash, coupled with the recent busy searching for work, has not been solved.
In addition, let's talk about my learning experience:
I understand various languages, such as Java, C, C ++, objective-C, JS, Lua, and Ruby. I didn't have a clue at the beginning, because I had a lot of industry knowledge and terminology when I first entered this industry. There are also source code and demo of the research engine, but there is no purpose, and the effect is very poor.
After I became more familiar with C ++, I began to find some projects to try. I have to say that this is a good method. I have seen many JS games and many small open-source projects of cocos2d. Because they are relatively small and easy to understand. However, you can find the features of many game engines. I checked the code and tried to rewrite it with C ++. There will be many difficulties in this process. Although there are not many differences in the naming and structure of different engine versions, there are still some differences in the implementation of different languages. This requires you to have good language skills and know the differences between different implementations.
If the language itself has no obstacle for you, you will feel that the game written with JS is very clear, and the O-C code is also very beautiful. If there are some comments, it is not difficult to figure out the structure and logic of the game.
At this time, you can start to use C ++ to design and rewrite it.
But I want to tell you that games that use C ++ to rewrite other languages are not the ultimate goal. This is just a means of learning the engine. If you are very proficient in this engine, you do not have to do so. At this time, I think it would be better to learn JS and then use js to play games, because it is faster.
Well, when you rewrite the game, you should try to understand the code. For example, what is the implementation of the same function in C ++. You need to follow up the source code of the engine. 2.1.0 has many comments on the engine and many blogs on the Internet. Therefore, it is worthwhile to spend some time researching the engine itself. Such problems are not so important as to how to use an API.
After writing one or two projects, you may be familiar with the engine itself. At this time, you have completed the beginner's entry path and will need your continuous efforts and practices in the future. Now let's look at the JS or cocos2d code. You will find that there is no difference at all. The question you want to consider is not how to implement it, but how to achieve better results.
Okay, that's all. It's time for dinner.