removed debugger statements. made larger hitboxes for buttons. fixed garrett's github link.
This commit is contained in:
parent
d3b4f0f1d9
commit
78fe31577e
5 changed files with 34 additions and 20 deletions
|
@ -33,8 +33,8 @@
|
|||
<textarea id ='devtoolsText' style = 'height:300px;width:400px;'></textarea>
|
||||
</div>
|
||||
<div id="overlay" class="faded"></div>
|
||||
<div id="attributions">Started by <a href="http://github.com/teamsnowman">@teamsnowman</a> at <a href= 'http://www.hackexeter.com/'>HackExeter</a><br>
|
||||
Finished by <a onclick="window.open('http://www.google.com', '_system','location=no');">Garrett Finucane</a> & <a href="http://github.com/meadowstream" >Logan Engstrom</a> on <a href = 'http://github.com/hextris/hextris'>GitHub</a>
|
||||
<div id="attributions">Started by <a href="http://github.com/teamsnowman" target="_blank">@teamsnowman</a> at <a href= 'http://www.hackexeter.com/' target="_blank">HackExeter</a><br>
|
||||
Finished by <a href='http://github.com/garrettdreyfus' target="_blank">Garrett Finucane</a> & <a href="http://github.com/meadowstream" target="_blank">Logan Engstrom</a> on <a href = 'http://github.com/hextris/hextris' target="_blank">GitHub</a>
|
||||
</div>
|
||||
<div id='startBtn' style='position:absolute;left:40%;top:38%;height:25%;width:25%;z-index:99999999;cursor:pointer;'></div>
|
||||
<div id="helpScreen" class = 'unselectable'>
|
||||
|
@ -67,8 +67,8 @@
|
|||
</div>
|
||||
<div id="openSideBar" class = 'helpText'><i class="fa fa-info-circle fa-lg"></i> <i class="fa fa-arrow-left"><b> Help</b></i></div>
|
||||
<div id="overlay" class="faded"></div>
|
||||
<div id = 'pauseBtn'><i class="fa fa-pause fa-2x"></i></div>
|
||||
<div id = 'restartBtn'><i class="fa fa-refresh fa-2x"></i></div>
|
||||
<div id = 'pauseBtn'><div id = 'pauseBtnInner'><i class="fa fa-pause fa-2x"></div></i></div>
|
||||
<div id = 'restartBtn'><div id = 'restartBtnInner'><i class="fa fa-refresh fa-2x"></i></div></div>
|
||||
<div id="bottombar">
|
||||
<a href="https://twitter.com/intent/tweet?hashtags=hextris&original_referer=http%3A%2F%2F0.0.0.0%3A8080%2F&text=Play%20Hextris!%20-&tw_p=tweetbutton&url=http%3A%2F%2Fhextris.github.io%2F" class="twitter-share-button" data-url="http://hextris.github.io/" data-text="Play Hextris! -" data-hashtags="hextris">Tweet</a>
|
||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
||||
|
|
|
@ -123,9 +123,13 @@ function initialize(a) {
|
|||
window.numHighScores = 3;
|
||||
|
||||
window.highscores = [];
|
||||
debugger;
|
||||
if(localStorage.getItem('highscores'))
|
||||
highscores = JSON.parse(localStorage.getItem('highscores'));
|
||||
if(localStorage.getItem('highscores')) {
|
||||
try {
|
||||
highscores = JSON.parse(localStorage.getItem('highscores'));
|
||||
} catch (e) {
|
||||
highscores = [];
|
||||
}
|
||||
}
|
||||
|
||||
writeHighScores();
|
||||
|
||||
|
|
|
@ -39,8 +39,6 @@ function descaleBlock(b) {
|
|||
function writeHighScores() {
|
||||
if (Object.prototype.toString.call(highscores) === '[object Array]') {
|
||||
localStorage.setItem("highscores", JSON.stringify(highscores));
|
||||
} else {
|
||||
debugger;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
22
js/view.js
22
js/view.js
|
@ -84,10 +84,16 @@ function toggleClass(element, active) {
|
|||
function showText(text){
|
||||
var messages = {
|
||||
'paused':"<div class='centeredHeader unselectable'>Paused</div><br><div class='unselectable centeredSubHeader'>Press p to resume</div><div style='height:100px;line-height:100px;cursor:pointer;'></div>",
|
||||
'pausedMobile':"<div class='centeredHeader unselectable'>Paused</div><div style='height:100px;line-height:100px;cursor:pointer;'></div>",
|
||||
'pausedMobile':"<div class='centeredHeader unselectable'>Paused</div><br><div class='unselectable centeredSubHeader'>Press <i class='fa fa-play'></i> to resume</div><div style='height:100px;line-height:100px;cursor:pointer;'></div>",
|
||||
'start':"<div class='centeredHeader unselectable' style='line-height:80px;'>Press enter to start</div>",
|
||||
'gameover':"<div class='centeredHeader unselectable'> Game Over: "+score+" pts</div><br><div style='font-size:24px;' class='centeredHeader unselectable'> High Scores:</div><table class='tg' style='margin:0px auto'>"
|
||||
};
|
||||
|
||||
if (text == 'paused') {
|
||||
if (settings.platform == 'mobile') {
|
||||
text = 'pausedMobile';
|
||||
}
|
||||
}
|
||||
|
||||
if (text == 'gameover') {
|
||||
var allZ = 1;
|
||||
|
@ -119,12 +125,6 @@ function showText(text){
|
|||
}
|
||||
$("#overlay").html(messages[text]);
|
||||
$("#overlay").fadeIn("1000","swing");
|
||||
if (text == 'paused') {
|
||||
if (settings.platform == 'mobile') {
|
||||
text = 'pausedMobile';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (text == 'gameover') {
|
||||
if (settings.platform == 'mobile') {
|
||||
|
@ -141,9 +141,9 @@ function setMainMenu() {
|
|||
}, 500);
|
||||
$('#restartBtn').show();
|
||||
if ($($("#pauseBtn").children()[0]).attr('class').indexOf('pause') == -1) {
|
||||
$("#pauseBtn").html('<i class="fa fa-pause fa-2x"></i>');
|
||||
$("#pauseBtnInner").html('<i class="fa fa-pause fa-2x"></i>');
|
||||
} else {
|
||||
$("#pauseBtn").html('<i class="fa fa-play fa-2x"></i>');
|
||||
$("#pauseBtnInner").html('<i class="fa fa-play fa-2x"></i>');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ function pause(o) {
|
|||
$('#helpScreen').fadeOut(150, "linear");
|
||||
}
|
||||
|
||||
$("#pauseBtn").html('<i class="fa fa-pause fa-2x"></i>');
|
||||
$("#pauseBtnInner").html('<i class="fa fa-pause fa-2x"></i>');
|
||||
$('.helpText').fadeOut(200, 'linear');
|
||||
hideText();
|
||||
hidebottombar();
|
||||
|
@ -190,7 +190,7 @@ function pause(o) {
|
|||
showText(message);
|
||||
}
|
||||
|
||||
$("#pauseBtn").html('<i class="fa fa-play fa-2x"></i>');
|
||||
$("#pauseBtnInner").html('<i class="fa fa-play fa-2x"></i>');
|
||||
prevGameState = gameState;
|
||||
gameState = -1;
|
||||
}
|
||||
|
|
|
@ -73,6 +73,8 @@ button:focus {
|
|||
#pauseBtn {
|
||||
position: absolute;
|
||||
margin-bottom: 3px;
|
||||
width:60px;
|
||||
height:60px;
|
||||
margin-right: 7px;
|
||||
z-index: 3000;
|
||||
color:#232323;
|
||||
|
@ -81,12 +83,22 @@ button:focus {
|
|||
right:0;
|
||||
bottom:0;
|
||||
z-index:99;
|
||||
}
|
||||
|
||||
#pauseBtnInner {
|
||||
margin-left:35px;
|
||||
margin-top:28px;
|
||||
}
|
||||
|
||||
#restartBtnInner {
|
||||
margin-top:28px;
|
||||
}
|
||||
|
||||
#restartBtn {
|
||||
position:absolute;
|
||||
left:0;
|
||||
width:60px;
|
||||
height:60px;
|
||||
bottom:0;
|
||||
z-index:99;
|
||||
position: absolute;
|
||||
|
|
Loading…
Reference in a new issue