Chronos234 commited on
Commit
745c1ca
·
verified ·
1 Parent(s): 6a526b2

Create tower.js

Browse files
Files changed (1) hide show
  1. tower.js +19 -0
tower.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class Tower {
2
+ constructor(x, y) {
3
+ this.x = x;
4
+ this.y = y;
5
+ this.radius = 50;
6
+ this.color = 'blue';
7
+ }
8
+
9
+ update() {
10
+ this.draw();
11
+ }
12
+
13
+ draw() {
14
+ ctx.beginPath();
15
+ ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2);
16
+ ctx.fillStyle = this.color;
17
+ ctx.fill();
18
+ }
19
+ }