Uncaught TypeError: Cannot read property 'height' of undefined for a phaser game, using a Tiled map


It looks like you’re trying to add tileset images under the wrong names (groundtop1, player1).

Expand the Tilesets: … list in the console to see what the names are.


I have renamed the tileset images, and now the browser comes up with an error related to cache and width:


So this one is is phaser related. When you declare a gameobject in your preload method you have to call it with its key in the create or update


Which parameter is the key? Is it the first or the second?


This is the basic example to understand the key feature https://phaser.io/examples/v2/basics/01-load-an-image


I have now tried to stay consistent with the example you sent, but the error persists


The width error is an error you mentionned early in this thread, for me it still means that you haven’t initialised your variable, but it’s a javascript error


Ok, then what could must I add, as I am completely unsure at this point?


If you can share your game on GitHub or dropbox or even a zip file in the forum it will be easier


ok sure, i’ll try and zip it



So here is a little bug hunting of your code on my YouTube Channel