Help with tutorial LoadMapFromArray

  • Hi there,

    I'm struggling to get a Tiled map to load following the tutorial.
    I've also tried some methods mentioned on random blog posts, but unfortunately most of them are outdated.

    This is what I currently have in PlayState to load the map:

    _map = new TiledMap(AssetPaths.my_map__tmx);
    		_mWalls = new FlxTilemap();
    		_mWalls.loadMapFromArray(cast(_map.getLayer("walllayer"), TiledTileLayer).tileArray, _map.width, _map.height, AssetPaths.tileset__png, _map.tileWidth, _map.tileHeight, FlxTilemapAutoTiling.OFF, 1, 1, 3);
    		_mWalls.setTileProperties(1, FlxObject.NONE);
    		_mWalls.setTileProperties(2, FlxObject.ANY);

    When I run the project - the tiles do not show up and I get no errors, the player appears and I'm able to control him.
    I apologise if this is a duplicate of a post - I have searched the forum, but could not seem to find something to point me in the right direction.

  • @fried

    Maybe you are mixing up the 2 map options shown in the tutorial?

    Look at 4. and 5. and notice the changes you need to make depending on the map choice you're using.

    Maybe it will help to view the source of the demo to see what's going on.
    The source link is on the Conclusion page of the tutorial.

    Hope it helps

  • @fried said in Help with tutorial LoadMapFromArray:



    Thanks for the reply. I am using the Tiled map editor.
    I will do a bit more research and look at some of the demos a bit more.

Log in to reply

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.