Jump to content

Search the Community

Showing results for tags 'Simple tilemap'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. 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
×
×
  • Create New...