fiverivers Posted May 29, 2014 Share Posted May 29, 2014 Here is my code: <!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /><title>Phaser - Making your first game, part 1</title><script type="text/javascript" src="js/phaser.min.js"></script> <style type="text/css"> body { margin: 0; } </style></head><body></body></html> var game = new Phaser.Game(500, 600, Phaser.AUTO, 'game_div'); var main_state = { function: preload() { game.load.image('bman', 'bman.png'); } function: create() { this.bman_sprite = game.add.sprite(250, 300, 'bman'); } function: update() { }} game.state.add('main', main_state);game.state.start('main'); I'm just presented with a blank screen. I am hosting with XAMPP. Link to comment Share on other sites More sharing options...
ChubbRck Posted May 29, 2014 Share Posted May 29, 2014 Hi there, Doesn't <div class = "game_div"></div> have to exist somewhere on your HTML page? Link to comment Share on other sites More sharing options...
Heppell08 Posted May 29, 2014 Share Posted May 29, 2014 you need to add the src for the game.js in the index.<script src="Game.js"></script>so it would be:<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /><title>Phaser - Making your first game, part 1</title><script src="phaser.min.js"></script><script src="game.js"></script> <style type="text/css"> body { margin: 0; } </style></head><body></body></html>Assuming your game file is called game.js anyway. Link to comment Share on other sites More sharing options...
Recommended Posts