-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
205 lines (179 loc) · 7.52 KB
/
index.html
File metadata and controls
205 lines (179 loc) · 7.52 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Hellscape</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/app.css">
<script src='./js/libs/jquery-3.3.1.min.js'></script>
<script src='./js/libs/bootstrap.min.js'></script>
<script id="vertex_shader" type="x-shader/x-vertex">
varying vec2 vUv;
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
</script>
<script id="fragment_shader" type="x-shader/x-fragment">
uniform vec3 color;
uniform sampler2D texture;
varying vec2 vUv;
void main() {
vec4 tColor = texture2D( texture, vUv );
gl_FragColor = vec4( mix( color, tColor.rgb, tColor.a ), 1.0 );
}
</script>
</head>
<body>
<div class="container">
<div id="game">
<div id="menubar"> <button id="btnMenu" type="button" name="button">Main Menu</button><button id="btnMode" type="button" name="button">One Player</button> </div>
<canvas id="canvas"></canvas>
<div id="score1">Score: 0</div>
<div id="score2"></div>
</div>
<div class="modal fade" id="messageModal" tabindex="-1" role="dialog" aria-labelledby="" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="messageModalHeader"></h4>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default close" id="playAgain" >Play Again</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modalMenu" tabindex="-1" role="dialog" aria-labelledby="" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" id="btnMenuClose">×</button>
<h4 class="modal-title">Main Menu</h4>
</div>
<div class="modal-body">
<!-- Tab links -->
<div class="tab">
<button class="tablinks" onclick="openTabs(event, 'KeyboardControls')">Keyboard Controllers</button>
<button class="tablinks" onclick="openTabs(event, 'GameProperties')">Game Properties</button>
<button class="tablinks" onclick="openTabs(event, 'BallProperties')">Ball Properties</button>
</div>
<!-- Tab content -->
<div id="KeyboardControls" class="tabcontent">
<h3>Keyboard Controllers - Player 1</h3>
<form >
<div class="form-group">
<label for=""></label>
<input type="color" value="#ff0000" id="colour1">
<p class="help-block">Pick a colour for player display</p>
</div>
<div class="form-group">
<label for="left">Left Key</label>
<input type="text" class="form-control" value="left" id="left1">
<p class="help-block">Default Value is "left arrow key". Please type only one character</p>
</div>
<div class="form-group">
<label for="right">Right Key</label>
<input type="text" class="form-control" id="right1" value="right">
<p class="help-block">Default value is "right arrow key". Please type only one character</p>
</div>
<button type="button" id="btnKeyboardControls1Submit" class="btn-warning">Submit</button>
</form>
<div id="status1" class="alert">
</div>
<h3>Keyboard Controllers - Player 2</h3>
<form >
<div class="form-group">
<label for=""></label>
<input type="color" value="#0000ff" id="colour2">
<p class="help-block">Pick a colour for player display</p>
</div>
<div class="form-group">
<label for="left">Left Key</label>
<input type="text" class="form-control" value="A" id="left2">
<p class="help-block">Default Value is "left arrow key". Please type only one character</p>
</div>
<div class="form-group">
<label for="right">Right Key</label>
<input type="text" class="form-control" id="right2" value="D">
<p class="help-block">Default value is "right arrow key". Please type only one character</p>
</div>
<button type="button" id="btnKeyboardControls2Submit" class="btn-warning">Submit</button>
</form>
<div id="status2" class="alert">
</div>
</div>
<div id="GameProperties" class="tabcontent">
<h3>Game Properties</h3>
<form >
<div class="form-group">
<label for="lives">Number of Balls</label>
<input type="text" class="form-control" placeholder="1-10 Integer value" id="lives" value="3">
<p class="help-block">Number of chances you will have, when you miss a ball. Default is 3.</p>
</div>
<div class="form-group">
<label for="bricks">Number of Bricks</label>
<input type="text" class="form-control" id="bricks" placeholder="1-10 Integer Value" value="2">
<p class="help-block">Number of bricks you want to break, default is 2</p>
</div>
<div class="form-group">
<label for="speedHandle">Player Movement Speed</label>
<input type="text" class="form-control" id="speedHandle" placeholder="Decimal Value" value="1">
<p class="help-block">Speed of the handle</p>
</div>
</form>
<button type="button" id="btnGamePropertiesSubmit" class="btn-warning">Submit</button>
<div id="status3" class="alert">
</div>
</div>
<div id="BallProperties" class="tabcontent">
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$("#btnMenu").click(function(){
$("#modalMenu").modal();
});
function openTabs(evt, cityName) {
// Declare all variables
var i, tabcontent, tablinks;
// Get all elements with class="tabcontent" and hide them
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
// Get all elements with class="tablinks" and remove the class "active"
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
// Show the current tab, and add an "active" class to the button that opened the tab
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
</script>
<!-- Libraries -->
<script src='./js/libs/three.min.js'></script>
<script src='./js/libs/THREEx.KeyboardState.js'></script>
<!-- Scene Subjects -->
<script src="js/sceneSubjects/GeneralLights.js"></script>
<script src="js/sceneSubjects/Handle.js"></script>
<script src="js/sceneSubjects/Ball.js"></script>
<script src="js/sceneSubjects/Brick.js"></script>
<script src="js/sceneSubjects/Wall.js"></script>
<script src="js/sceneSubjects/HUD/LifePanel.js"></script>
<!-- Controllers -->
<script src="js/EventBus.js"></script>
<script src="js/PlayerController.js"></script>
<script src="js/GameController.js"></script>
<script src="js/AudioController.js"></script>
<script src="js/SceneManager.js"></script>
<script src="js/main.js"></script>
</body>
</html>