Cocos2d Js hungry hero blank screen - cocos2d-x

I was trying to run the web version of hungry hero on my web hosting. But after I use "cocos compile -p web -m release" command to compile the cocos2d-Js and upload to my web hosting It displays the black screen. How could I solve this issues?
I'm using cocos2d-Js v3.0 rc3 on my system.
Here is the link to hungry hero on GitHub: https://github.com/kenkozheng/cocos2d-js/tree/master/hungry_hero
Any help is appreciate!

you should add your js files into project.json, the value of key "jslist" is an array which contains all your js files.
i think you have no idea about what the command "compile -p web -m release" doing
there is no need to run this command, if you just want to see your project work
it's used to compile all your js files into one compiled js file before publishing

Related

Is there a way I can run my tailwind CSS website outside the visual studio code IDE and Live server?

I created a website using HTML, JS and tailwind CSS. The tailwind CSS was installed using the CLI tool following the procedures in the documentation and is working fine when the page is executed with live server in Visual Studio Code.
npm install -D tailwindcss
and then created a tailwindcss.config.js with
npx tailwindcss init
Now the problem is, how do I share this whole website to a friend so that he can simply run the index.html file and he sees a completely working website running the tailwindcss code too without him having to install and configure tailwindcss. Or if there is a way to export the project with all installed packages.
Because so far, it just runs the plain html code whenever I try to share the whole project or even if I simply try to execute the page outside VsCode.
what I see from VsCode live server
what I see when running the page outside VsCode
Perhaps a possible solution to share is to host a live project on an online editor, this example uses Vite to build an environment for Tailwind and Vanilla JavaScript, it does not have much configurations but can be forked to try.
If other tools are preferred, consider start a new project in such online editor from a template with Tailwind, or start a new Node.js project and use the terminal to install needed packages.

how to run dotnet core's standalone program on mac

a rudimentary question, but please let me know.
I want to run the following program which will process and return the result by json when accessed by GET or POST.
FileManagerController.cs
For example, in PHP you just need to place it in the htdocs folder of Apache.
I would like to do the same thing with dot net core mvc.
but I don't know what kind of words to search.
Also, in the near future we would like ruby to work the same way in another project.(In a way that doesn't use a framework such as rails)
So, please tell me how to find out how to run various languages alone on a web server.
You need to make a "project" (file type .csproj) that you can build and run on your machine. Check out the Getting Started with ASP.NET page for instructions to install the SDK and create a new project and run it.
To run your code file above, you can:
$ dotnet new mvc
Copy the above FileManagerController.cs file into the generated Controllers folder.
$ dotnet run
Your app will be running on http://localhost:5000, you can hit your web site using the url /FileManager.

Converting .Xcodeproj file to .Apf file

I am developing a game in xcode using cocos2d-x i want to convert the .xcodeproj file to .apk file for that i use the Stella SDK. after download the package I try to configure it. But i am getting the following error, I typed in terminal.Please help me.
mac-man:~ srikanthreddy$ cd / opt
mac-man:/ srikanthreddy$ git clone https://github.com/morningtec/StellaSDK.git
fatal: could not create work tree dir 'StellaSDK'.: Permission denied
You are trying to clone the git project into /opt which is a directory that you may not have write permission for.
Usually you'd create such projects in your home directory, so try this instead:
mkdir ~/StellaSDK
cd ~/StellaSDK
git clone https://github.com/morningtec/StellaSDK.git
Note that this step is only cloning the StellaSDK project, it has nothing to do with the task you described (creating an .apk file). From that I take it you haven't fully understood that StellaSDK is a game engine / framework just like cocos2d-x, so you can't use that to create an .apk file unless you start a new project. In particular you can't just convert a .xcodeproj to work with Stella SDK, there is no automatism like that.
While at the same time cocos2d-x is a cross-platform engine capable of creating Android .apk apps. The reason why you're trying to use Stella for (or in place of?) an already existing cocos2d-x project is a bit of a mystery to me.

Using "cocos run" command with cocos2d-js 3.0alpha on sample js-moonwarrior

I just discovered that the new commandline in cocos2d-js (3.0alpha on OS X 10.9.2) is awsome. With two commands you can create a project and then deploy it on web, android, ios and mac. I tried web and android and it worked instantly.
Then I tried to run the sample game js-moonwarriors which comes together with the framework using
cocos run -p android
from within the project directory. But it stops with the error:
Can't find the projects directories in this project.
No idea. What is missing?
Update: cocos2d-js 3.0alpha2 is out and everything is working fine.
I got an answer to that from cocos2d-x forum:
Hi, this functionality is missing in 3.0 alpha, but tomorrow we will release 3.0 alpha2, and the issue have been solved, you can use cocos command to compile and run js-tests and moon warriors.
Apparently alpha 2 has not been released yet, and I cloned their git branch and it's still not fixed. I suspect it's due to the lack of "framework" directory, so I tried:
ln -s ../../frameworks .
ln -s ~/prj/c2x/cocos2d-js/samples/js-tests/project frameworks/runtime-src
Unfortunately instead of showing samples, it simply shows Hello World. I even did
rgrep . 'Hello World'
And pretty sure the string is not there. Weird.

How to retain comments even after generating apk file

Hi I am using sencha touch 2 framework and i need to retain comments in the code even after building apk file using the following command "sencha app build native".
When i get app.js after building apk file it contains all code apart from whatever i commented in code. So is there any tool or configuration or option to retain comments in the code.
Not with sencha command, you would have to build your apk in eclipse, sencha does offer an IDE plugin for eclipse... it doesnt take long to do and you can figure it out off of this tutorial: http://andidog.de/blog/2012/06/packaging-a-sencha-touch-2-application-with-phonegap-for-android/