-
Notifications
You must be signed in to change notification settings - Fork 0
/
cap.java
111 lines (83 loc) · 2.42 KB
/
cap.java
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package application;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import javafx.scene.Group;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
public class cap implements Zombie {
private int posx;
private int posy;
private int health = 500;
private int power = 100;
private HBox hBox;
private VBox vBox;
private double sizeX;
private double sizeY;
private boolean status;
private StackPane s = new StackPane();
private Group root;
private Image zombie;
private ImageView zombieView;
private double imageY;
private double imageX;
private double speed;
private double ispeed;
public cap(Group root,int posx,int posy) throws FileNotFoundException {
this.hBox=new HBox();
this.posx = posx;
this.posy = posy;
this.zombie = new Image(new FileInputStream("C:\\Users\\HARSHIT\\Desktop\\capzombie.gif"));
this.zombieView = new ImageView(zombie);
s.getChildren().add(zombieView);
zombieView.setX(posx);
zombieView.setY(posy);
zombieView.setFitHeight(120);
zombieView.setFitWidth(100);
root = new Group(s,zombieView);
//insertImage(plant,hBox);
}
public ImageView getigw() {
return this.zombieView;
}
public void removeImage() {
this.s.getChildren().remove(this.zombieView);
this.root.getChildren().remove(this.s);
}
public void setImagePosition(double x, double y) {
this.imageX = x;
this.imageY = y;
}
public double getImagePositionX() {
return this.imageX;
}
public int getposx() {
return this.posx;
}
public int getposy() {
return this.posy;
}
public void setposy(int column) {
this.posy = column;
}
public void setposx(int row) {
this.posx = row;
}
public int getHealth() {
return health;
}
public void setHealth(int health) {
this.health = health;
}
public int getPower() {
return power;
}
public double getISpeed() {
return ispeed;
}
public void setSpeed(double speed) {
this.speed = speed;
}
}