From 91f63305d7a2a2403be377e29e9fbc8b88d7ed8d Mon Sep 17 00:00:00 2001 From: Makay11 Date: Wed, 22 Apr 2015 23:21:50 +0100 Subject: [PATCH] added info about the space bar. no changes to the game. --- app/dist/js/app.js | 6 +++++- app/dist/stylesheets/app.css | 10 ++++++++++ app/dist/templates/index.html | 3 ++- app/src/js/GameManager.coffee | 3 +++ app/src/stylesheets/app.styl | 10 ++++++++++ app/src/templates/index.jade | 7 ++++--- 6 files changed, 34 insertions(+), 5 deletions(-) diff --git a/app/dist/js/app.js b/app/dist/js/app.js index 5f91b88..4a9d91d 100644 --- a/app/dist/js/app.js +++ b/app/dist/js/app.js @@ -366,6 +366,7 @@ GameManager = (function() { } else { this.paused = !this.paused; } + $(".info").toggle(); if (this.paused) { this.music.stop(); if (this.musicTimeout) { @@ -438,7 +439,10 @@ GameManager = (function() { if (!energy || dead) { this.paused = true; this.gameOver = true; - return (ref = this.music) != null ? ref.stop() : void 0; + if ((ref = this.music) != null) { + ref.stop(); + } + return $(".info").show(); } }; diff --git a/app/dist/stylesheets/app.css b/app/dist/stylesheets/app.css index 130291c..388c0c1 100644 --- a/app/dist/stylesheets/app.css +++ b/app/dist/stylesheets/app.css @@ -7,6 +7,16 @@ canvas { width: 100%; height: 100%; } +.info { + position: absolute; + top: 47%; + width: 100%; + font-size: 30px; + line-height: 50px; + text-align: center; + color: #ff0; + background-color: #000; +} .hud .energyMeter { width: 20%; height: 3%; diff --git a/app/dist/templates/index.html b/app/dist/templates/index.html index 5479d04..2d2cb16 100644 --- a/app/dist/templates/index.html +++ b/app/dist/templates/index.html @@ -6,12 +6,13 @@ +

Press space to start/pause/resume/restart.

-

+

diff --git a/app/src/js/GameManager.coffee b/app/src/js/GameManager.coffee index fdd3f6f..54c238f 100644 --- a/app/src/js/GameManager.coffee +++ b/app/src/js/GameManager.coffee @@ -94,6 +94,8 @@ class GameManager else @paused = not @paused + $(".info").toggle() + if @paused @music.stop() if @musicTimeout @@ -156,6 +158,7 @@ class GameManager @paused = true @gameOver = true @music?.stop() + $(".info").show() render: -> @enemyManager.render(@camera) diff --git a/app/src/stylesheets/app.styl b/app/src/stylesheets/app.styl index ee4fae7..736f959 100644 --- a/app/src/stylesheets/app.styl +++ b/app/src/stylesheets/app.styl @@ -7,6 +7,16 @@ canvas width 100% height 100% +.info + position absolute + top 47% + width 100% + font-size 30px + line-height 50px + text-align center + color yellow + background-color black + .hud .energyMeter width 20% diff --git a/app/src/templates/index.jade b/app/src/templates/index.jade index f4eab91..914ff83 100644 --- a/app/src/templates/index.jade +++ b/app/src/templates/index.jade @@ -8,13 +8,15 @@ html link(rel="stylesheet" type="text/css" href="/stylesheets/app.css") body + h1.info Press space to start/pause/resume/restart. + .hud .energyMeter .energy .sequenceOverlay - p.text - + p.text + .scores .score p.text 0 @@ -22,7 +24,6 @@ html p.text 0 img(src="images/score.png") - script(type="text/javascript" src="/components/jquery/jquery-2.1.3.min.js") script(type="text/javascript" src="/components/three/three.min.js")