Showing posts with label Desktop. Show all posts
Showing posts with label Desktop. Show all posts

Thursday, March 10, 2016

How to create small C++ Cococs2d-x project in Visual Studio pointing to pre build libraries.end of the huge size projects!

In this tip  i will show you how to setup windows cocos2d-x project to be as small as possible,
From :
4.60 GB (4,940,689,408 bytes) TO  82.4 MB (86,466,560 bytes). !!

This is problem which bean around few years now and caused low disk space. and long compilation time.
Also the windows prebuild option in cocos doesn't work for me .

The simple principle here is that we will compile the cocos2d-x Libraries once.
And this will be Our central repository of lib's and dll's .
And our game EXE will compile and run localy in the project directory.
For simplicity im doing it only for DEBUG version .





  1. First we need to build the Coccos2d-x libereris , they need to created in some central place
    So my defualt project is of course the cocos2d-win32.sln which compiles also the cpp-tests
    so compile the Engine .
    d:\dev\cpp\2d\cocos2d-x-3.10\build\cocos2d-win32.sln
  2. When done , create the game project i  call it test1 and i will create it in Projects directory
    which is created in the Cocos2d-x root directory :
    d:\dev\cpp\2d\cocos2d-x-3.10\Projects\test1



    Using the cocos console command :
    D:\dev\cpp\2d\cocos2d-x-3.10\Projects>cocos new -l cpp test1
  3. First thing is delete the test1 cocos2d huge directory .

  4.  Then open the visual studio test1.vcxproj.user and test1.vcxproj 
    in your favorite text editor
    which Located in :
    d:\dev\cpp\2d\cocos2d-x-3.10\Projects\test1\proj.win32\

  5. In test1.vcxproj.user  we going to change the tags :
    <LocalDebuggerEnvironment> </LocalDebuggerEnvironment>
    so it will look like this :
    <LocalDebuggerEnvironment>PATH=..\..\..\..\cocos2d-x-3.10\build\Debug.win32\</LocalDebuggerEnvironment>

    what this means ?
    the PATH is aimed to the Debug output of the :
    d:\dev\cpp\2d\cocos2d-x-3.10\build\cocos2d-win32.sln
    project form section 1.

    The full test1.vcxproj.user look like this :
    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
        <LocalDebuggerWorkingDirectory>$(ProjectDir)..\Resources</LocalDebuggerWorkingDirectory>
        <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
        <LocalDebuggerEnvironment>PATH=..\..\..\..\cocos2d-x-3.10\build\Debug.win32\</LocalDebuggerEnvironment>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
        <LocalDebuggerWorkingDirectory>$(ProjectDir)..\Resources</LocalDebuggerWorkingDirectory>
        <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
      </PropertyGroup>
    </Project>
    
  6. In test1.vcxproj more stuff needs to be changes:
    They all pointing to the main cocos2d-x engine :

    Line 41: pointing to : "..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2dx.props" 
    Line 42: pointing to : "..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2d_headers.props"
    Line 47: pointing to : "..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2dx.props" 
    Line 48: pointing to : "..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2d_headers.props"
    Line 48: pointing to : "libcocos2d.lib;librecast.lib;libbullet.lib;"
    Line 89: pointing to : "..\..\..\..\cocos2d-x-3.10\build\Debug.win32\"
    Line 89: pointing to : "..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2d_headers.props"
    
    


    The full test1.vcxproj look like this :
      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    <?xml version="1.0" encoding="utf-8"?>
    <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <ItemGroup Label="ProjectConfigurations">
        <ProjectConfiguration Include="Debug|Win32">
          <Configuration>Debug</Configuration>
          <Platform>Win32</Platform>
        </ProjectConfiguration>
        <ProjectConfiguration Include="Release|Win32">
          <Configuration>Release</Configuration>
          <Platform>Win32</Platform>
        </ProjectConfiguration>
      </ItemGroup>
      <PropertyGroup Label="Globals">
        <ProjectGuid>{76A39BB2-9B84-4C65-98A5-654D86B86F2A}</ProjectGuid>
        <RootNamespace>test_win32</RootNamespace>
        <Keyword>Win32Proj</Keyword>
      </PropertyGroup>
      <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
      <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
        <ConfigurationType>Application</ConfigurationType>
        <CharacterSet>Unicode</CharacterSet>
        <WholeProgramOptimization>true</WholeProgramOptimization>
        <PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0'">v120</PlatformToolset>
        <PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v120_xp</PlatformToolset>
        <PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
        <PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v140_xp</PlatformToolset>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
        <ConfigurationType>Application</ConfigurationType>
        <CharacterSet>Unicode</CharacterSet>
        <PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0'">v120</PlatformToolset>
        <PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v120_xp</PlatformToolset>
        <PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
        <PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v140_xp</PlatformToolset>
      </PropertyGroup>
      <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
      <ImportGroup Label="ExtensionSettings">
      </ImportGroup>
      <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
        <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
        <Import Project="..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2dx.props" />
        <Import Project="..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2d_headers.props" />
      </ImportGroup>
      <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
        <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
        <Import Project="..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2dx.props" />
        <Import Project="..\..\..\..\cocos2d-x-3.10\cocos\2d\cocos2d_headers.props" />
      </ImportGroup>
      <PropertyGroup Label="UserMacros" />
      <PropertyGroup>
        <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
        <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration).win32\</OutDir>
        <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration).win32\</IntDir>
        <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
        <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration).win32\</OutDir>
        <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration).win32\</IntDir>
        <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
        <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
        <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
        <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
        <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
        <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
        <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
        <LibraryPath>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
        <LibraryPath>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
      </PropertyGroup>
      <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
        <ClCompile>
          <Optimization>Disabled</Optimization>
          <AdditionalIncludeDirectories>$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;..\Classes;..;%(AdditionalIncludeDirectories);$(_COCOS_HEADER_WIN32_BEGIN);$(_COCOS_HEADER_WIN32_END)</AdditionalIncludeDirectories>
          <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
          <MinimalRebuild>false</MinimalRebuild>
          <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
          <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
          <PrecompiledHeader>
          </PrecompiledHeader>
          <WarningLevel>Level3</WarningLevel>
          <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
          <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
          <MultiProcessorCompilation>true</MultiProcessorCompilation>
        </ClCompile>
        <Link>
          <AdditionalDependencies>libcocos2d.lib;librecast.lib;libbullet.lib;%(AdditionalDependencies);$(_COCOS_LIB_WIN32_BEGIN);$(_COCOS_LIB_WIN32_END)</AdditionalDependencies>
          <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
          <AdditionalLibraryDirectories>..\..\..\..\cocos2d-x-3.10\build\Debug.win32\;%(AdditionalLibraryDirectories);$(_COCOS_LIB_PATH_WIN32_BEGIN);$(_COCOS_LIB_PATH_WIN32_END)</AdditionalLibraryDirectories>
          <GenerateDebugInformation>true</GenerateDebugInformation>
          <SubSystem>Windows</SubSystem>
          <TargetMachine>MachineX86</TargetMachine>
        </Link>
        <PostBuildEvent>
          <Command>
          </Command>
        </PostBuildEvent>
        <PreLinkEvent>
          <Command>
          </Command>
        </PreLinkEvent>
      </ItemDefinitionGroup>
      <ItemDefinitionGroup>
        <CustomBuildStep>
          <Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
    xcopy "$(ProjectDir)..\Resources" "$(OutDir)" /D /E /I /F /Y
          </Command>
          <Outputs>$(TargetName).cab</Outputs>
          <Inputs>$(TargetFileName)</Inputs>
        </CustomBuildStep>
      </ItemDefinitionGroup>
      <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
        <ClCompile>
          <Optimization>MaxSpeed</Optimization>
          <IntrinsicFunctions>true</IntrinsicFunctions>
          <AdditionalIncludeDirectories>$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;..\Classes;..;%(AdditionalIncludeDirectories);$(_COCOS_HEADER_WIN32_BEGIN);$(_COCOS_HEADER_WIN32_END)</AdditionalIncludeDirectories>
          <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
          <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
          <FunctionLevelLinking>true</FunctionLevelLinking>
          <PrecompiledHeader>
          </PrecompiledHeader>
          <WarningLevel>Level3</WarningLevel>
          <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
          <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
          <MultiProcessorCompilation>true</MultiProcessorCompilation>
        </ClCompile>
        <Link>
          <AdditionalDependencies>libcurl_imp.lib;websockets.lib;%(AdditionalDependencies);$(_COCOS_LIB_WIN32_BEGIN);$(_COCOS_LIB_WIN32_END)</AdditionalDependencies>
          <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
          <AdditionalLibraryDirectories>..\..\..\..\cocos2d-x-3.10\build\Debug.win32\;%(AdditionalLibraryDirectories);$(_COCOS_LIB_PATH_WIN32_BEGIN);$(_COCOS_LIB_PATH_WIN32_END)</AdditionalLibraryDirectories>
          <GenerateDebugInformation>true</GenerateDebugInformation>
          <SubSystem>Windows</SubSystem>
          <OptimizeReferences>true</OptimizeReferences>
          <EnableCOMDATFolding>true</EnableCOMDATFolding>
          <TargetMachine>MachineX86</TargetMachine>
        </Link>
        <PostBuildEvent>
          <Command>
          </Command>
        </PostBuildEvent>
        <PreLinkEvent>
          <Command>
          </Command>
        </PreLinkEvent>
      </ItemDefinitionGroup>
      <ItemGroup>
        <ClCompile Include="..\Classes\AppDelegate.cpp" />
        <ClCompile Include="..\Classes\HelloWorldScene.cpp" />
        <ClCompile Include="main.cpp" />
      </ItemGroup>
      <ItemGroup>
        <ClInclude Include="..\Classes\AppDelegate.h" />
        <ClInclude Include="..\Classes\HelloWorldScene.h" />
        <ClInclude Include="main.h" />
      </ItemGroup>
      <ItemGroup>
        <ResourceCompile Include="game.rc" />
      </ItemGroup>
      <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
      <ImportGroup Label="ExtensionTargets">
      </ImportGroup>
    </Project>
    


  7. Now we are ready to load the test1.sln to Visual Studio c++  in my case 2013
    Once loaded , delete all other projects except our test1 .

  8. Compile the project and hit F5 to run it and walla !



    The project running !
    Size on disk : 82.4 MB (86,466,560 bytes).

    //TODO
    1 .Now all is left to do is to automate this process to python script .
    2. Cross platform.



Saturday, October 3, 2015

Snake Game Using Cocos2d-x Javascript Desktop - PART 5

Now that the game coding is done we can use the same code base almost without change for our game desktop version.
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:
  1. Visual studio 2013 c++  community version . 
  2. 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++ :
  1. in the projects list on the right select our "SnakeJS" project . 
  2. 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 :


We are ready to build our "SnakeJS" game for iOS the next tutorial :
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


Monday, August 31, 2015

Debug Cocos2d-x HTML5 Project using NetBeans IDE and Chrome browser in 10 easy steps.

For more flexible method to debug  JavaScript in general and in our case Cocos2d-x JS/HTML5
In this tutorial I will use the Netbeans IDE  which is open source java/c++ IDE which have also
Great JavaScript editor / debugger version which is very cool and the Chrome browser.
You can :
Function/variable jumping to definition
Auto complete code that recognize  all Cocos2d-x-js library to speed up the editing process
Code refactor.
Unit tests.
And  many many more ...

1.Download the Netbeans IDE the HTML5 & PHP version

once downloaded install it

2.  Open Netbeans and create new HTML 5 empty project .
Go to File ->  New project  ,
you will see "New Project " popup windows in the Choose Project on the right select
in categories : HTML5 and in Projects: HTML5 Application

Add HTML5 project
Press Next 




3.  In the next window give your application a name , as we going to create new folder
which contain cocos2d-x js-tests replica
I named my project "Cocos2d-test-html5"  i will use this project name as reference in the tutorial .
and gave the path to new folder i named : "NetBeansProjects" i will use this directory name as reference in the tutorial .




Press Finish

4. Now you will see new project created , delete the index.html file,
select the  index.html in the Projects Tab in the left project tree window  and with mouse right click in the opened menu select and click "delete" , in the confirmation windows press Yes.

Delete index.html

5. Now we will create the cocos2d-x  cpp-tests directory tree in our new "NetBeansProjects"  HTML5 project
Go in to the new created "NetBeansProjects"  folder and open the "public_html" folder 
so now you are in :  G:\dev\cpp\2d\cocos2d-x-3.8.1\NetBeansProjects\Cocos2d-test-html5\public_html\

6 . Go in to cocos2d-x  folder in my example it is :
G:\dev\cpp\2d\cocos2d-x-3.8.1\cocos2d-x-3.8.1\
And copy those directory's
```
g:\dev\cpp\2d\cocos2d-x-3.8.1\cocos2d-x-3.8.1\web
g:\dev\cpp\2d\cocos2d-x-3.8.1\cocos2d-x-3.8.1\tests\js-tests\
g:\dev\cpp\2d\cocos2d-x-3.8.1\cocos2d-x-3.8.1\tests\cpp-tests\Resources\
```
Into our NetBeans HTML5 project "public_html" directory.
Which is this : 
G:\dev\cpp\2d\cocos2d-x-3.8.1\NetBeansProjects\Cocos2d-test-html5\public_html\ 

So now your directory structure will look like this :
```
G:\dev\cpp\2d\cocos2d-x-3.8.1\NetBeansProjects
G:\dev\cpp\2d\cocos2d-x-3.8.1\NetBeansProjects\Cocos2d-test-html5
G:\dev\cpp\2d\cocos2d-x-3.8.1\NetBeansProjects\Cocos2d-test-html5\public_html
G:\dev\cpp\2d\cocos2d-x-3.8.1\NetBeansProjects\Cocos2d-test-html5\public_html\web
AUTHORS.txt
Base64Images.js
bower.json
CCBoot.js
CCDebugger.js
CHANGELOG.txt
cocos2d
extensions
external
jsb_apis.js
licenses
moduleConfig.json
README.mdown
template
tools

G:\dev\cpp\2d\cocos2d-x-3.8.1\NetBeansProjects\Cocos2d-test-html5\public_html\tests
G:\dev\cpp\2d\cocos2d-x-3.8.1\NetBeansProjects\Cocos2d-test-html5\public_html\tests\cpp-tests\Resources\
ActionTimeline
animations
audio
background.caf
background.mp3
background.ogg
background.wav
background-music-aac.mp3
background-music-aac.wav
ccb
ccs-res
CocosBuilderExample.ccbproj
CocosBuilderExample.ccbresourcelog
cocosvideo.mp4
components
configs
effect1.raw
effect1.wav
effect2.mp3
effect2.ogg
extensions
fileLookup.plist
fonts
fps_images.png
hd
Hello.png
Images
Manifests
Materials
Misc
music.mid
NavMesh
Particle3D
Particles
pew-pew-lei.wav
Presentation
Shaders
Shaders3D
spine
Sprite3DTest
TerrainTest
Test.html
TileMaps
zwoptex

G:\dev\cpp\2d\cocos2d-x-3.8.1\NetBeansProjects\Cocos2d-test-html5\public_html\tests\js-tests
index.html
main.js
mobilePage.html
New Folder
project
project.json
resjs
src
TestCase.html
```

Go into NetBeans IDE it should refresh automatically and you should see your new project :
New Cocos2d-x html5 Project

7. In NetBeans still in the project window right click on the root project node , and click properties 


8 . In the popup window that opened , 
In the left windows "Categories" click Run  (A)
In the right section click the "Browse" button (B)
To select the "js-tests" index.html chose the index.html and click the "Select File" button (C)




Press "Ok" to confirm .

9 . To complete the Debugging tool chain we need to install Chrome NetBeans extension called :
NetBeans Connector



10 . The Final step!
got to NetBeans click the Green Play button AKA "Run Project" button  ( or F6 )  and it will open new tab in Chrome with the Familiar cocos2d-x project list window .




  

Now you can debug the project just set break point in  main.js which is located here :
```
G:\dev\cpp\2d\cocos2d-x-3.8.1\NetBeansProjects\Cocos2d-test-html5\public_html\tests\js-tests\main.js 
```Press the Play button and watch debugger stop at the break point  .





Happy debugging !