Matheeus Posted October 14, 2016 Share Posted October 14, 2016 Hi, I'm new with Phaser and this plugin, I'm actually exploring his possibility. I'm planning to make an isometric MMO in HTML5, and I need to make "spaces" that aren't only squares or rectangles, but also their composition, something like this: with a tileMap like this: var tileMap = [ [t1, t1, t1, t1, t1], [t1, t1, t1, t1, t1], [t1, t1, t1, t1, t1], [t1, t1, t1, t1, t1], [t1, t1, t1, t1, t1], [0, t1, t1, t1, 0], [0, t1, t1, t1, 0], [t1, t1, t1, t1, t1], [t1, t1, t1, t1, t1], [t1, t1, t1, t1, t1], [t1, t1, t1, t1, t1], [t1, t1, t1, t1, t1] ] Is this possible with the Phaser's Isometric plugin? Someone already achieved this? Link to comment Share on other sites More sharing options...
lewster32 Posted October 19, 2016 Share Posted October 19, 2016 If I understand you correctly, this is pretty much what I did in the homepage example: http://udof.org/phaser/iso/ (see the source here). Link to comment Share on other sites More sharing options...
Kseiver Posted May 1, 2017 Share Posted May 1, 2017 I use the program "Tiled". After creating a scene, save as orthogonal and change the width of the Map in Tiled to 32. Use Phaser and Isometric plug in to load the map. I create a function to walk through JSON file and load the layers. function buildMapIso (map, witchTileset, witchLayer, deltaX, deltaY, imageLoaded, group, game, collide) { Var deltaTileIndex = map.tilesets [witchTileset] .firstgid; Var mapColls = map.layers[wichLayer].width; Var mapRows = map.layers[wichLayer].height; Para (var coll = 0; coll <mapColls; coll ++) { Para (var row = 0; row <mapRows; row ++) { If (mapa.hasTile (coll, row, witchLayer)) { var tile = map.getTile( coll, row, witchLayer); var witchSprite = tile.index - deltaTileIndex; posX = coll * mapWidth; posY = row * mapHeight; var theSprite = jogo.add.isoSprite(posX, posY, 0, imageLoaded, witchSprite , group); game.physics.isoArcade.enable( theSprite); if( collide ){ theSprite.body.collideWorldBounds = true; } theSprite.body.immovable = true; theSprite.anchor.set(0.5); } } } } Link to comment Share on other sites More sharing options...
Recommended Posts