ruttydm Posted September 5, 2015 Share Posted September 5, 2015 first of all, sorry for my english below 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 : GET http://localhost/%C3%A2%E2%82%AC%C2%9Dgame.js%C3%A2%E2%82%AC%C2%9D 404 (Not Found) Can anyone help me, i want to create a game, but it's not posible due this. Quote Link to comment Share on other sites More sharing options...
rich Posted September 5, 2015 Share Posted September 5, 2015 The error is right up there - it doesn't work because it can't load game.js. Probably because the quote marks around "game.js" are wrong. Look at them compared to those around phaser.min.js. Look at the 404 error, the clues are all there. Quote Link to comment Share on other sites More sharing options...
ruttydm Posted September 6, 2015 Author Share Posted September 6, 2015 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’);}()); Quote Link to comment Share on other sites More sharing options...
rich Posted September 6, 2015 Share Posted September 6, 2015 No look at the error. 404 means it didn't even get to load the game.js file, so it's irrelevant what code is inside it, it never got that far. The error is the quote marks in your html file around game.js. Quote Link to comment Share on other sites More sharing options...
ruttydm Posted September 6, 2015 Author Share Posted September 6, 2015 Now i have 2 404 errors.<!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> Quote Link to comment Share on other sites More sharing options...
everuniverse Posted September 8, 2015 Share Posted September 8, 2015 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');}()); Quote Link to comment Share on other sites More sharing options...
demisephi Posted September 8, 2015 Share Posted September 8, 2015 problem with 'paser' ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.