Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. drawballs(context) {
  2. if (this.nw != null) {
  3. this.nw.drawballs(context);
  4. this.ne.drawballs(context);
  5. this.sw.drawballs(context);
  6. this.se.drawballs(context);
  7. }
  8. for (let c of this.balls) {
  9. context.beginPath();
  10. context.arc(c.x, c.y, c.r, 0, 2 * Math.PI, false);
  11. if (c.isColided) {
  12. context.fillStyle = 'blue';
  13. } else {
  14. context.fillStyle = 'green';
  15. }
  16. context.fill();
  17. context.lineWidth = 0.1;
  18. if (c.isColided) {
  19. context.strokeStyle = 'blue';
  20. } else {
  21. context.strokeStyle = 'green';
  22. }
  23. context.closePath();
  24. context.stroke();
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement