Jump to content

phaser.io + cloud9 help(noob)


tiresandplanes
 Share

Recommended Posts

Can someone please explain to me like I'm 5 years old how to make phaser.io run with cloud9? I've already cloned the github repos. into cloud9, but I'm not sure how I can host a server through that? I'm a google chrombook so I'm not able to download any type of .exe that would allow me to locally host a server. 

Link to comment
Share on other sites

Hi,

I'm not sure what you mean by getting Phaser.io to work on cloud9, so I'll tell what I know and hope what you need it's in there somewhere. This is how to copy all the Phaser examples to cloud9 to play around with

 

1. Your project has to be public, otherwise you won't be able to view it 

2.  Just supplying the url of the github repository when creating a new project doesn't work I think , instead, create a new empty  project, (public!) and clone the repository from the command-line, ie enter 

git clone https://github.com/photonstorm/phaser-examples.git

3. To view the examples, you open the index.html file in the editor (it's in the examples/ directory) and click "preview". This will open the page in the browser.

4. If what you wanted was just to get your own project to run in cloud9, it's the same procedure. Create an index.html file that loads phaser.js and your own js files, and "preview" the index.html file.

5. There's a post around here somewhere where I got help with the same problem, but I can't find it now. I use Chrome, I belive  there was some additional weirdness when I tried do this in Firefox.

Link to comment
Share on other sites

  • 6 months later...

Hey there, I am also a Phaser.io noob, but I am pretty familiar with cloud9 so let me try to explain the problem a little better since I am having the same problem too. There is no obvious way in cloud9 to run code. If you go to the hellophaser.html file, you can run that file, but all you get is an index of all the files ever. From there, I tried entering into the address bar for the cloud9 the /hellophaser addition that is perscribed in the getting started tutorial. This renders a page not found error. So. I guess the question is how can someone run code in an already set up phaser repository on cloud9?

Link to comment
Share on other sites

Okay. I can now shed some light on it now that I putzed around with it for a while. Here's what you want to do. Go down to your little console in your cloud9 environment, open and copy the hellophaser folder into the home directory.

 

The command should look look something like this:

cp -r resources/tutorials/01\ Getting\ Started/hellophaser .

That's not super human readable, so I'm going to explain to you what's happening in case you ever need to do a similar operation.

 

First of all This is your copy command:

cp

It can copy stuff from one place and put it into another place. But the cp command does not by default move entire directories. So we need to tell cp to dive into the directory and copy all the stuff in there to the new thing as well. We do that with this flag:

-r

Flags are just little modifications that we make to commands. -r stands for recursive.

 

The next part is a little hairy:

resources/tutorials/01\ Getting\ Started/hellophaser

This just tells cp where to find the stuff that needs copying. The strange part that you might wonder about is the backslashes. Those are just escape characters to let cp know that the spaces are not us moving onto the next part of the command, but instead is still a part of the location that we want to copy.

 

Our final step looks straightforward:

.

But it doesn't mean what you might think at first glance. In english, a period marks the end of a sentence. A command to a computer is like a command in the form of a sentence, but we don't end computer sentences with periods when we're talking to the computer. We use the enter key or the return character. So what does this period mean? It's actually a directory. It's the directory where you are located right now, where you are running the command. So if you use this symbol it will be in the folder that contains your project, which in this case will likely be "~/workspace" where the tilde or "~" is the project domain space for your specific project, or in other words "phaser".

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...