fixed merge conflict, added down/s key
This commit is contained in:
commit
a302249271
4 changed files with 52 additions and 5 deletions
|
@ -64,6 +64,7 @@ function initialize(a) {
|
|||
blockHeight: 20,
|
||||
rows: 7,
|
||||
speedModifier: 0.73,
|
||||
speedUpKeyHeld: false,
|
||||
creationSpeedModifier: 0.73,
|
||||
comboTime: 310
|
||||
};
|
||||
|
@ -82,6 +83,7 @@ function initialize(a) {
|
|||
blockHeight: 15,
|
||||
rows: 8,
|
||||
speedModifier: 0.65,
|
||||
speedUpKeyHeld: false,
|
||||
creationSpeedModifier: 0.65,
|
||||
comboTime: 310
|
||||
};
|
||||
|
|
47
js/input.js
47
js/input.js
|
@ -16,6 +16,29 @@ function addKeyListeners() {
|
|||
}
|
||||
}
|
||||
});
|
||||
keypress.register_combo({
|
||||
keys: "down",
|
||||
on_keydown: function() {
|
||||
var tempSpeed = settings.speedModifier;
|
||||
if (MainHex && gameState !== 0){
|
||||
//speed up block temporarily
|
||||
if(settings.speedUpKeyHeld == false){
|
||||
settings.speedUpKeyHeld = true;
|
||||
window.rush *=4;
|
||||
}
|
||||
}
|
||||
//settings.speedModifier = tempSpeed;
|
||||
},
|
||||
on_keyup:function(){
|
||||
if (MainHex && gameState !== 0){
|
||||
//speed up block temporarily
|
||||
|
||||
window.rush /=4;
|
||||
settings.speedUpKeyHeld = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
keypress.register_combo({
|
||||
keys: "a",
|
||||
on_keydown: function() {
|
||||
|
@ -33,7 +56,29 @@ function addKeyListeners() {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
keypress.register_combo({
|
||||
keys: "s",
|
||||
on_keydown: function() {
|
||||
var tempSpeed = settings.speedModifier;
|
||||
if (MainHex && gameState !== 0){
|
||||
//speed up block temporarily
|
||||
if(settings.speedUpKeyHeld == false){
|
||||
settings.speedUpKeyHeld = true;
|
||||
window.rush *=4;
|
||||
}
|
||||
}
|
||||
//settings.speedModifier = tempSpeed;
|
||||
},
|
||||
on_keyup:function(){
|
||||
if (MainHex && gameState !== 0){
|
||||
//speed up block temporarily
|
||||
|
||||
window.rush /=4;
|
||||
settings.speedUpKeyHeld = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
keypress.register_combo({
|
||||
keys: "p",
|
||||
on_keydown: function(){pause();}
|
||||
|
|
|
@ -96,7 +96,7 @@ function init(b) {
|
|||
}
|
||||
|
||||
setTimeout(function() {
|
||||
if (gameState == 1) {
|
||||
if (gameState == 1) {
|
||||
$('#openSideBar').fadeOut(150, "linear");
|
||||
}
|
||||
infobuttonfading = false;
|
||||
|
@ -362,7 +362,7 @@ function showHelp() {
|
|||
}
|
||||
}
|
||||
|
||||
$("#inst_main_body").html("<div id = 'instructions_head'>HOW TO PLAY</div><br><p>The goal of Hextris is to stop blocks from leaving the inside of the outer gray hexagon.</p><p>" + (settings.platform != 'mobile' ? 'Press the right and left arrow keys' : 'Tap the left and right sides of the screen') + " to rotate the Hexagon</p><p>Clear blocks and get points by making 3 or more blocks of the same color touch.</p><p>Time left before your combo streak disappears is indicated by <span style='color:#f1c40f;'>the</span> <span style='color:#e74c3c'>colored</span> <span style='color:#3498db'>lines</span> <span style='color:#2ecc71'>on</span> the outer hexagon.</p><hr> <p id = 'afterhr'></p> By <a href='http://loganengstrom.com' target='_blank'>Logan Engstrom</a> & <a href='http://github.com/garrettdreyfus' target='_blank'>Garrett Finucane</a><br>Find Hextris on <a href = 'https://itunes.apple.com/us/app/id903769553?mt=8' target='_blank'>iOS</a> & <a href ='https://play.google.com/store/apps/details?id=com.hextris.hextris' target='_blank'>Android</a><br>More @ the <a href ='http://hextris.github.io/' target='_blank'>Hextris Website</a>");
|
||||
$("#inst_main_body").html("<div id = 'instructions_head'>HOW TO PLAY</div><p>The goal of Hextris is to stop blocks from leaving the inside of the outer gray hexagon.</p><p>" + (settings.platform != 'mobile' ? 'Press the right and left arrow keys' : 'Tap the left and right sides of the screen') + " to rotate the Hexagon." + (settings.platform != 'mobile' ? ' Press the down arrow to speed up the block falling': '') + " </p><p>Clear blocks and get points by making 3 or more blocks of the same color touch.</p><p>Time left before your combo streak disappears is indicated by <span style='color:#f1c40f;'>the</span> <span style='color:#e74c3c'>colored</span> <span style='color:#3498db'>lines</span> <span style='color:#2ecc71'>on</span> the outer hexagon</p> <hr> <p id = 'afterhr'></p> By <a href='http://loganengstrom.com' target='_blank'>Logan Engstrom</a> & <a href='http://github.com/garrettdreyfus' target='_blank'>Garrett Finucane</a><br>Find Hextris on <a href = 'https://itunes.apple.com/us/app/id903769553?mt=8' target='_blank'>iOS</a> & <a href ='https://play.google.com/store/apps/details?id=com.hextris.hextris' target='_blank'>Android</a><br>More @ the <a href ='http://hextris.github.io/' target='_blank'>Hextris Website</a>");
|
||||
if (gameState == 1) {
|
||||
pause();
|
||||
}
|
||||
|
|
|
@ -34,9 +34,9 @@ function drawScoreboard() {
|
|||
} else if (scoreString.length == 9) {
|
||||
scoreSize = 27;
|
||||
}
|
||||
if (rush ==1){
|
||||
//if (rush ==1){
|
||||
var color = "rgb(236, 240, 241)";
|
||||
}
|
||||
//}
|
||||
var fontSize = settings.platform == 'mobile' ? 35 : 30;
|
||||
var h = trueCanvas.height / 2 + gdy + 100 * settings.scale;
|
||||
if (gameState === 0) {
|
||||
|
|
Loading…
Reference in a new issue