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

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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