Open slawo opened 10 years ago
Actually I think creating an NPM module for cocos2d-console would be a great idea.
It would help with simplifying the workflow, updates of cocos2dx and other tasks:
npm install -g cocos2d #installs cocos2d(x, console, html5 & node)
#setup of paths for compile tools
cocos new projectName -l js --no-native #creates a new js project with the newly installed/updated cocos2d-console
Later adding support for node.js would greatly improve the usability of cocos2dx for html5 multiplayer games:
npm install -g cocos2d
cocos new projectName -l node --no-native
cd projectname/runtime/node
npm start #starts the html server and gives access to the project on localhost:3000
If designed right a cocos2d npm package could allow the creation of powerful multiplayer games. It could allow:
app.use(import("cocos2d-node"))
This type of module could later evolve to run some code natively if cocos2d-jsb could run with V8. This type of setup would mostly benefit projects which heavilly rely on C++ modules like physics, rendering (for server side generated textures/images/movies)...
The final goal would be the creation of a module which would allow :
What do you think of this?
I think we can learn from ReactNative how npm is used. While you can use npm to install modules in react-native, they have rnpm too (react native package manager) which helps to link modules against the binary etc.
Also using webpack with babel would be a good idea.
Hi @slawo
NPM installation is very convenient. But cocos is not nodeJS module.
A little inappropriate...... Do you have any idea?
VisualSJ