Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- update: function() {
- this.game.physics.arcade.collide(this.car, this.block);
- // this.game.physics.arcade.overlap(this.car, this.traffic, this.bremsen);
- /*if(this.car.input.pixelPerfectOver=true){
- this.angleBetweenPoints();
- };*/
- //this.car.rotate=this.car.angle;
- //game.debug.spriteInputInfo(this.car, 32, 32);
- },
- angleBetweenPoints: function (point1, point2) {
- this._dragPoint = new Phaser.Point(this.car.x, this.car.y);
- Phaser.Math.angleBetween(this.car.x,
- this.car.y, game.input.activePointer.x,game.input.activePointer.y);
- this.car.angle= Phaser.Math.angleBetween(this.game.input.activePointer.x,
- this.game.input.activePointer.y, this._dragPoint.x,this._dragPoint.y);
- },
- animatecar: function(sprite, event) {
- if ((this.angleBetweenPoints(this.car.y, this.game.input.activePointer.y)) > 0.1) {
- console.log(this.angleBetweenPoints(this.car.y, game.input.y));
- }
- this.car.input.enableDrag();
- },
Add Comment
Please, Sign In to add comment