HTML <!DOCTYPE HTML><html><head> <meta charset="UTF-8" /> <title> </title> <script src="phaser.js"></script> <script src="game.js"></script></head><body> <div id="phaser"></div></body></html>game,js (function (Phaser) { _width = window.innerWidth; _height = window.innerHeight; var game = new Phaser.Game(_width, _height, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload() { game.load.tilemap('MyTilemap', 'maps/firstMap.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('tiles', "maps/terrain_atlas.png"); } var map; var layer; function create() { // Load the map. map = game.add.tilemap('MyTilemap'); map.addTilesetImage('tiles', 'tiles'); layer = map.createLayer('MyTerrain'); layer.resizeWorld(); layer.wrap = true; cursors = game.input.keyboard.createCursorKeys(); } function update() { if (cursors.left.isDown) { game.camera.x -= 8; } else if (cursors.right.isDown) { game.camera.x += 8; } if (cursors.up.isDown) { game.camera.y -= 8; } else if (cursors.down.isDown) { game.camera.y += 8; } }}(Phaser));And the problem is phaser.js:85874 Uncaught TypeError: Cannot read property '0' of undefined