changed first screen
This commit is contained in:
parent
aabc3447af
commit
03d1627037
7 changed files with 29 additions and 16 deletions
BIN
.index.html.swp
Normal file
BIN
.index.html.swp
Normal file
Binary file not shown.
|
@ -7,6 +7,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="overlay" class="faded"></div>
|
||||
<canvas id="canvas"></canvas>
|
||||
<div id='devtools' style='z-index:3;display:none;position:absolute;left:50%;width:400px;height:400px;top:50%;margin-top:-200px;margin-left:-200px;'>
|
||||
<h2 id = 'clickToExit' style = 'background-color:#fff;color:#000'>Click to exit</h2>
|
||||
|
@ -27,8 +28,8 @@
|
|||
<script type = 'text/javascript' src="js/checking.js"></script>
|
||||
<script type = 'text/javascript' src='js/update.js'></script>
|
||||
<script type = 'text/javascript' src='js/render.js'></script>
|
||||
<script type = 'text/javascript' src="js/main.js"></script>
|
||||
<script type = 'text/javascript' src="js/input.js"></script>
|
||||
<script type = 'text/javascript' src="js/main.js"></script>
|
||||
<script type = 'text/javascript' src="js/analytics.js"></script>
|
||||
<div id="helpScreen">
|
||||
<h1 style="margin-left:5%;">Instructions</h1>
|
||||
|
@ -53,6 +54,5 @@
|
|||
</p>
|
||||
</div>
|
||||
<div onClick="showHelp()" id="openSideBar">?</div>
|
||||
<div id="overlay" class="faded"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
BIN
js/.input.js.swp
Normal file
BIN
js/.input.js.swp
Normal file
Binary file not shown.
BIN
js/.main.js.swp
Normal file
BIN
js/.main.js.swp
Normal file
Binary file not shown.
28
js/input.js
28
js/input.js
|
@ -1,19 +1,30 @@
|
|||
var prevGameState;
|
||||
var messages = {
|
||||
'paused':"<div class='centeredHeader'>Paused</div> \
|
||||
<br> \
|
||||
<div class='centeredSubHeader'>Press p to resume</div>"
|
||||
}
|
||||
|
||||
function showText(text){
|
||||
|
||||
var messages = {
|
||||
'paused':"<div class='centeredHeader'>Paused</div> \
|
||||
<br> \
|
||||
<div class='centeredSubHeader'>Press p to resume</div>",
|
||||
'start':"<div class='centeredHeader'>Press enter to start</div>"
|
||||
}
|
||||
var pt = document.getElementById("overlay");
|
||||
pt.className = '';
|
||||
pt.innerHTML = messages[text];
|
||||
}
|
||||
function hideText(text){
|
||||
var pt = document.getElementById("overlay");
|
||||
pt.className = 'faded';
|
||||
pt.innerHTML = '';
|
||||
}
|
||||
function pause(x,o,message) {
|
||||
if(x === undefined){x=true}
|
||||
message = 'paused';
|
||||
var c = document.getElementById("canvas");
|
||||
var pt = document.getElementById("overlay");
|
||||
if (gameState == -1 ) {
|
||||
hideText();
|
||||
if(showingHelp && !o){return;}
|
||||
c.className = '';
|
||||
pt.className = 'faded';
|
||||
setTimeout(function(){
|
||||
gameState = prevGameState;
|
||||
requestAnimFrame(animLoop);
|
||||
|
@ -22,8 +33,7 @@ function pause(x,o,message) {
|
|||
}
|
||||
else if(gameState != -2 && gameState != 0) {
|
||||
c.className = "blur";
|
||||
pt.className = '';
|
||||
pt.innerHTML = messages[message];
|
||||
showText(message);
|
||||
prevGameState = gameState;
|
||||
gameState = -1;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var pauseText = true;
|
||||
var textShown = false;
|
||||
var showingHelp = false;
|
||||
$(document).ready(scaleCanvas);
|
||||
$(window).resize(scaleCanvas);
|
||||
|
@ -176,7 +176,7 @@ function init() {
|
|||
waveone = saveState.wavegen || new waveGen(MainClock,Date.now(),[1,1,0],[1,1],[1,1]);
|
||||
|
||||
MainClock.texts = []; //clear texts
|
||||
|
||||
hideText();
|
||||
clearSaveState();
|
||||
}
|
||||
|
||||
|
@ -262,7 +262,10 @@ function animLoop() {
|
|||
else if (gameState === 0) {
|
||||
requestAnimFrame(animLoop);
|
||||
clearGameBoard();
|
||||
showModal('Start!', 'Press enter to start!');
|
||||
if(!textShown){
|
||||
showText('start');
|
||||
textShown = true;
|
||||
}
|
||||
}
|
||||
else if (gameState == -2) { //initialization screen just before starting
|
||||
requestAnimFrame(animLoop);
|
||||
|
|
|
@ -86,7 +86,7 @@ button:focus {
|
|||
.centeredHeader {
|
||||
font-size:72px;
|
||||
text-align:center;
|
||||
line-height:30px;
|
||||
line-height:48px;
|
||||
}
|
||||
|
||||
.centeredSubHeader {
|
||||
|
@ -148,4 +148,4 @@ body {
|
|||
z-index:9000;
|
||||
margin-top:20px;
|
||||
color:#2c3e50;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue