Jump to content

World size and tilemap with Isometric Plugin


Kseiver
 Share

Recommended Posts

I made two maps with Tiled, start with Isometric then I have changed to Ortogonal and set the width to 32 pixels. I have a Javaascript function to read the JSON map and use "game.add.isoSprite" to show the sprites in Browser.

 

When did I make maps with diferent sizes it didn't work in the same way.

First town map (Stade 1):
widh: 14 pixels
height: 20 pixels

this.hero.anchor.setTo( 0.5 );

 

Second town map Stade 2:
widh: 20 pixels
height: 8 pixels

this.hero.anchor.setTo( 1.1 );

I set up the anchor with diferent value and then then hero walk over the map.

    // Set the First world size
    this.game.world.setBounds( 0, 0, (14+2) * 64, (20+2) * 32);

    this.game.physics.startSystem(Phaser.Plugin.Isometric.ISOARCADE);
    this.game.physics.isoArcade.bounds.widthX = 14 * 32;
    this.game.physics.isoArcade.bounds.widthY = 20 * 32;

    // Set the Second world size
    this.game.world.setBounds( 0, 0, (2 + 20) * 64, (2 + 8) * 32);

    this.game.physics.startSystem(Phaser.Plugin.Isometric.ISOARCADE);
    this.game.physics.isoArcade.bounds.widthX = 20 * 32;
    this.game.physics.isoArcade.bounds.widthY = 8 * 32;

 

//Loop

var oSprite = jogo.add.isoSprite(posX, posY, 0, 
                  imagemCarregada, 
                  qualSprite , 
                  group); 

oSprite.anchor.set(0.5);


//hero
this.hero.game.add.isoSprite(x, y, 0, loadImage, imagem , grupo);  


//In the First Map
this.hero.anchor.setTo( 0.5 );

//In the Second Map
this.hero.anchor.setTo( 1.1 );

 

I use a lot of values and didn't work equality in two maps.

My englsh isn't good.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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