Merge branch 'gh-pages' of http://github.com/hextris/hextris into gh-pages

This commit is contained in:
Garrett Finucane 2014-08-19 01:12:41 -04:00
commit 29f159c59a
20 changed files with 83 additions and 40 deletions

View file

@ -18,24 +18,24 @@
<link rel="icon" type="image/png" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="style/style.css">
<link rel="stylesheet" href="style/fa/css/font-awesome.min.css">
<script type = 'text/javascript' src="vendor/hammer.min.js"></script>
<script type = 'text/javascript' src="vendor/jsonfn.min.js"></script>
<script type = 'text/javascript' src="vendor/keypress.min.js"></script>
<script type = 'text/javascript' src="vendor/jquery.js"></script>
<script type = 'text/javascript' src="js/save-state.js"></script>
<script type = 'text/javascript' src="js/view.js"></script>
<script type = 'text/javascript' src="js/wavegen.js"></script>
<script type = 'text/javascript' src="js/math.js"></script>
<script type = 'text/javascript' src="js/Block.js"></script>
<script type = 'text/javascript' src="js/Hex.js"></script>
<script type = 'text/javascript' src="js/Text.js"></script>
<script type = 'text/javascript' src="js/comboTimer.js"></script>
<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/input.js"></script>
<script type = 'text/javascript' src="js/main.js"></script>
<script type = 'text/javascript' src="js/initialization.js"></script>
<script type = 'text/javascript' src="vendor_prod_v3/hammer.min.js"></script>
<script type = 'text/javascript' src="vendor_prod_v3/jsonfn.min.js"></script>
<script type = 'text/javascript' src="vendor_prod_v3/keypress.min.js"></script>
<script type = 'text/javascript' src="vendor_prod_v3/jquery.js"></script>
<script type = 'text/javascript' src="js_prod_v3/save-state.js"></script>
<script type = 'text/javascript' src="js_prod_v3/view.js"></script>
<script type = 'text/javascript' src="js_prod_v3/wavegen.js"></script>
<script type = 'text/javascript' src="js_prod_v3/math.js"></script>
<script type = 'text/javascript' src="js_prod_v3/Block.js"></script>
<script type = 'text/javascript' src="js_prod_v3/Hex.js"></script>
<script type = 'text/javascript' src="js_prod_v3/Text.js"></script>
<script type = 'text/javascript' src="js_prod_v3/comboTimer.js"></script>
<script type = 'text/javascript' src="js_prod_v3/checking.js"></script>
<script type = 'text/javascript' src='js_prod_v3/update.js'></script>
<script type = 'text/javascript' src='js_prod_v3/render.js'></script>
<script type = 'text/javascript' src="js_prod_v3/input.js"></script>
<script type = 'text/javascript' src="js_prod_v3/main.js"></script>
<script type = 'text/javascript' src="js_prod_v3/initialization.js"></script>
<script type = 'text/javascript' charset = 'utf-8' src = 'cordova.js'></script>
</head>
<body>

View file

@ -106,7 +106,7 @@ function Block(fallingLane, color, iter, distFromHex, settled) {
p2 = rotatePoint((this.width / 2) * rat, this.height / 2, this.angle);
p3 = rotatePoint((this.widthWide / 2) * rat, -this.height / 2, this.angle);
p4 = rotatePoint((-this.widthWide / 2) * rat, -this.height / 2, this.angle);
if ((MainHex.ct - this.ict) == this.initLen) {
if ((MainHex.ct - this.ict) >= this.initLen) {
this.initializing = 0;
}
} else {

View file

@ -72,6 +72,31 @@ function addKeyListeners() {
pause();
return false;
});
$("#colorBlindBtn").on('touchstart mousedown', function() {
window.colors = ["#8e44ad", "#f1c40f", "#3498db", "#d35400"];
window.hexColorsToTintedColors = {
"#8e44ad": "rgb(229,152,102)",
"#f1c40f": "rgb(246,223,133)",
"#3498db": "rgb(151,201,235)",
"#d35400": "rgb(210,180,222)"
};
window.rgbToHex = {
"rgb(142,68,173)": "#8e44ad",
"rgb(241,196,15)": "#f1c40f",
"rgb(52,152,219)": "#3498db",
"rgb(211,84,0)": "#d35400"
};
window.rgbColorsToTintedColors = {
"rgb(142,68,173)": "rgb(229,152,102)",
"rgb(241,196,15)": "rgb(246,223,133)",
"rgb(52,152,219)": "rgb(151,201,235)",
"rgb(46,204,113)": "rgb(210,180,222)"
};
});
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {

View file

@ -39,7 +39,7 @@ function resumeGame() {
gameState = 1;
hideUIElements();
$('#pauseBtn').show();
$('#restartBtn').show();
$('#restartBtn').hide();
importing = 0;
startTime = Date.now();
setTimeout(function() {
@ -54,7 +54,7 @@ function resumeGame() {
function checkVisualElements() {
if (!$('.helpText').is(":visible")) $('.helpText').fadeIn(150, "linear");
if (!$('#pauseBtn').is(':visible')) $('#pauseBtn').fadeIn(150, "linear");
if (!$('#restartBtn').is(':visible')) $('#restartBtn').fadeIn(150, "linear");
if (!$('#restartBtn').is(':visible')) $('#restartBtn').fadeOut(150, "linear");
}
function hideUIElements() {
@ -101,7 +101,7 @@ function init(b) {
op = 0;
scoreOpacity = 0;
gameState = 1;
$("#restartBtn").show();
$("#restartBtn").hide();
$("#pauseBtn").show();
if (saveState.hex !== undefined) gameState = 1;
@ -195,7 +195,7 @@ function setStartScreen() {
}
$('#pauseBtn').hide();
$('#restartBtn').show();
$('#restartBtn').hide();
$('#startBtn').show();
$('#attributions').show();
showbottombar();
@ -203,16 +203,22 @@ function setStartScreen() {
gameState = 0;
requestAnimFrame(animLoop);
}
setInterval(function(){
if(gameState == 1 ){
if(!MainHex.delay) {
update();
}
else{
MainHex.delay--;
}
}
}, 17);
function animLoop() {
switch (gameState) {
case 1:
requestAnimFrame(animLoop);
if (!MainHex.delay) {
update();
} else {
MainHex.delay--;
}
render();
if (checkGameOver() && !importing) {

View file

@ -37,7 +37,6 @@ function descaleBlock(b) {
}
function writeHighScores() {
debugger;
highscores.sort(
function(a,b){
a = parseInt(a, 10);

View file

@ -67,6 +67,5 @@ function update() {
i--;
}
}
MainHex.ct++;
MainHex.ct++;
}

View file

@ -150,7 +150,7 @@ function setMainMenu() {
setTimeout(function() {
canRestart = 's';
}, 500);
$('#restartBtn').show();
$('#restartBtn').hide();
if ($($("#pauseBtn").children()[0]).attr('class').indexOf('pause') == -1) {
$("#pauseBtnInner").html('<i class="fa fa-pause fa-2x"></i>');
} else {
@ -183,6 +183,7 @@ function pause(o) {
var c = document.getElementById("canvas");
if (gameState == -1) {
$('#restartBtn').fadeOut(150, "linear");
if ($('#helpScreen').is(':visible')) {
$('#helpScreen').fadeOut(150, "linear");
}
@ -196,6 +197,7 @@ function pause(o) {
}, 200)
} else if (gameState != -2 && gameState !== 0 && gameState !== 2) {
$('#restartBtn').fadeIn(150, "linear");
$('.helpText').fadeIn(200, 'linear');
showbottombar();
if (message == 'paused') {

View file

@ -1,14 +1,14 @@
function blockDestroyed() {
if (waveone.nextGen > 1350) {
waveone.nextGen -= 30 * settings.creationSpeedModifier;
waveone.nextGen -= 24 * settings.creationSpeedModifier;
} else if (waveone.nextGen > 600) {
waveone.nextGen -= 15 * settings.creationSpeedModifier;
waveone.nextGen -= 10 * settings.creationSpeedModifier;
} else {
waveone.nextGen = 600;
}
if (waveone.difficulty < 35) {
waveone.difficulty += 0.13 * settings.speedModifier;
waveone.difficulty += 0.17 * settings.speedModifier;
} else {
waveone.difficulty = 35;
}
@ -26,7 +26,7 @@ function waveGen(hex) {
this.dt = 0;
this.update = function() {
this.currentFunction();
this.dt += 16.6666667;
this.dt = MainHex.ct * 16.6666667;
this.computeDifficulty();
if ((this.dt - this.lastGen) * settings.creationSpeedModifier > this.nextGen) {
if (this.nextGen > 600) {
@ -67,11 +67,11 @@ function waveGen(hex) {
this.computeDifficulty = function() {
if (this.difficulty < 35) {
if (this.difficulty < 8) {
this.difficulty += (this.dt - this.last) / (3666667) * settings.speedModifier;
this.difficulty += (this.dt - this.last) / (2566667) * settings.speedModifier;
} else if (this.difficulty < 15) {
this.difficulty += (this.dt - this.last) / (63333333) * settings.speedModifier;
this.difficulty += (this.dt - this.last) / (53333333) * settings.speedModifier;
} else {
this.difficulty += (this.dt - this.last) / (150000000) * settings.speedModifier;
this.difficulty += (this.dt - this.last) / (120000000) * settings.speedModifier;
}
}
};
@ -195,4 +195,4 @@ function waveGen(hex) {
// rest of generation functions
this.currentFunction = this.randomGeneration;
}
}

View file

@ -134,6 +134,18 @@ button:focus {
background-color:rgba(236,240,241,.7);
}
#colorBlindBtn {
position:absolute;
width:120px;
height:20px;
z-index:9999;
left: 47%;
top:65%;
font-size:15px;
text-align:center;
color:#232323;
cursor:pointer;
}
.instructions_body {
margin-left:3px;
width:calc(100% - 12px) ! important;