espace Posted October 26, 2016 Share Posted October 26, 2016 hi, i don't understand why my two body fall at the same speed because i specify a different parameter for each ? can you help me ? https://jsfiddle.net/espace3d/kn2grLee/ var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload,create: create, update: update, render: render }); function preload() { game.load.image('circle', 'https://s13.postimg.org/xjhlzmiev/disc_png.png'); }; var player var opponent function create() { player=game.add.sprite(100,50,'circle') game.physics.enable(player, Phaser.Physics.ARCADE); player.body.velocity.y=800 opponent=game.add.sprite(200,200,'circle') game.physics.enable(opponent, Phaser.Physics.ARCADE); opponent.body.velocity.y=0 }; function update() { game.physics.arcade.collide(player,opponent,collisionHandler,null,this); }; function collisionHandler (obj1, obj2) { console.log("collide") //game.stage.backgroundColor = '#992d2d'; }; function render() { } Link to comment Share on other sites More sharing options...
espace Posted October 26, 2016 Author Share Posted October 26, 2016 solved the error is that the player push down the opponent ! so if i place at a certain distance no problme https://jsfiddle.net/1v92otpa/ Link to comment Share on other sites More sharing options...
Recommended Posts