To run the main.js file which is the game entry point we need to compile Cocos2d-x RunTime which will load our game.
for this we use:
- Visual studio 2013 c++ community version .
- The same code base we created in Snake Game Using Cocos2d-x HTML5 - PART 1 .
1. Open VC++ then go to FILE -> Open -> Project/Solution . and navigate to where you created the SnakeJS project . then navigate to deeper directory named: proj.win32 :
\cocos2d-x-3.8.1\Projects\SnakeJS\frameworks\runtime-src\proj.win32
And load the "SnakeJS" VC++ solution project called SnakeJS.sln .|
2. Once we done loading the Cocose2d-x Runtime source code into VC++ we ready to compile it.
we don't need Debug version for this example because for now we are not going to change any c++ source code ,
In VC++ :
- in the projects list on the right select our "SnakeJS" project .
- go to the upper tool box there is drop down list with "Debug" selected . change it to "Release"
3. In VC++ which SnakeJS project selected go to and click on : BUILD -> Build SnakeJS
Wait until it is done to compile.
When it is done to compile. you should see in the VC++ bottom Output window scroll to the end .
7> 4 File(s) copied 7> 1 file(s) copied. 7> 1 file(s) copied. ========== Build: 7 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
4. Now we are ready to start our WindTakeFS game Navigate to :
cocos2d-x-3.8.1\Projects\SnakeJS\frameworks\runtime-src\proj.win32\Release.win32\
look for SnakeJS.exe click it to execute the game .
And your game should look like this :
Snake Game Using Cocos2d-x Javascript iOS- PART 6
Play the final SnakeJS game:
http://meiry.github.io/SnakeJS-html5/publish/html5/
The SnakeJS source code:
https://github.com/meiry/SnakeJS-html5
This comment has been removed by the author.
ReplyDeletehi after the release build, it displays the black screen, not the snack screen
ReplyDeletewhich device you are using ?
ReplyDeletei tested it only on iOS 8 + web
this is desktop win32 built. not mobile or web
ReplyDeleteGreat so you can debug it maybe, to see what you did wrong.
ReplyDeleteSee if you have any errors , set prints to output what you are missing
can you upload the "runtime-src" folder to git so that i can try?
ReplyDelete