-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIntroEnvironment.java
49 lines (44 loc) · 1.96 KB
/
IntroEnvironment.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
/**
* IntroEnvironment (child of Environment) - represents properties of the environment in the introduction
* @author Rupin Mittal
* @version May 23, 2019
*/
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
public class IntroEnvironment extends Environment
{
private ImageView foreground; //the imageView of the foreground (part of parallax effect)
private ImageView background; //the imageView of the foreground (part of parallax effect)
//the normal map variable is declared from Environment class
//constructor
/**
* Constructor for IntroEnvironment class
* @param mapCollisionsDatafile String that is txt file name that comes from .json file with tile data
* @param mapImage String that is png file name that comes from .json file for the map
* @param foregroundImage String that is png file name that comes from .json file for the foreground
* @param backgroundImage String that is png file name that comes from .json file for the background
*/
public IntroEnvironment(String mapCollisionsDatafile, String mapImage, String foregroundImage, String backgroundImage)
{
super(mapCollisionsDatafile, mapImage); //call to create the collisionsArray
foreground = new ImageView(new Image(foregroundImage, 0, 0, true, true)); //create the foreground imageview
background = new ImageView(new Image(backgroundImage, 0, 0, true, true)); //create the foreground imageview
}
//methods
/**
* Method to get the foreground ImageView
* @return ImageView foreground
*/
public ImageView getForegroundImageView()
{
return foreground; //return the foreground imageView
}
/**
* Method to get the background ImageView
* @return ImageView background
*/
public ImageView getBackgroungroundImageView()
{
return background; //return the background imageView
}
}