Jump to content

Overlap between sprite and tiles.


AramCP
 Share

Recommended Posts

1 hour ago, thefailtheory said:

the feature is to create a layer for the overlaped tiles (i mean the sprite can be under them)

Saying that you solved my problem xD. I created another layer for the overlaped tiles, and defined it under the character, making the layer to be above him. 

 

    layer1 = map.createLayer('Capa1');
    layer2 = map.createLayer('Capa2');
    layer3 = map.createLayer('Capa3');
    layer1.resizeWorld(); 


	jugador = juego.add.sprite(1000, 930, 'red');

    layer4 = map.createLayer('Capa4'); //As you can see i create the layer under the sprite.

    map.setCollisionBetween(46, 47, true, layer2);
    map.setCollisionBetween(95, 101, true, layer3);
    map.setCollisionBetween(32, 38, true, layer3);
    map.setCollisionBetween(102, 105, true, layer3);
    map.setCollisionBetween(81, 84, true, layer3);
    map.setCollisionBetween(60, 63, true, layer3);
    map.setCollisionBetween(69, 73, true, layer3);
    map.setCollisionBetween(48, 51, true, layer3);
    map.setCollisionBetween(6, 10, true, layer3);

 

Yeah, and now it works, the next step is to make a grid-movement system, wish me good luck, cuz i will need it

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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