-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrightTriangle1.js
More file actions
43 lines (34 loc) · 973 Bytes
/
rightTriangle1.js
File metadata and controls
43 lines (34 loc) · 973 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
window.Art = window.Art || {};
window.Art.RightTri1 = (function() {
function RightTri1() {
window.Art.Tri.apply(this, arguments);
};
RightTri1.prototype = Object.create(window.Art.Tri);
var rtri1 = RightTri1.prototype;
rtri1.render = window.Art.Tri.prototype.render;
rtri1.getColour = window.Art.Tri.prototype.getColour;
rtri1.draw = function(x, y) {
this.ctx.moveTo(x, y - this.size);
this.ctx.lineTo(x + (this.size * 2), y);
this.ctx.lineTo(x, y + this.size);
};
rtri1.below = function() {
return {
x: this.position.x - 1,
y: this.position.y + 1
};
};
rtri1.above = function() {
return {
x: this.position.x - 1,
y: this.position.y - 1
};
};
rtri1.aside = function() {
return {
x: this.position.x - 1,
y: this.position.y
};
};
return RightTri1;
}());