Skip to content

Commit

Permalink
Modifies the main game window
Browse files Browse the repository at this point in the history
Modified the main game window so that it now looks much sleeker
  • Loading branch information
hobnob committed Nov 28, 2012
1 parent 522bb2e commit 4ede716
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 10 deletions.
37 changes: 31 additions & 6 deletions css/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
body
{
background-color:#ECECEC;
}

#preload, #gameWindow
{
margin:auto;
}

#gameWindow
{
padding:19px 29px;
width:800px;
height:600px;
background-image:url('../img/game-window.png');
background-repeat:no-repeat;
display:none;
}

canvas
{
-moz-box-shadow: 0 0 10px #000000;
-webkit-box-shadow: 0 0 10px #000000;
box-shadow: 0 0 10px #000000;
}

#preload
{
padding-top:250px;
Expand All @@ -14,7 +41,7 @@

#game_tooltip
{
position:absolute;
position:relative;
width:800px;
background: linear-gradient(#ECECEC, #CACACA);
border-bottom: 1px solid #9A9A9A;
Expand All @@ -25,18 +52,16 @@
padding-bottom:10px;
font-weight: bold;
text-align: center;
top:8px;
left:8px;
top:-605px;
display:none;
}

#game_scorecard_bg
{
position:absolute;
position:relative;
width:800px;
height:600px;
top:8px;
left:8px;
top:-624px;
background-color: rgba(0,0,0,0.4);
display:none;
}
Expand Down
Binary file added img/game-window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@
<img src="img/loading.gif" />
<img src="img/loading-text.png" />
</div>
<div id="gameWindow">
<canvas id="gjs-canvas"></canvas>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion js/lib/scorecard.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function scorecard()

if ( !($('#game_scorecard').length) )
{
$('body').append('<div id="game_scorecard_bg"></div>');
$('#gameWindow').append('<div id="game_scorecard_bg"></div>');
$('#game_scorecard_bg').append('<div id="game_scorecard"></div>');
$('#game_scorecard').append('<h1>Results</h1>');
$('#game_scorecard').append('<p>Number of Clones<span class="clones">0</span></p>');
Expand Down
19 changes: 16 additions & 3 deletions js/lib/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function tooltip()

if ( !($('#game_tooltip').length) )
{
$('body').append('<div id="game_tooltip"></div>');
$('#gameWindow').append('<div id="game_tooltip"></div>');
}

var _text = '';
Expand Down Expand Up @@ -40,8 +40,21 @@ function tooltip()
tooltip.timer = setTimeout(this.hide, 5000)
}

this.hide = function(){
$('#game_tooltip').fadeOut();
this.hide = function(animate){
if ( typeof(animate) == 'undefined' )
{
animate = true;
}

if ( animate )
{
$('#game_tooltip').fadeOut();
}
else
{
$('#game_tooltip').hide();
}

tooltip.timer = null;
}

Expand Down
9 changes: 9 additions & 0 deletions js/lib/world.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,15 @@ function world()

if ( _levelComplete )
{
for( var i = 0; i < _objects.sprites().length; i++ )
{
var obj = _objects.sprites()[i];
if ( obj instanceof tooltip )
{
obj.hide(false);
}
}

_scorecard.setTimeTaken(_gameTime / 1000);
_scorecard.setClonesUsed(_p.getNumClones());
_scorecard.show();
Expand Down
1 change: 1 addition & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ gamejs.ready(function() {

//Remove the loading bar
$('#preload').remove();
$('#gameWindow').show();

//Set up the tick function, run at 60fps
gamejs.time.fpsCallback(tick, self, 60);
Expand Down

0 comments on commit 4ede716

Please sign in to comment.