| Mobile games have become the main form of mass killing time. Whether it is in the bus, on the subway or a seating area, you can see there are a lot of people head down, his face reflecting the light of the electronic screen. Mobile subscriber in contemporary society is huge, product replacement fast, technology platforms and terminals universal dependence, mobile game development and promotion costs are relatively small and the threshold of entering this field are also much lower. For now the mainstream mobile platform IOS, Android, WPHONE, Black Berry, the company out of a product, how to make this product without modification or in the case of small changes in focus are able to successfully run several platforms that is an issue of major companies pay close attention, because if these problems can be resolved, the company can save a lot of manpower and financial resources, the company can put a lot of energy on improving the content of the product, rather than too much attention Cross-platform and other details.Contents of this paper are based on cocos2d-x that is a cross platform game engine. According to engine technology and Android cross platform learning, developing a game that local and network question game. The local game is that player will answer the questions these are loaded by game locally. The network game is that player will match with other players by connecting server. The game can not only entertainment, also allow players to learn some of their attention knowledge content using leisure time. The main content are:Firstly, the article will introduce the current situation of mobile phone games and market demand. The game manufacturers demand for cross platform game engine, and then introduces the cocos2d-x game engine. Leading to the advantages of cocos2d-x according to contrast of the current several well-known game engine. Then clarify the related technology of cocos2d-x engine, including scene rending, scene management, scene switching mode, game data storage, network communication(Completion Port), client server, package unpacking, pairs management in server side, database management, message delivery, interactive mode, message encryption, and others technologies used in the project, detailed description of system structure of client and server.The communication between client and server adopt to long connection mode, and the server is using Microsoft Completion Port frame, in such a way so that the server in case of resource consumption as little as possible, to be able to handle more connection. |