Tiled map not working with Flash target

63 views
Skip to first unread message

MegaLeon

unread,
Aug 17, 2015, 6:49:14 PM8/17/15
to HaxeFlixel

Weird problem here. I started working on a little platformer demo, I'm using Tiled to create the maps. Neko target works fine ( Have not set the camera bounds yet):


However, on the flash target it seems to render only one "strip" of map, it doesn't collide and the character starts falling.


I'm loading my maps in PlayState.hx with an external class helper:
public var map:FlxTilemap;
...

override public function create():Void
{
LevelLoader.loadLevel(this, "test");
...

and LevelLoader.hx:
class LevelLoader
{
static public function loadLevel(state:PlayState, level:String) {
var tmap:TiledMap = new TiledMap("assets/data/"+level+".tmx");
var backLayer:TiledLayer = tmap.getLayer("back");
var mainLayer:TiledLayer = tmap.getLayer("main");

var backset:FlxTilemap = new FlxTilemap();
backset.loadMap(backLayer.csvData, Assets.getBitmapData("assets/tiles.png"), 16, 16, 0, 1);
backset.solid = false;
state.add(backset);

state.map = new FlxTilemapExt();
state.map.loadMap(mainLayer.csvData, Assets.getBitmapData("assets/tiles.png"), 16, 16, 0, 1);
state.map.scrollFactor.set(1, 1);
state.add(state.map);
         }
}

Anyone has a clue of what's going on?



SruloArt

unread,
Aug 18, 2015, 9:48:48 AM8/18/15
to HaxeFlixel
* Can you try that on Windows / Android? And I'm guessing you're using the dev branches? (or is it 3.3.11?)

MegaLeon

unread,
Aug 18, 2015, 10:12:12 AM8/18/15
to HaxeFlixel
Ouch, on windows I get the same broken output as the flash target.

I am on
flixel-addons: [1.1.0]
flixel-tools: [1.1.0]
flixel: [3.3.11]
hxcpp: [3.2.102]
lime: [2.5.2]
openfl: [3.2.2]

SruloArt

unread,
Aug 18, 2015, 10:21:20 AM8/18/15
to HaxeFlixel
Right, so it has something to do with how the .csv is parsed, there's an open issue: https://github.com/HaxeFlixel/flixel/issues/1520 that can be related...for the time being use Array and not .csv if possible.

MegaLeon

unread,
Aug 18, 2015, 11:43:37 AM8/18/15
to HaxeFlixel
Fair enough. Works fine on both flash and windows if I export a base64 map and use TiledLayer.tileArray as you said. Thanks a lot!
Reply all
Reply to author
Forward
0 new messages