Skip to content

Commit

Permalink
The end...?
Browse files Browse the repository at this point in the history
  • Loading branch information
hobnob committed Nov 29, 2012
1 parent 260372f commit 03a37ae
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 7 deletions.
10 changes: 10 additions & 0 deletions css/main.css
Expand Up @@ -25,6 +25,16 @@ canvas
box-shadow: 0 0 10px #000000;
}

#gameEnd
{
position:relative;
display:none;
width:800px;
height:600px;
background-image:url('../img/end.png');
top:-604px;
}

#preload
{
padding-top:250px;
Expand Down
Binary file added img/end.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions index.htm
Expand Up @@ -29,6 +29,7 @@
</div>
<div id="gameWindow">
<canvas id="gjs-canvas"></canvas>
<div id="gameEnd"></div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion js/lib/levels/level_1.js
@@ -1,5 +1,5 @@
[
{"type":"stats","clonePar":1,"timePar":10},
{"type":"stats","clonePar":1,"timePar":10,"lastLevel":true},
{"type":"wall","x":0,"y":680,"repeat-x":2},
{"type":"player","x":150,"y": 550},
{"type":"lever","x":350,"y": 641,"outputs":[
Expand Down
30 changes: 25 additions & 5 deletions js/lib/scorecard.js
Expand Up @@ -85,11 +85,31 @@ function scorecard()

if ( _lastLevel )
{
$('#game_scorecard .nextLevel').addClass('disabled');
}
else
{
$('#game_scorecard .nextLevel').removeClass('disabled');
$('.nextLevel').on('click', function( event ){
$('#game_scorecard_bg').hide();
$('#gameEnd').fadeIn();

$('body').on('keydown',function(event2){
switch ( event2.keyCode )
{
//Enter and e will all move to the next level
case 13:
case 69:
event2.preventDefault();
event2.stopImmediatePropagation();

$('#game_scorecard .mainMenu').click();
$('#gameEnd').fadeOut();
$(this).off();
}

return false;
});

$(this).off();
event.preventDefault();
event.stopImmediatePropagation();
});
}

$('#game_scorecard_bg').fadeIn();
Expand Down
5 changes: 4 additions & 1 deletion js/main.js
Expand Up @@ -6,7 +6,10 @@ gamejs.preload([
'img/splash-screen.png','img/new-game.png', 'img/bg.png','img/player.png',
'img/blank.png','img/switch.png','img/door.png','img/goal.png',
'img/platform-left.png','img/platform-right.png',
'img/platform-middle.png', 'img/selected.png'
'img/platform-middle.png', 'img/selected.png',
'img/scorecard-background.png','img/game-window.png',
'img/reset.png', 'img/star-off.png', 'img/star-on.png',
'img/menu-button.png', 'img/next-button.png', 'img/end.png'
]);

gamejs.ready(function() {
Expand Down

0 comments on commit 03a37ae

Please sign in to comment.