Skip to content

Commit

Permalink
Merge pull request #16 from hobnob/features/minorAmends
Browse files Browse the repository at this point in the history
Minor amends
  • Loading branch information
hobnob committed Nov 28, 2012
2 parents 2ad7a3d + 31cc5ac commit 7e79bfa
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 4 deletions.
19 changes: 17 additions & 2 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ canvas
{
position:relative;
width:800px;
background: -webkit-linear-gradient(#ECECEC, #CACACA);
background: -moz-linear-gradient(#ECECEC, #CACACA);
background: -o-linear-gradient(#ECECEC, #CACACA);
background: -ms-linear-gradient(#ECECEC, #CACACA);
background: linear-gradient(#ECECEC, #CACACA);
border-bottom: 1px solid #9A9A9A;
border-radius: 0px 0px 10px 10px;
color:#585351;
text-shadow: 0 1px 0 white;
text-shadow: 0px 1px 0px white;
padding-top:10px;
padding-bottom:10px;
font-weight: bold;
Expand Down Expand Up @@ -172,4 +176,15 @@ canvas
height:101px;
top:-160px;
margin-left:198px;
}
}

#game_scorecard .disabled
{
opacity:0.5;
}

#game_scorecard .disabled:hover
{
cursor: default;
background-position: 0px 0px;
}
21 changes: 21 additions & 0 deletions js/lib/levels/level_5.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[
{"type":"stats","clonePar":1,"timePar":20,"lastLevel":true},
{"type":"wall","x":0,"y":680,"repeat-x":2},
{"type":"player","x":50,"y": 550},
{"type":"platform", "x": 150, "y": 520,"width":250,"height":26},
{"type":"orGate","x":0,"y":0,"outputs":[
{"type":"door", "x":150,"y":68},
{"type":"door", "x":315,"y":68}
],"inputs":[
{"type":"lever","x":450,"y": 641},
{"type":"lever","x":800,"y": 641,"outputs":[
{"type":"door", "x":900,"y":218},
{"type":"orGate","x":0,"y":0,"outputs":[
{"type":"door", "x":600,"y":218}
],"inputs":[
{"type":"lever","x":235,"y": 492}
]}
]}
]},
{"type":"goal","x":1090,"y":540}
]
19 changes: 17 additions & 2 deletions js/lib/scorecard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ function scorecard()

var _timeTaken = 0;

var _lastLevel = false;

if ( !($('#game_scorecard').length) )
{
$('#gameWindow').append('<div id="game_scorecard_bg"></div>');
Expand Down Expand Up @@ -37,12 +39,16 @@ function scorecard()
return this;
}

this.setClonesUsed = function( clones )
{
this.setClonesUsed = function( clones ){
_clones = clones;
return this;
}

this.setLastLevel = function(last){
_lastLevel = last;
return this;
}

this.show = function(){
$('#game_scorecard .clones').text(_clones);
$('#game_scorecard .time').text(_calcTime());
Expand Down Expand Up @@ -77,6 +83,15 @@ function scorecard()
$('#game_scorecard .score').append(star);
}

if ( _lastLevel )
{
$('#game_scorecard .nextLevel').addClass('disabled');
}
else
{
$('#game_scorecard .nextLevel').removeClass('disabled');
}

$('#game_scorecard_bg').fadeIn();
}

Expand Down
5 changes: 5 additions & 0 deletions js/lib/startMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ function startMenu()
event.preventDefault();
}

if ( $('#game_scorecard .nextLevel').hasClass('disabled') )
{
return false;
}

lvlNum++;

resetLevel();
Expand Down
9 changes: 9 additions & 0 deletions js/lib/world.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,15 @@ function world()
{
_scorecard.setParForClones(data[i]['clonePar']);
_scorecard.setParForTime(data[i]['timePar']);

if ( typeof(data[i]['lastLevel']) == 'boolean' )
{
_scorecard.setLastLevel(data[i]['lastLevel']);
}
else
{
_scorecard.setLastLevel(false);
}
}
else
{
Expand Down

0 comments on commit 7e79bfa

Please sign in to comment.