Jump to content

How to use phaser with meteor


Nokdu
 Share

Recommended Posts

Hi.

 

I thought I might as well contribute to the community.

 

I've been wanting to use phaser with meteor(https://www.meteor.com/) and last night.. or rather this morning i created a quick package for meteor.

 

so.. using meteor. (on a nix based.. sry.. i don't work on windows .. just play games on it :D)

 

1. install it 'curl https://install.meteor.com/ | sh' 

 

1.a  get meteorite too using 'npm install -g meteorite'

 

2. create a meteor app by doing 'meteor create app-name'

 

3. move to created app directory 'cd app-name'

 

2. get the phaser package for meteor.. it will install the latest 'master' for you. 'mrt install phaserio'

 

and you get phaser in meteor.

 

You can put all your code in the 

if (Meteor.isClient) {    Template.game.game = function(){       /*all your game code here*/   }}

and then in the html file

 

do 

<head>  </head><body>  {{> game}}</body><template name="game">	{{game}}</template>

why all this? you would say.. 

 

well.. 

 

meteor has an easy accounts system.. and it has mongodb on the backend.. sooo.. i can easily create leaderboards.. and save user data...

 

anyway i wish this helped somebody 

Link to comment
Share on other sites

Yeah just made it to the #1 with 38500 supercoins and more than 100.000.000 points ;) Highscore is so hard in games when the game logic itself can be placed on the server.

 

But well done for the beginning. I'm doing a lot of Ruby and Rails but I bet I will like Meteor too- just because of the JS.

 

Regards

George

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...

hi, 

 I have a problem. when I create a meteor project and then run "meteor add phaserio" I get problems:

 

mrt add phaserio
✓ phaserio
 
Done installing smart packages
 
Stand back while Meteorite does its thing
 
Done installing smart packages
 
Ok, everything's ready. Here comes Meteor!
 
=> Errors while scanning packages:
 
While building package `phaserio`:
error: File not found: phaser/build/phaser.js
 
/usr/lib/node_modules/meteorite/lib/command.js:41
            throw "Command exited with " + code + "/" + signal;
                                                      ^
Command exited with 1/null
 
 
can anybody help me, please?
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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