Skip to content

Commit

Permalink
Merge pull request #19 from hobnob/features/theEnd
Browse files Browse the repository at this point in the history
The end....?
  • Loading branch information
hobnob committed Nov 29, 2012
2 parents 260372f + e106830 commit a833387
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 6 deletions.
11 changes: 11 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
body
{
background-color:#ECECEC;
overflow:hidden;
}

#preload, #gameWindow
Expand All @@ -25,6 +26,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
Loading
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
</div>
<div id="gameWindow">
<canvas id="gjs-canvas"></canvas>
<div id="gameEnd"></div>
</div>
</body>
</html>
30 changes: 25 additions & 5 deletions js/lib/scorecard.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 a833387

Please sign in to comment.