Jump to content

TypeError - Undefined not a function


Recommended Posts

Hi, I have some, error I think it maybe to do with the way the page loads, I'm just setting up a new phaser game having learnt everything I feel I need to as I setup the base structor to being writing my game I get thrown this;



	<script src="jquery.js"></script> 	<script src="phaser.js"></script></head><body><script>	var game = new Phaser.Game(640, 480, Phaser.CANVAS, 'DungeonRPG', { preload: preload, create: create, update: update, render: render }); 	function preload() {	 	game.load.tilemap('level1', 'assets/levels/level1.json', null, Phaser.Tilemap.TILED_JSON);	    game.load.tileset('tiles', 'assets/tiles/tileset.png', 16, 16);	    // game.load.spritesheet('hero', 'assets/hero.png', 32, 48);	    // game.load.image('background', 'assets/tiles/bg.png');	}	var bg; 	function create() { 		game.stage.backgroundColor = '#000000';		bg = game.add.tileSprite(0, 0, 640, 480, 'background');    	bg.fixedToCamera = true; 	} 	function update() {	}	function render(){	}</script>
Link to comment
Share on other sites


  • Recently Browsing   0 members

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