Jump to content

Tiled 1.2.0 (64bit) - Cannot read property '2' of undefined


Markus
 Share

Recommended Posts

Hey Guys,

following problem making me crazy.

I have googled and tryd all out what i have found. I have installed old Tiled Version and so on.

I always getting these "Cannot read property '2' of undefined" error.

 

My Tilemap.json

{ "height":50,
 "infinite":false,
 "layers":[
        {
         "draworder":"topdown",
         "id":2,
         "name":"Objects",
         "objects":[
                {
                 "height":0,
                 "id":1,
                 "name":"Player Spawn",
                 "point":true,
                 "rotation":0,
                 "type":"",
                 "visible":true,
                 "width":0,
                 "x":858,
                 "y":114
                }],
         "opacity":1,
         "type":"objectgroup",
         "visible":true,
         "x":0,
         "y":0
        }, 
        {
         "data":"AAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAE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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
         "encoding":"base64",
         "height":50,
         "id":3,
         "name":"Tiles",
         "opacity":1,
         "type":"tilelayer",
         "visible":true,
         "width":38,
         "x":0,
         "y":0
        }],
 "nextlayerid":4,
 "nextobjectid":5,
 "orientation":"orthogonal",
 "renderorder":"right-down",
 "tiledversion":"1.2.0",
 "tileheight":50,
 "tilesets":[
        {
         "columns":0,
         "firstgid":1,
         "grid":
            {
             "height":1,
             "orientation":"orthogonal",
             "width":1
            },
         "margin":0,
         "name":"CaveTiles",
         "spacing":0,
         "tilecount":2,
         "tileheight":50,
         "tiles":[
                {
                 "id":0,
                 "image":"assets\/images\/tiles\/black_cave_bg.png",
                 "imageheight":50,
                 "imagewidth":50
                }, 
                {
                 "id":1,
                 "image":"assets\/images\/tiles\/gray_cave_bg.png",
                 "imageheight":50,
                 "imagewidth":50
                }],
         "tilewidth":50
        }],
 "tilewidth":50,
 "type":"map",
 "version":1.2,
 "width":38
}

 

My Code Implementation

var config = {
    type: Phaser.AUTO,
    width: 500,
    height: window.innerHeight,
    backgroundColor: '#2d2d2d',
    physics: {
        default: "arcade",
        arcade: {
            debug: true,
            gravity: { y: 0 }
        }
    },
    scene: {
        preload: preload,
        create: create,
        update: update
    }
};

var player
var cursors;
var tilemap;
var game = new Phaser.Game(config);

function preload() {
    this.load.image('background', './assets/images/game_background_2.png');

    this.load.tilemapTiledJSON('map', './lvl3.json');
    this.load.spritesheet('tiles', './assets/tilemaps/TilesImage.png', { frameWidth: 50, frameHeight: 50 });

}

function create() {

    this.add.image(0, 0, 'background').setOrigin(0, 0);

    map = this.make.tilemap({ key: 'map' });

    const spawnPoint = map.findObject("Objects", obj => obj.name === "Player Spawn");
    player = this.physics.add.sprite(spawnPoint.x, spawnPoint.y, "atlas");

    player.setVelocity(100, 200);
    player.setBounce(1, 1);
    player.setCollideWorldBounds(true);

}

function update() {

}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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