Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     _drawPointOrb(ctx,pt){
  2.         let radius = 3;
  3.        
  4.         if(this.Layer.Level){
  5.             this._applyTransform();
  6.             let transformed = this.Transformation.MultiplyVec2(pt);
  7.             let mouse = new Engine.Vector2(this.Layer.Level.Controller.Mouse.LastX, this.Layer.Level.Controller.Mouse.LastY);
  8.             if(mouse.Distance(transformed) <= 10){
  9.                 radius = 15;
  10.             }
  11.         }
  12.        
  13.         ctx.moveTo(pt.X - this._optimized[0] + Math.cos(0)*radius,pt.Y - this._optimized[2] + Math.sin(0)*radius);
  14.         ctx.arc(pt.X - this._optimized[0],pt.Y - this._optimized[2],radius,0,2*Math.PI,false);
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement