File tree 1 file changed +14
-16
lines changed 1 file changed +14
-16
lines changed Original file line number Diff line number Diff line change 1
1
class Obstacle {
2
2
constructor ( ) {
3
3
this . pos = createVector (
4
- random ( 50 , width ) , random ( 50 , height / 2 ) )
4
+ random ( 50 , width ) ,
5
+ random ( 50 , height / 2 )
6
+ )
5
7
this . r = 60
6
8
}
7
-
9
+
8
10
reset ( ) {
9
11
this . pos = createVector (
10
- random ( 50 , width ) , random ( 50 , height / 2 ) )
12
+ random ( 50 , width ) ,
13
+ random ( 50 , height / 2 )
14
+ )
11
15
}
12
-
16
+
13
17
show ( ) {
14
18
noStroke ( )
15
19
ellipse ( this . pos . x , this . pos . y , this . r )
16
20
}
17
-
18
- hitLeft ( lw , i ) {
21
+
22
+ collisionWrist ( wristX , wristY , i ) {
19
23
let hit = collideCircleCircle (
20
- lw . x , lw . y , 20 ,
21
- obstacles [ i ] . pos . x , obstacles [ i ] . pos . y , this . r )
24
+ wristX , wristY , 20 ,
25
+ obstacles [ i ] . pos . x , obstacles [ i ] . pos . y , this . r
26
+ )
22
27
return hit
23
28
}
24
-
25
- hitRight ( rw , i ) {
26
- let hit = collideCircleCircle (
27
- rw . x , rw . y , 20 ,
28
- obstacles [ i ] . pos . x , obstacles [ i ] . pos . y , this . r )
29
- return hit
30
- }
31
- }
29
+ }
You can’t perform that action at this time.
0 commit comments