-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpuzzleroom_w.html
More file actions
184 lines (155 loc) · 6 KB
/
puzzleroom_w.html
File metadata and controls
184 lines (155 loc) · 6 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!-- !!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!!!! -->
<!-- This is the framework file, if you want to create a new room, make COPY of this file! -->
<!-- DO NOT EDIT THIS. ONLY MAKE COPIES OF IT. -->
<!-- Be sure to delete this warning on any copies you make -->
<!DOCTYPE html>
<html>
<head>
<title>‎</title> <link rel="icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="resources/style.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="resources/script.js"></script>
<script>
$(document).ready(function(){
// change this to change the background image
// the dimensions should be 720px X 405px.
// ======================
picture_set("rooms/puzzleroom_w.png");
// ======================
// clickers go HERE
// =====================================================
// NOTE:
// THE SAFE HIDDEN BEHIND THE PICTURE IS FEATURE COMPLETE. IT DOES NOT NEED CHANGING.
// THE ONLY THING THAT WOULD NEED CHANGING IS THE ACTUAL CODE FOR THE SAFE ITSELF.
var password = [2,5,6,6,3];
var sc = new Sound('sounds/PasswordCorrect.mp3');
var opensound = new Sound('sounds/SafeUnlock&Open.mp3');
var paintsound = new Sound('sounds/DropPainting.mp3');
if(sessionStorage.safe_revealed == null ) {sessionStorage.safe_revealed = "false"; }
function move_painting(){
if(sessionStorage.safe_revealed == "false"){
//$('#clicker_cagedbird').css({'top':'36px', 'left':'242px'});
} else {
$('#clicker_cagedbird').css({'top':'210px', 'left':'80px'});
}
}
function open_safe(){
opensound.play();
show_inline_view("clickers/SafeOpen.png", function(){
add_inline_clicker(130,200,71,44,"clicker_basementkey","clickers/Key.png", function(){
inventory_add_item("Basement Key", "clickers/Key.png");
remove_inline_clicker("clicker_basementkey");
remove_clicker("clicker_safe");
add_clicker(242,36,93,93,"clicker_safe_emptied","clickers/SafeOpen.png", null);
});
});
}
if( !inventory_has_item("Basement Key") ) {
add_clicker(242,36,93,93,"clicker_safe","clickers/SafeLocked.png", function(){
show_inline_view("clickers/SafeLocked.png",function(){
console.log("you clicked the SAFE. nice job");
var corrects = 0;
function click_pad(n){
sc.play();
if(n == password[corrects]){
corrects++;
} else {
corrects = 0;
}
if(corrects == password.length){
hide_inline_view();
open_safe();
}
}
var xp = 65;
var yp = 70;
var wp = 34;
var hp = 35;
add_inline_clicker(xp, yp, wp, hp, "num_1", "", function(){ click_pad(1); });
add_inline_clicker(xp+wp, yp, wp, hp, "num_2", "", function(){ click_pad(2); });
add_inline_clicker(xp+wp*2, yp, wp, hp, "num_3", "", function(){ click_pad(3); });
add_inline_clicker(xp, yp+hp, wp, hp, "num_4", "", function(){ click_pad(4); });
add_inline_clicker(xp+wp, yp+hp, wp, hp, "num_5", "", function(){ click_pad(5); });
add_inline_clicker(xp+wp*2, yp+hp, wp, hp, "num_6", "", function(){ click_pad(6); });
add_inline_clicker(xp, yp+hp*2, wp, hp, "num_7", "", function(){ click_pad(7); });
add_inline_clicker(xp+wp, yp+hp*2, wp, hp, "num_8", "", function(){ click_pad(8); });
add_inline_clicker(xp+wp*2, yp+hp*2, wp, hp, "num_9", "", function(){ click_pad(9); });
});
});
} else {
add_clicker(242,36,93,93,"clicker_safe_emptied","clickers/SafeOpen.png", null);
}
//
//add_clicker(170,250,180,80,"clicker_show_book_1","clickers/puzzleroom_w/DrawerClosed.png",function(){
// show_inline_view("clickers/puzzleroom_n/BookOpen.png", function(){
// console.log("what a happy family");
// });
//});
if(sessionStorage.printed)
{
add_clicker(395,155,80,60,"printed_paper","clickers/puzzleroom_w/PrintedPage.png",function(){
show_inline_view("clickers/puzzleroom_w/PrintedPage.png", function(){
});
});
}
else if(sessionStorage.loadedPaper)
{
add_clicker(402,85,60,30,"printer_paper","clickers/puzzleroom_w/Paper.png",null);
}
add_clicker(370,80,120,90,"printer","",function(){
if(inventory_has_item("paper"))
{
add_clicker(402,85,60,30,"printer_paper","clickers/puzzleroom_w/Paper.png",null);
sessionStorage.loadedPaper = "1";
inventory_remove_item("paper");
}
});
add_clicker(242,36,93,93,"clicker_cagedbird","clickers/puzzleroom_w/BirdPainting.png",function(){
if(sessionStorage.safe_revealed == "false") {
paintsound.play();
sessionStorage.safe_revealed = "true";
} else {
//sessionStorage.safe_revealed = "false";
}
move_painting();
});
move_painting();
//TODO: safe, with the key inside it.
// =====================================================
// set where clicking on the side links makes you go
nav_left("puzzleroom_s.html");
nav_right("puzzleroom_n.html");
nav_up("");
nav_down("");
});
</script>
<script src="resources/postscript.js"></script>
</head>
<body>
<div class="inline-dismisser"></div>
<div id="wrapper">
<div id="picture"></div>
<div id="navclicks">
<div class="navclick" id="click-up"></div>
<div class="navclick" id="click-down"></div>
<div class="navclick" id="click-left"></div>
<div class="navclick" id="click-right"></div>
</div>
<div id="clickers">
<!-- in here, there go all the custom clicky boxes for items and stuff -->
<!-- this is handled with the javascript so DON'T PUT ANYTHING HERE. -->
<!-- ================================================================= -->
<!-- <div class="clicker" style="width:40px;height:40px;top:150px;left:400px;"></div> -->
<!-- ================================================================= -->
</div>
<div class="inline-dismisser"></div>
<div id="inline">
<div id="inline-clickers">
<!-- in here, go even more clickers for each inline view. -->
</div>
</div>
<div id="inventory"></div>
<div id="subtitle"></div>
</div>
</body>
</html>