Jump to content

Search the Community

Showing results for tags 'phaser javascript html5'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. For the past few days, I have been unable to get phaser to work: just trying to test a hello world program. I've followed the directions on phaser's site exactly, and it still isn't working for me. I am using node.js. Here is index.html: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Hello World</title> <style> #game_div { width: 500px; margin: auto; margin-top: 50px; } </style> <script type="text/javascript" src="phaser.min.js"></script> <script type="text/javascript" src="main.js"></script> </head> <body> <div id="game_div"> </div> </body> </html> Here is main.js: /*jslint node: true */ "use strict"; var game = new Phaser.Game(400, 490, Phaser.AUTO, 'game_div'); var main_state = { preload: function () { game.load.image('hello', 'assets/hello.png'); }, create: function () { this.hello_sprite = game.add.sprite(200, 245, 'hello'); }, update: function () { this.hello_sprite.angle += 1; } } game.state.add('main', main_state); game.state.start('main'); The error it gives me is: 'Phaser' was used before it was defined. var game = new Phaser.Game(400, 490, Phaser.AUTO, 'game_div'); I've really tried looking for solutions to this, but I can't find anything wrong. I'm pretty new to javascript and phaser.
×
×
  • Create New...