-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWall.java
68 lines (53 loc) · 1.29 KB
/
Wall.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
import javafx.scene.image.ImageView;
/**
* <br>This class represent a wall in game.</br>
* <br>Walls can reflect the {@link Ammo}s </br>
* <br>{@link Tank}s can not moves over walls</br>
*
*
* @author Mohammad Mahdi Malmasi
* @author Sevda Imany
*
* @version 0.0.6
*/
public class Wall extends Tile
{
/* Constructor */
// wall's imageView
private ImageView imageView;
//wall's x and y coordinates
private int xCoordinate , yCoordinate;
/**
* Create a new wall with given details
*
*
* @param imagePath : address of the wall image file
* @param x : x of the wall
* @param y : y of the wall
*/
public Wall(float x, float y, float width, float height,String imagePath)
{
super(x,y,width,height,imagePath);
xCoordinate = (int)x/45;
yCoordinate = (int)y/45;
imageView = new ImageView(super.getImage());
}
/**
* @return wall's x coordinate
*/
public int getxCoordinate() {
return xCoordinate;
}
/**
* @return wall's y coordinate
*/
public int getyCoordinate() {
return yCoordinate;
}
/**
* @return wall's imageView
*/
public ImageView getImageView() {
return imageView;
}
}