forked from n1ckfg/BlobGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRock.pde
More file actions
executable file
·49 lines (41 loc) · 761 Bytes
/
Rock.pde
File metadata and controls
executable file
·49 lines (41 loc) · 761 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
43
44
45
46
47
48
49
class Rock extends Enemy {
Rock(String _name, int _fps){
super(_name, _fps);
init();
}
Rock(String _name, int _fps, int _tdx, int _tdy, int _etx, int _ety){
super(_name, _fps, _tdx, _tdy, _etx, _ety);
init();
}
Rock(PImage[] _name, int _fps){
super(_name, _fps);
init();
}
void init(){
ease = 50;
attack = false;
home = new PVector(width/2,height/2);
vOrig = new PVector(0, 0.5);
v = vOrig;
aOrig = new PVector(0,0.5); //orig 0.2
a = aOrig;
//--
super.init();
}
void update(){
super.update();
if(attack && p.y<height){
p.add(v);
v.add(a);
}else{
reset();
}
}
void draw(){
super.draw();
}
void run(){
update();
draw();
}
}