Running Cocos2d-x on Windows 10

With Microsoft’s latest open source code contribution to the Cocos2d-x project [ https://github.com/cocos2d/cocos2d-x/pull/12107 ], Microsoft has enabled Cocos2d-x to run on Windows 10 on the Universal Windows Platform. The Universal Windows Platform (UWP) makes it possible to target all Windows platforms (Desktop/Tablet, Phone and IoT devices) through one project with the new application model . With this new code contribution, users will automatically generate projects using Visual Studio 2015 that target the UWP when they create new projects.

Open up command prompt and use the command: cocos new myWin10Game -l cpp -d projects

Enter the proj.win10 folder and open the solution. In this example, it will be myWin10Game.sln.

Getting into the source code

In Visual Studio 2015, you will see this project structure. As expected, all of the game logic and code will be contained within the Classes folder. The application start code will reside within HelloWorld.cpp.

You can build and run the game, below is what you should see. To switch to Windows Mobile and test on a phone or phone emulator, just switch your output to ARM and change your deploy target.

This is just the beginning of our Cocos2d-x work on Windows 10. If you want to try out a more complex game, clone the repro for Rocket Man . For an example of a full blown game running Cocos, Devils & Demons by HandyGames in Germany is one of many examples. Devils & Demons is a great RPG that lets you fight hordes of demons and undead with amazing quests!

If you haven’t already, check out the “Unleash the Power of Cocos and Windows” Game Developer Contest . The deadline has been extended to June 30. You now have more time to finalize your entry or submit a new entry of innovative mobile games built for Windows using the Cocos engine. The contest will award $25,000 USD for first place, $15,000 USD for second place, and $3,000 USD for third place. Games will be judged on originality, innovation, and pushing the boundaries of creativity using Windows and the Cocos engine. Submit your new game or newly ported game today!