Jump to content

Created "example" game - blank page and "Uncaught TypeError"


alteredMethod
 Share

Recommended Posts

Hello,
 
I downloaded a copy of phaser and threw it in my MAMP folder - started my local web server. And then created a basic game.html file + game.js + phaser.js.
 
game.html looks like this:
 

<html>	<head>		<script src="phaser.js"></script>		<script src="game.js"></script>	</head>	<body>		<div id="game"></div>	</body></html>

 
game.js looks like this: 
 

var headImage;var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });function preload() {	game.load.image('head', 'head.png');}function create() {}function update() {}

I opened in chrome, and am seeing a blank page with the following error in the console: "Uncaught TypeError: Cannot read property 'style' of null"

 

I'm not sure what I'm doing wrong.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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