Guest User

Untitled

a guest
Jan 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. update: function() {
  2. this.game.physics.arcade.collide(this.car, this.block);
  3. // this.game.physics.arcade.overlap(this.car, this.traffic, this.bremsen);
  4. /*if(this.car.input.pixelPerfectOver=true){
  5.  
  6. this.angleBetweenPoints();
  7. };*/
  8. //this.car.rotate=this.car.angle;
  9. //game.debug.spriteInputInfo(this.car, 32, 32);
  10. },
  11.  
  12. angleBetweenPoints: function (point1, point2) {
  13. this._dragPoint = new Phaser.Point(this.car.x, this.car.y);
  14.  
  15. Phaser.Math.angleBetween(this.car.x,
  16. this.car.y, game.input.activePointer.x,game.input.activePointer.y);
  17.  
  18. this.car.angle= Phaser.Math.angleBetween(this.game.input.activePointer.x,
  19. this.game.input.activePointer.y, this._dragPoint.x,this._dragPoint.y);
  20.  
  21. },
  22.  
  23.  
  24. animatecar: function(sprite, event) {
  25.  
  26.  
  27.  
  28. if ((this.angleBetweenPoints(this.car.y, this.game.input.activePointer.y)) > 0.1) {
  29.  
  30. console.log(this.angleBetweenPoints(this.car.y, game.input.y));
  31. }
  32. this.car.input.enableDrag();
  33.  
  34. },
Add Comment
Please, Sign In to add comment