Ajora Posted July 19, 2017 Share Posted July 19, 2017 (edited) Hello, I am making a simple haxball clone and I have a problem. I have a player and a ball on the field, and there are field lines on top, left, right and bottom. When player hits the ball, the ball sometimes goes out of the lines (it goes the other side when it should hit the line and come back). It generally happens when the ball goes fast. I thought it is a bug but I probably miss something because I am newbie on Phaser. This is how I implemented a line: this.topLine = this.add.sprite(400, 40, 'line'); this.topLine.scale.setTo(760, 2); this.physics.p2.enable(this.topLine); this.topLine.body.static = true; And here is the ball implementation: this.ball = this.add.sprite(400, 250, 'ball'); this.physics.p2.enable(this.ball, true); this.ball.body.setCircle(10); this.ball.body.damping = 0.7; I also added the images. Thanks in advance. Edited July 19, 2017 by Ajora unnecessary tags are deleted ckm88 1 Link to comment Share on other sites More sharing options...
Recommended Posts