Jump to content

Problem with paser.js


ruttydm
 Share

Recommended Posts

first of all, sorry for my english below :D

 

I have a problem with phaser.js.

 

I use xampp

 

index.html :

<!doctype html><html><head>  <title>Pairs</title></head><body>  <div id="pairs-game" class="game"></div>  <script src="phaser.min.js"></script>  <script src=”game.js”></script></body></html>

game.js:

<!doctype html><html><head>  <title>Pairs</title></head><body>  <div id="pairs-game" class="game"></div>  <script src="phaser.min.js"></script>  <script src=”game.js”></script></body></html>

in browser at localhost page, it gives me the error :

 

Can anyone help me, i want to create a game, but it's not posible due this.

Link to comment
Share on other sites

Quote marks?

 

the code:

(function() {  ‘use strict’;  function Game() {}  // variables will go here later  Game.prototype = {    preload: function() {    },    create: function () {    },    update: function () {    },    render: function() {      }  };  var game = new Phaser.Game(800, 520, Phaser.AUTO, ‘pairs-game’);  game.state.add(‘game’, Game);  game.state.start(‘game’);}());
Link to comment
Share on other sites

Also in your game.js file all your apostrophes have been formatted. Which editor are you using?

 

Try this...

(function() {  'use strict';  function Game() {}  // variables will go here later  Game.prototype = {    preload: function() {    },    create: function () {    },    update: function () {    },    render: function() {    }  };  var game = new Phaser.Game(800, 520, Phaser.AUTO, 'pairs-game');  game.state.add('game', Game);  game.state.start('game');}());
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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