-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbakcup.html
27 lines (26 loc) · 1.03 KB
/
bakcup.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function drawBounds(context,object){
context.save();
context.beginPath();
context.moveTo(object.boundX,object.boundY);
context.lineTo(object.boundX+object.boundW,object.boundY);
context.lineTo(object.boundX+object.boundW,object.boundY+object.boundH);
context.lineTo(object.boundX,object.boundY+object.boundH);
context.closePath();
context.lineWidth=1;
context.strokeStyle="#000000";
context.stroke();
context.restore();
}
function drawBoundsBall(context,object){
context.save();
context.beginPath();
context.moveTo(object.x-object.radius,object.y-object.radius);
context.lineTo(object.x+object.radius,object.y-object.radius);
context.lineTo(object.x+object.radius,object.y+object.radius);
context.lineTo(object.x-object.radius,object.y+object.radius);
context.closePath();
context.lineWidth=1;
context.strokeStyle="#000000";
context.stroke();
context.restore();
}