colyseus-cocos2d-x
Multiplayer Game for Nodejs base on Colyseus
Installation
Download and copy cocos2d-x v3.15+ to {$ROOT_FOLDER}/client/cocos2d
Win32 version
Run {$ROOT_FOLDER}/client/proj.win32 (tested on visual studio 2015)
iOs version
Run {$ROOT_FOLDER}/client/proj.ios_mac (tested on xcode 8.2)
How to run server
Ensure you have Node v6+ installed. Then run these commands in your commandline:
cd server
npm install
npm start
How to Client connect your server
open file {$ROOT_FOLDER}/client/Classes/GamePlay/SceneBattle.cpp
bool SceneBattle::init()
{
.....
Client::getInstance()->start("ws://13.76.179.224:2667", CC_CALLBACK_1(SceneBattle::onConnectToServer, this));
.....
}
replace ws://13.76.179.224:2667 to ws://localhost:2667