-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHallway2AtticScene.pde
65 lines (49 loc) · 2.25 KB
/
Hallway2AtticScene.pde
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
class Hallway2AtticScene extends SceneWithTransition {
ImageButton backButton = new ImageButton( "arrowDown.png", round(825 * widthRatio), round(997 * heightRatio), "arrowDown outline.png" );
ImageButton samDoorsButton = new ImageButton( null, round(1132 * widthRatio), round(198 * heightRatio), "Hallway_2_Room Attic - Sam Door Overlay.png" );
//ImageButton parentDoorsButton = new ImageButton( null, round(461 * widthRatio), round(264 * heightRatio), "Hallway_2_Room Attic - Parents Door Overlay.png" );
ImageButton atticStairsButton = new ImageButton( "Hallway_2_Room Attic stairs.png", round(607 * widthRatio), round(0 * heightRatio), "Hallway_2_Room Attic stairs overlay.png" );
ImageButton garageKeyPlaceButton = new ImageButton( null, round(921 * widthRatio), round(664 * heightRatio), "garage_key_laydown outline.png");
UISprite garageKeySprite = new UISprite(921, 664, "garage_key_laydown.png");
boolean atticStairsOpen = false;
boolean garageKeyPicked = false;
Hallway2AtticScene() {
super("Hallway_2_Room Attic.png");
}
public void doStepWhileInState(float delta)
{
super.doStepWhileInState(delta);
backButton.display();
samDoorsButton.display();
//parentDoorsButton.display();
if (atticStairsOpen == true && garageKeyPicked == false) {
garageKeyPlaceButton.display();
garageKeySprite.display(delta);
}
if (atticStairsOpen == true) {
atticStairsButton.display();
}
super.TransitionDisplay(delta);
}
void handleMousePressed() {
if ( backButton.isPointInside( mouseX, mouseY ) ) {
changeState( GROUND_HALLWAY_SCENE );
}
if ( samDoorsButton.isPointInside( mouseX, mouseY ) ) {
changeState( SAM_BEDROOM_SCENE );
soundManager.OPEN_DOOR.play();
}
if ( atticStairsOpen && atticStairsButton.isPointInside( mouseX, mouseY ) ) {
changeState( ATTIC_SCENE );
soundManager.OPEN_DOOR.play();
}
if (garageKeyPicked == false && garageKeyPlaceButton.isPointInside( mouseX, mouseY ) ) {
garageKeyPicked = true;
invManager.PickUpItem("garage_key_item", new String[] { "garage_key item 0" }, garageKeySprite);
}
}
void changeState(State state) {
stateHandler.changeStateTo( state );
soundManager.FOOT_STEPS.play();
}
}