Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 610 Bytes

TROUBLESHOOTING.md

File metadata and controls

19 lines (13 loc) · 610 Bytes

Troubleshooting

Uncaught TypeError: Cannot read property 'cache' of undefined

Player sprite does not have reference to main game object.

new Player();           // ERROR
new Player(this.game);  // OK

Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap)'

List of used tileset in map should be defined after map setup.

this.map = this.add.tilemap('example-map');
this.map.addTilesetImage('street');     // MUST BE ADDED