gferrari Posted May 21, 2014 Share Posted May 21, 2014 Hi everybody, I have two sprites, with physic enabled and I set the x velocity both, and they collide with the limite of game world without problem and without overlapping if they are in the same x line. But If they collide with a tilemap, the first sprite is ok, but the next when arrive with the first sprite... it's overlapping with the first. I'm using ARCADE physic and Phaser, the last version, v2.0.5 I don't have the code right now but I remember that: //In creategame.physics.startSystem(Phaser.Physics.ARCADE); map = game.add.tilemap('level1');map.addTilesetImage('mindout-level1', 'tiles');map.setCollision(1);layer = map.createLayer('level1');layer.resizeWorld(); box1 = game.add.sprite(100, 500, 'box1');game.physics.enable(box1);player.body.collideWorldBounds = true; box2 = game.add.sprite(100, 500, 'box2');game.physics.enable(box2);box2.body.collideWorldBounds = true; //In the updaet codegame.physics.arcade.collide(box1, layer);game.physics.arcade.collide(box2, layer); game.physics.arcade.collide(box1, box2); What I miss with the layer? Thanks! Link to comment Share on other sites More sharing options...
gferrari Posted May 21, 2014 Author Share Posted May 21, 2014 Code: http://www.neurocreativa.com/gamedev/blocky/js/game.touch.js Game: http://www.neurocreativa.com/gamedev/blocky Error:if you put in the console box2.x = 200; box2.y = 300; box1.x= 400; box1.y=300; And then drag to left the color box you have the overlap Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts