Translation: Recently, I have been studying cocos2dx for developing game clients, and I am planning to create a game of “Dou Dizhu” (a Chinese card game) by myself.
The main tools for this program development are: the YLIB cross-platform development library and cocos2dx.
For communication data, JSON is directly used with the structure: TYPE, ACTION, and DATA (actual data). To handle the packet fragmentation issue, I employed the Pack model of HPSocket, which automatically handles packet fragmentation and ensures the integrity of packets.
Client
The website found a resource package for Happy Landlord from N years ago, which includes resources such as pictures and music (click to download)
Client effect preview
Version:cocos2d-x-4.0
Background
Translation: Initially, the server used Skynet, whose design architecture made server development extremely straightforward. However, I found that Lua scripts are only suitable for developing small functional modules, and they are not suitable for complete involvement from start to finish. One issue is the complexity of debugging, and another is the lack of good IDE prompts, making it difficult to troubleshoot problems before running.
Due to my limited abilities, the development of the Skynet server was not continued.
Subsequently, I switched to using the YLIB cross-platform development library to develop the C++ backend for the “Dou Dizhu” game.