Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- drawballs(context) {
- if (this.nw != null) {
- this.nw.drawballs(context);
- this.ne.drawballs(context);
- this.sw.drawballs(context);
- this.se.drawballs(context);
- }
- for (let c of this.balls) {
- context.beginPath();
- context.arc(c.x, c.y, c.r, 0, 2 * Math.PI, false);
- if (c.isColided) {
- context.fillStyle = 'blue';
- } else {
- context.fillStyle = 'green';
- }
- context.fill();
- context.lineWidth = 0.1;
- if (c.isColided) {
- context.strokeStyle = 'blue';
- } else {
- context.strokeStyle = 'green';
- }
- context.closePath();
- context.stroke();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement