How can I execute cocos2d-js html file? - cocos2d-js

I made a cocos2d-js project on OSX.
And I debuged it on WebStorm.
It worked well.
So I just clicked index.html file. but it didn't work. just black screen.
I put all files on the web server and tried again.
Web brower console said http://localhost:8080/html5/project.json 404 not found.
but the file was in same folder.
I want to execute it on local server and just click.
What should I do?

Go to the project directory, start new terminal.
Then: cocos run -p web
This will run your game for Web, as -p stands for platform
Also note, that sometimes you will need to clear the browser's cached images and files after changes that affect files or images.

Related

Why isn't Drupal recognizing my new twig files?

I want Drupal to recognize my new twig files. Trying to clear the cache with the
drush cr
command gives me a success message. So does manually clicking on "Flush all caches" from the menu. But my new twig files are not being recognized. I was able to clear caches for weeks perfectly fine and it recognized twig files until now. I am using ddev to run my server. I have stopped and restarted the server. Restarted docker. I am using development.services.yml, not services.yml, which from my research I believe is correct. I am also exporting my settings.local.php from my settings.php.
I would like for Drupal to recognize my twig files. Neither clearing the cache by command line with
or manually works. No part of the configuration was changed it just stopped working suddenly.
Most probably, it’s related with permissions.
Resetting permissions, perhaps like described in
After drupal update site throws HTTP ERROR 500
might work,

Corodva serve command just reset the app erasing all my changes

I use the command cordova serve to test the app in browser. But when I issue the command, I find all the code changes I made to the app has been disappeared include newly added js files etc. The app just got a complete reset. How can I avoid this and still use cordova serve command to test in browser? Thanks.
I got the issue resolved. It took sometime to figure out what is happening under the hood. As I was making changes directly in platform IOS directory, the cordova prepare or serve statement just replaces the code from the parent www folder.
To conclude, I have to make changes in root www folder and then issue the prepare/serve command that copies the code to the platform to test it out.

OwinHost.exe from command line - how to make it start on a different port?

Yes, I have looked on google for this seeming simple question w/o much luck.
So my project includes the OwinHost (OwinHost.exe) NuGet package, and this has updated my project in such a way as to allow the Visual Studio IDE, via property pages, to specifically launch OwinHost.exe using whatever url:port I've specified on the 'Web' tab.. .. but since this is currently error-ing out and closing the cmd window before I can see the error.. I thought I'd try to run OwinHost.exe manually...
I know how to cd to my web project's bin folder and then call out to the appropriate packages subdir to OwinHost.exe to make it start listening for web requests. But, it listens on port :5000 and I want to change this.
Ugh.. just figured it out... the -u switch..
..\..\packages\OwinHost.3.1.0\tools\OwinHost.exe -u https://localhost:443/

Wampserver sql dump

I know this has been asked many times before. But I am getting a:
The mbstring extension is missing. Please check your PHP configuration.
First off I am using WanmpServer3.0.0 64 on a Win7 64 VM.
-I tried editing the php.ini file to give an absolute path to no avail
-made sure that the extension=phpmbstring.dll is uncommented
Another problem is that i noticed that whenever i load a php page it has fatal errors for my mysql commands.
When I use the wampmanager from the tray to open the php.ini file instead of through windows explorer I get:
Cannot find the C:\wamp64\bin\apache\apache2.4.17\bin\php.ini file. Do you want to create a new file?
So now I'm thinking something has gone drastically wrong and would like to uninstall/reinstall Wamp. I attempt to use the mysql console to save my databases before deleting the wamp directory. However when I run a mysqldump -all-databases > all_database.sql it just drops down to an empty line and nothing happens.
mysql console screenshot
If I browse around in the C:\wamp64 directory i find the "data" directory within \bin\mysql where it seems all of my databases reside but not in readable form.
Is there anyway to save my databases??
BTW: This whole setup was working fine previously, so I'm not sure what caused the crash and burn.
Was able to figure it out.
I opened the php.ini file from the PHP bin folder and copied all of the contents into a new php.ini file to reside in the apache bin file.
Now everything works again.
I'm not sure this is how wampserver is supposed to work or what changed to start the problem but it's pseudo-resolved now.

Trigger.io continuous development

I'd like to know if there is any way to develop continuously with Trigger.io and avoid the forge build step with every file change I want to test in my browser or simulator.
I was faced with the same problem and I've got a working solution that uses watchr and watch to automatically rebuild each time I make a change to a source file. If you are running a "web" version of your app you can make a change to a source file and go directly to your browser and see the effect of your changes fairly quickly depending on how long the build takes.
Prerequisites: Ruby, watchr, Unix 'watch', and a terminal.
gem install watchr.
create a new ruby file for watchr to know what files to monitor and what to do when it sees a change. I named my file 'my_watch.rb': https://gist.github.com/3153167
open two terminals. Terminal 1 will run watchr and Terminal two will run 'forge build ...'.
In terminal 1 run 'watchr my_watch.rb' making sure the path to my_watch.rb is correct and make sure you've edited my_watch.rb according to your setup so that the path inside watch(...) reflects the files to be watched. My example watches all files in the same directory (and beneath) as the my_watch.rb script. You can place my_watch.rb in the 'src' folder of your Trigger.io app if you want to match my example and run watchr my_watch.rb directly from the src folder. Also not the shell command and path in the block need to be updated to reflect your environment. Again, in my example 'my_watch.rb' is inside 'src/' so when a change is detected we go up one directory and call 'forge build'.
I tend to develop actively with the 'web' version of my app so I can just open terminal 2 to my forge project directory and 'forge run web'. When I am testing in simulators and on devices, yes I have to run forge build every time I want to see a change. However, I typically don't have to wait for forge build to finish because watchr kicked off the build as soon as I made a change and it happens pretty quickly.
I know this is not an ideal solution but so far developing new features in the 'web' version first and then implementing in mobile versions has been very smooth for me. I've never needed to kill the 'web' version after a build but I maybe just lucky. As for running build each time you want to test the mobile versions if you are good with your keyboard shortcuts it really isn't bad at all. XCode makes you build and run after changes are made to source code when creating native iOS apps so I don't think Trigger is unique in requiring this build step.
I hope this helps and that my answer isn't too specific to me and my setup.
The build phase makes some changes to your source to enable the forge.* APIs - therefore, trying to just use the raw files in your src directory won't work.
You may be tempted to change files directly in the development directory, but this is a pretty bad idea: we delete those files with impunity when we need to!
We have plans on our medium-term roadmap to add a file-system watcher to start builds automatically when changes have occurred.
In the meantime, I just use forge build && forge run PLATFORM which tends to only take a few seconds...
while not perfect... this works for me.
go into development/web
rm src
link to your root src, ie ln -s ../../src src
copy the all.js from the web/forge and add to your index.html
ie
start nodemon web.js
open in browser.
note you will need to comment out the all.js script tag for non web builds.

Resources