put instructions inside of pause menu

This commit is contained in:
lengstrom 2014-07-19 16:19:07 -04:00
parent 80ccc10b46
commit eff06e4c18
4 changed files with 38 additions and 26 deletions

View file

@ -133,7 +133,6 @@ function initialize() {
}
};
debugger;
$('#startBtn').on('touchstart mousedown', function(){
if (importing == 1) {
init(1);

View file

@ -41,11 +41,18 @@ function render() {
}
}
if (gameState == -1) {
ctx.globalAlpha = 0.9;
ctx.fillStyle = 'rgb(236,240,241)';
ctx.fillRect(0, 0, trueCanvas.width, trueCanvas.height);
ctx.globalAlpha = 1;
}
settings.prevScale = settings.scale;
settings.hexWidth = settings.baseHexWidth * settings.scale;
settings.blockHeight = settings.baseBlockHeight * settings.scale;
if (MainHex.ct < 400 && (gameState != 0) && !MainHex.playThrough) {
if ((MainHex.ct < 400 && (gameState !== 0) && !MainHex.playThrough) || gameState == -1) {
if (MainHex.ct > 350) {
ctx.globalAlpha = (50 - (MainHex.ct - 350))/50;
}
@ -54,6 +61,12 @@ function render() {
ctx.globalAlpha = (MainHex.ct)/50;
}
renderBeginningText();
ctx.globalAlpha = 1;
}
}
function renderBeginningText() {
renderText((trueCanvas.width)/2 + 1.5 * settings.scale, (trueCanvas.height)/2 - 208 * settings.scale, 35, '#2c3e50', 'Controls', '35px Roboto');
renderText((trueCanvas.width)/2 - 85 * settings.scale, (trueCanvas.height)/2 - 169 * settings.scale, 20, '#2c3e50', 'Rotation:', '20px Roboto');
renderText((trueCanvas.width)/2 - 21 * settings.scale, (trueCanvas.height)/2 - 141 * settings.scale, 12, '#2c3e50', 'Left', '12px Roboto');
@ -63,12 +76,11 @@ function render() {
renderText((trueCanvas.width)/2 + 1.5 * settings.scale, (trueCanvas.height)/2 - 125 * settings.scale, 20, '#2c3e50', 'Rotate the Hexagon to make combos of 3+ touching blocks!', '20px Roboto');
renderText((trueCanvas.width)/2 + 1.5 * settings.scale, (trueCanvas.height)/2 - 105 * settings.scale, 20, '#2c3e50', 'Make combos in a row to receive a score multiplier!', '20px Roboto');
renderText((trueCanvas.width)/2 + 1.5 * settings.scale, (trueCanvas.height)/2 - 85 * settings.scale, 20, '#2c3e50', 'Don\'t let the blocks stack outside of the gray Hexagon!', '20px Roboto');
ctx.globalAlpha = 1;
}
}
function drawKey(key, x, y) {
ctx.save();
ctx.beginPath();
ctx.fillStyle = '#2c3e50';
ctx.strokeStyle = '#2c3e50';
ctx.lineWidth = 4 * settings.scale;

View file

@ -118,20 +118,26 @@ function showText(text){
messages['gameover'] += "</table><br><div class='unselectable centeredSubHeader'>" + restartText + "</div>";
if (allZ)
if (allZ) {
for (i = 0; i < highscores.length; i++) {
if (highscores[i] != 0) {
allZ = 0;
}
}
}
}
var pt = document.getElementById("overlay");
pt.className = 'unfaded';
if (text == 'paused' && settings.platform == 'mobile') {
if (text == 'paused') {
$(pt).css('margin-top','-5%');
if (settings.platform == 'mobile') {
text = 'pausedMobile';
}
} else {
$(pt).css('margin-top','-10%');
}
pt.innerHTML = messages[text];
}
@ -158,14 +164,10 @@ function pause(o) {
var c = document.getElementById("canvas");
if (gameState == -1 ) {
hideText();
c.className = '';
setTimeout(function(){
gameState = prevGameState;
}, 300);
}
else if(gameState != -2 && gameState !== 0 && gameState !== 2) {
c.className = "blur";
if (message == 'paused') {
showText(message);
}

View file

@ -128,7 +128,6 @@ and (max-device-width : 480px) {
}
#overlay {
transition: all 0.3s ease;
position:absolute;
height:20%;
width:100%;