",
+ " | <%= ['1st','2nd','3rd','4th','5th'][i] %> | ",
+ " <%= leaders[i] && leaders[i].score || '***' %> | ",
+ " <%= leaders[i] && leaders[i].level || '***' %> | ",
+ " <%= leaders[i] && leaders[i].name || '***' %> | ",
+ "
",
+ "<% }); %>"
+ ].join(""));
+
+ board.html(template({
+ leaders: []
+ }));
+
+ $.get("/highscore", {}, function(response) {
+ board.html(template({
+ leaders: _.sortBy(response.data, function(leader){
+ return parseInt(leader.score);
+ }).reverse()
+ }));
+ });
+
+};
+
+function drawLevelLine(){
+ var canvas = document.getElementById("level_canvas"),
+ context = canvas.getContext("2d");
+
+ context.strokeStyle = 'white';
+ context.lineWidth = 2;
+
+ context.beginPath();
+ context.moveTo(drawingConfig.level_start_x, 10);
+ context.lineTo(drawingConfig.level_line_size, 10);
+ context.stroke();
+ context.closePath();
+
+ for (i=0; i <= drawingConfig.level_count; i++){
+ var x = drawingConfig.level_start_x + i * drawingConfig.level_slice_size,
+ start_y = drawingConfig.level_start_y,
+ end_y = drawingConfig.level_end_y;
+
+ if(i % 5 == 0){
+ start_y -= 5;
+ end_y += 5;
+ }
+
+ context.beginPath();
+ context.moveTo(x, start_y);
+ context.lineTo(x, end_y);
+ context.stroke();
+ context.closePath();
+ }
+}
+
+$(function(){
+
+ $("#level_slider").slider({
+ value:0,
+ min: 0,
+ max: 20,
+ step: 1,
+ change: function( event, ui ) {
+ $("#level_amount").html( ui.value );
+ }
+ });
+ $("#level_slider .ui-slider-handle").unbind("keydown");
+
+ $("#speed_slider").slider({
+ min: 0,
+ max: speeds.length - 1,
+ step: 1
+ });
+ $("#speed_slider .ui-slider-handle").unbind("keydown");
+
+ $("#music_slider").slider({
+ min: 0,
+ max: musics.length - 1,
+ step: 1,
+ change: setMusic
+ });
+ $("#music_slider .ui-slider-handle").unbind("keydown");
+
+ $("#play").bind('click', function(){
+ start();
+ return false;
+ });
+
+ drawLevelLine();
+
+ populateLeaderBoard();
+
+ $('#level_slider .ui-slider-handle').focus(function() {
+ $("#level_title").addClass('border');
+ $("#speed_title").removeClass('border');
+ $("#music_title").removeClass('border');
+ });
+
+ $('#speed_slider .ui-slider-handle').focus(function() {
+ $("#speed_title").addClass('border');
+ $("#level_title").removeClass('border');
+ $("#music_title").removeClass('border');
+ });
+
+ $('#music_slider .ui-slider-handle').focus(function() {
+ $("#music_title").addClass('border');
+ $("#speed_title").removeClass('border');
+ $("#level_title").removeClass('border');
+ });
+
+ $("#level_canvas").on("click", function(e) {
+ var value = Math.round(Math.min(Math.max((e.offsetX - 20) / 320 * 20, 0), 20));
+ $("#level_amount").html(value);
+ $("#level_slider").slider("value", value);
+ setFocus("level");
+ });
+
+ $("p",".options").each(function(i,element) {
+ $(element).on("click", function() {
+ if(i < 3) {
+ $("#speed_slider").slider("value", i % 3);
+ setFocus("speed");
+ } else {
+ $("#music_slider").slider("value", i % 3);
+ setFocus("music");
+ }
+ });
+ });
+
+ setFocus();
+
+ Sound.init()
+ setMusic()
+
+});
+
+var focused = 0;
+var focus_order = ["level", "speed", "music"];
+var focus_handles = {
+ level: "#level_slider .ui-slider-handle",
+ speed: "#speed_slider .ui-slider-handle",
+ music: "#music_slider .ui-slider-handle"
+};
+var focus_values = {
+ level: "#level_slider",
+ speed: "#speed_slider",
+ music: "#music_slider"
+};
+
+var setFocus = function(option) {
+
+ if(!option) {
+ $(focus_handles[focus_order[focused]]).focus();
+ } else {
+ $(focus_handles[option]).focus();
+ focused = focus_order.indexOf(option);
+ }
+
+}
+
+var setFocusNext = function() {
+ focused = (focused + 1) % focus_order.length;
+ $(focus_handles[focus_order[focused]]).focus();
+}
+
+var setFocusPrev = function() {
+ focused = focused === 0 ? focus_order.length - 1 : focused - 1;
+ $(focus_handles[focus_order[focused]]).focus();
+}
+
+var goLeft = function() {
+ var new_value = $(focus_values[focus_order[focused]]).slider("value") - 1;
+ $(focus_values[focus_order[focused]]).slider("value", new_value);
+}
+
+var goRight = function() {
+ var new_value = $(focus_values[focus_order[focused]]).slider("value") + 1;
+ $(focus_values[focus_order[focused]]).slider("value", new_value);
+}
+
+var setMusic = function () {
+ var music = musics[$("#music_slider").slider("value")];
+ if (music != "off") {
+ Sound.musicSet(music);
+ } else {
+ Sound.musicStop();
+ }
+}
+
+$(window).on('keydown', function(e) {
+ var code = (e.keyCode ? e.keyCode : e.which);
+
+ switch (code) {
+ case 13:
+ start();
+ break;
+ case 37:
+ goLeft();
+ break;
+ case 38:
+ setFocusPrev();
+ break;
+ case 39:
+ goRight();
+ break;
+ case 40:
+ setFocusNext();
+ break;
+ }
+});
\ No newline at end of file
diff --git a/public/javascripts/sound.js b/public/javascripts/sound.js
new file mode 100644
index 0000000..289b4ee
--- /dev/null
+++ b/public/javascripts/sound.js
@@ -0,0 +1,88 @@
+window.Sound = (function() {
+
+ var sounds = {
+ rotate: "/wav/rotate.wav",
+ move: "/wav/move.wav",
+ explode: "/wav/explode.wav",
+ fever: "/mp3/fever.mp3",
+ chill: "/mp3/chill.mp3"
+ };
+
+ return {
+
+ song: false,
+ canPlay: false,
+ operative: false,
+
+ init: function() {
+ var _this = this;
+ soundManager.setup({
+ url: '/flash/',
+ flashLoadTimeout: 5000,
+ onready: function() {
+ _.each(sounds, function(url, id) {
+ soundManager.createSound({
+ id: id,
+ url: url
+ });
+ });
+ _this.canPlay = true;
+ _this.musicPlay();
+ },
+ ontimeout: function(status) {
+ console.log('SM2 failed to start. Flash missing, blocked or security error?');
+ console.log('The status is ' + status.success + ', the error type is ' + status.error.type);
+ }
+ });
+ },
+
+ rotate: function() {
+ if (this.operative) {
+ soundManager.play("rotate");
+ }
+ },
+
+ move: function() {
+ if (this.operative) {
+ soundManager.play("move");
+ }
+ },
+
+ explode: function() {
+ if (this.operative) {
+ soundManager.play("explode");
+ }
+ },
+
+ musicSet: function(song) {
+ this.song = song;
+ if(this.canPlay) {
+ this.musicStop();
+ this.musicPlay();
+ }
+ },
+
+ musicPlay: function() {
+ if(this.song) {
+ this.operative = true;
+ soundManager.play(this.song, {
+ onfinish: this.musicPlay
+ });
+ }
+ },
+
+ musicStop: function() {
+ this.operative = false;
+ soundManager.stopAll();
+ },
+
+ toggleOnOff: function(){
+ if (this.operative) {
+ this.musicStop();
+ } else {
+ this.musicPlay();
+ }
+ }
+ };
+
+})();
\ No newline at end of file
diff --git a/javascripts/virus.js b/public/javascripts/virus.js
similarity index 96%
rename from javascripts/virus.js
rename to public/javascripts/virus.js
index e12cd0b..e9178ed 100644
--- a/javascripts/virus.js
+++ b/public/javascripts/virus.js
@@ -40,8 +40,8 @@ Virus.prototype.setPosition = function() {
var randY = Math.floor(Math.random() * 13) + this.maxY; // we dont ever put anything in the first X rows based on level
if (this.board.occupied(randX, randY) === undefined && this.board.inBounds(randX, randY)) {
- this.position.x = randX;
- this.position.y = randY;
+ this.position.x = randX;
+ this.position.y = randY;
this.board.addPiece(this, 0);
} else {
this.setPosition();
diff --git a/public/midi/master01.mid b/public/midi/master01.mid
new file mode 100644
index 0000000..05e001b
Binary files /dev/null and b/public/midi/master01.mid differ
diff --git a/public/midi/master02.mid b/public/midi/master02.mid
new file mode 100644
index 0000000..1b3fa04
Binary files /dev/null and b/public/midi/master02.mid differ
diff --git a/public/mp3/chill.mp3 b/public/mp3/chill.mp3
new file mode 100644
index 0000000..3402572
Binary files /dev/null and b/public/mp3/chill.mp3 differ
diff --git a/public/mp3/fever.mp3 b/public/mp3/fever.mp3
new file mode 100644
index 0000000..dcb9294
Binary files /dev/null and b/public/mp3/fever.mp3 differ
diff --git a/styles/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/public/styles/images/ui-bg_diagonals-thick_18_b81900_40x40.png
similarity index 100%
rename from styles/images/ui-bg_diagonals-thick_18_b81900_40x40.png
rename to public/styles/images/ui-bg_diagonals-thick_18_b81900_40x40.png
diff --git a/styles/images/ui-bg_diagonals-thick_20_666666_40x40.png b/public/styles/images/ui-bg_diagonals-thick_20_666666_40x40.png
similarity index 100%
rename from styles/images/ui-bg_diagonals-thick_20_666666_40x40.png
rename to public/styles/images/ui-bg_diagonals-thick_20_666666_40x40.png
diff --git a/styles/images/ui-bg_flat_10_000000_40x100.png b/public/styles/images/ui-bg_flat_10_000000_40x100.png
similarity index 100%
rename from styles/images/ui-bg_flat_10_000000_40x100.png
rename to public/styles/images/ui-bg_flat_10_000000_40x100.png
diff --git a/styles/images/ui-bg_glass_100_f6f6f6_1x400.png b/public/styles/images/ui-bg_glass_100_f6f6f6_1x400.png
similarity index 100%
rename from styles/images/ui-bg_glass_100_f6f6f6_1x400.png
rename to public/styles/images/ui-bg_glass_100_f6f6f6_1x400.png
diff --git a/styles/images/ui-bg_glass_100_fdf5ce_1x400.png b/public/styles/images/ui-bg_glass_100_fdf5ce_1x400.png
similarity index 100%
rename from styles/images/ui-bg_glass_100_fdf5ce_1x400.png
rename to public/styles/images/ui-bg_glass_100_fdf5ce_1x400.png
diff --git a/styles/images/ui-bg_glass_65_ffffff_1x400.png b/public/styles/images/ui-bg_glass_65_ffffff_1x400.png
similarity index 100%
rename from styles/images/ui-bg_glass_65_ffffff_1x400.png
rename to public/styles/images/ui-bg_glass_65_ffffff_1x400.png
diff --git a/styles/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/public/styles/images/ui-bg_gloss-wave_35_f6a828_500x100.png
similarity index 100%
rename from styles/images/ui-bg_gloss-wave_35_f6a828_500x100.png
rename to public/styles/images/ui-bg_gloss-wave_35_f6a828_500x100.png
diff --git a/styles/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/public/styles/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
similarity index 100%
rename from styles/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
rename to public/styles/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
diff --git a/styles/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/public/styles/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
similarity index 100%
rename from styles/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
rename to public/styles/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
diff --git a/styles/images/ui-icons_222222_256x240.png b/public/styles/images/ui-icons_222222_256x240.png
similarity index 100%
rename from styles/images/ui-icons_222222_256x240.png
rename to public/styles/images/ui-icons_222222_256x240.png
diff --git a/styles/images/ui-icons_228ef1_256x240.png b/public/styles/images/ui-icons_228ef1_256x240.png
similarity index 100%
rename from styles/images/ui-icons_228ef1_256x240.png
rename to public/styles/images/ui-icons_228ef1_256x240.png
diff --git a/styles/images/ui-icons_ef8c08_256x240.png b/public/styles/images/ui-icons_ef8c08_256x240.png
similarity index 100%
rename from styles/images/ui-icons_ef8c08_256x240.png
rename to public/styles/images/ui-icons_ef8c08_256x240.png
diff --git a/styles/images/ui-icons_ffd27a_256x240.png b/public/styles/images/ui-icons_ffd27a_256x240.png
similarity index 100%
rename from styles/images/ui-icons_ffd27a_256x240.png
rename to public/styles/images/ui-icons_ffd27a_256x240.png
diff --git a/styles/images/ui-icons_ffffff_256x240.png b/public/styles/images/ui-icons_ffffff_256x240.png
similarity index 100%
rename from styles/images/ui-icons_ffffff_256x240.png
rename to public/styles/images/ui-icons_ffffff_256x240.png
diff --git a/styles/jquery-ui-1.8.23.custom.css b/public/styles/jquery-ui-1.8.23.custom.css
similarity index 100%
rename from styles/jquery-ui-1.8.23.custom.css
rename to public/styles/jquery-ui-1.8.23.custom.css
diff --git a/public/styles/reveal.css b/public/styles/reveal.css
new file mode 100644
index 0000000..511f7ac
--- /dev/null
+++ b/public/styles/reveal.css
@@ -0,0 +1,67 @@
+/* --------------------------------------------------
+ Reveal Modals
+ -------------------------------------------------- */
+
+ .reveal-modal-bg {
+ position: fixed;
+ height: 100%;
+ width: 100%;
+ background: #000;
+ background: rgba(0,0,0,.8);
+ z-index: 100;
+ display: none;
+ top: 0;
+ left: 0;
+ }
+
+ .reveal-modal {
+ visibility: hidden;
+ top: 100px;
+ left: 50%;
+ margin-left: -300px;
+ width: 520px;
+ background: #fff;
+ border:2px solid #d33717;
+ position: absolute;
+ z-index: 101;
+ padding: 20px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+ -moz-box-shadow: 0 0 10px rgba(0,0,0,.4);
+ -webkit-box-shadow: 0 0 10px rgba(0,0,0,.4);
+ -box-shadow: 0 0 10px rgba(0,0,0,.4);
+ }
+
+ .reveal-modal.small { width: 200px; margin-left: -140px;}
+ .reveal-modal.medium { width: 400px; margin-left: -240px;}
+ .reveal-modal.large { width: 600px; margin-left: -340px;}
+ .reveal-modal.xlarge { width: 800px; margin-left: -440px;}
+
+ .reveal-modal .close-reveal-modal {
+ font-size: 22px;
+ line-height: .5;
+ position: absolute;
+ top: 15px;
+ right: 15px;
+ color: #fff;
+ text-shadow: 0 -1px 1px rbga(0,0,0,.6);
+ font-weight: bold;
+ cursor: pointer;
+ }
+ /*
+
+ NOTES
+
+ Close button entity is ×
+
+ Example markup
+
+
+
Awesome. I have it.
+
Your couch. I it's mine.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ultrices aliquet placerat. Duis pulvinar orci et nisi euismod vitae tempus lorem consectetur. Duis at magna quis turpis mattis venenatis eget id diam.
+
×
+
+
+ */
diff --git a/styles/styles.css b/public/styles/styles.css
similarity index 73%
rename from styles/styles.css
rename to public/styles/styles.css
index 5564b85..53c7003 100644
--- a/styles/styles.css
+++ b/public/styles/styles.css
@@ -18,10 +18,8 @@ time, mark, audio, video {
font: inherit;
vertical-align: baseline; }
-html {
- background-image: url("../images/bg.png"); }
-
body {
+ background-image: url("../images/bg.png");
line-height: 1;
max-width: 100%;
overflow: hidden; }
@@ -304,14 +302,18 @@ html {
background-position: center;
border-bottom: 0px; }
+input:focus,
+select:focus,
+textarea:focus {
+ outline: none; }
+
.pane {
- width: 55%;
+ width: 400px;
background: black;
padding: 5%;
color: #FFF;
margin: 0px auto;
border-radius: 10px;
- min-width: 400px;
position: relative;
border: 14px solid brown;
border-image: url(../images/game_border2.png) 20 20 20 20 round round;
@@ -319,40 +321,55 @@ html {
background-size: 99999999999999999px;
background-position: center;
z-index: 1; }
+ .pane #leader_board {
+ color: white; }
+ .pane #leader_board table {
+ width: 100%;
+ table-layout: fixed; }
+ .pane #leader_board table th {
+ padding-bottom: 20px;
+ text-align: right; }
+ .pane #leader_board table td {
+ padding-bottom: 10px;
+ text-align: right; }
+ .pane #leader_board table td:first-child {
+ text-align: left; }
.pane .border {
- border: 3px solid #CC7A29;
+ border: 3px solid #CC7A29 !important;
padding: 5px;
width: 200px;
border-radius: 6px; }
+ .pane #leader_board {
+ color: white; }
.pane .option {
- margin: 60px 40px; }
+ margin-left: 22px; }
.pane .option .title {
+ border: 3px solid transparent;
+ width: 200px;
color: #FFB870;
- padding: 5px;
+ padding: 7px;
clear: both;
- margin: 22px 0px; }
+ margin-left: -20px;
+ margin-top: 10px;
+ margin-bottom: 30px; }
.pane .option .players {
float: left;
width: 10%; }
- .pane .option .sliders {
- float: left;
- width: 60%; }
- .pane .option .sliders p {
- color: white; }
- .pane .option .sliders .left {
- float: left; }
- .pane .option .sliders .center {
- text-align: center;
- margin-left: 20px; }
- .pane .option .sliders .right {
- float: right;
- left: 100%;
- margin-right: -27px;
- margin-top: -18px; }
+ .pane .option .sliders .options {
+ width: 360px; }
+ .pane .option .sliders .options p {
+ display: inline-block;
+ float: left;
+ width: 50px; }
+ .pane .option .sliders .options p.center {
+ padding-left: 29%; }
+ .pane .option .sliders .options p.right {
+ padding-left: 29%; }
.pane .option .levels {
- float: right;
- width: 10%;
- margin: -50px 40px; }
+ position: relative;
+ top: -62px;
+ left: -24px;
+ width: 10%; }
.pane .option .speeds {
float: left;
width: 10%;
@@ -361,9 +378,10 @@ html {
float: left;
width: 10%;
margin-left: 25px; }
- .pane .option #play {
- float: right;
- margin-right: 10px; }
+
+#play {
+ margin-top: 40px;
+ text-align: center; }
.level-number {
float: right;
@@ -372,7 +390,21 @@ html {
-moz-border-radius: 5px;
width: 40px;
height: 20px;
- text-align: center; }
+ text-align: center;
+ line-height: 1.3em; }
+
+#level_canvas_wrap {
+ height: 20px; }
+
+#level_canvas {
+ display: block;
+ height: 20px;
+ position: relative;
+ top: -18px; }
+
+.ui-slider.ui-slider-horizontal.ui-widget.ui-widget-content.ui-corner-all {
+ width: 320px;
+ height: 0px; }
.ui-slider-handle.ui-state-default.ui-corner-all {
background: black;
@@ -381,10 +413,72 @@ html {
height: 0;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
- border-top: 20px solid #B2B26B; }
+ border-top: 20px solid #B2B26B;
+ border-bottom: 0px solid #B2B26B;
+ outline: none; }
.ui-slider.ui-slider-horizontal.ui-widget.ui-widget-content.ui-corner-all {
background: black;
content: "LOW MED HI";
border: 0px;
align-text: justify; }
+
+.modal {
+ border: 4px solid gray !important; }
+
+.nextLevel {
+ width: 200px;
+ float: left; }
+
+.nextLevelNumber {
+ float: left; }
+
+.next-level-button {
+ width: 16px;
+ float: right;
+ text-decoration: none; }
+
+.restart-button {
+ margin-right: 20px;
+ float: right;
+ width: 80px; }
+
+.submit-button {
+ margin-right: 20px;
+ float: right;
+ width: 80px; }
+
+.button-link {
+ font-size: 12px !important;
+ padding: 10px 15px;
+ background: #4479BA;
+ color: #FFF;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ border: solid 1px #20538D;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
+ -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
+ -webkit-transition-duration: 0.2s;
+ -moz-transition-duration: 0.2s;
+ transition-duration: 0.2s;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ cursor: hand;
+ cursor: pointer; }
+
+.button-link:hover {
+ background: #356094;
+ border: solid 1px #2A4E77;
+ text-decoration: none; }
+
+.button-link:active {
+ -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
+ -moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
+ box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
+ background: #2E5481;
+ border: solid 1px #203E5F; }
diff --git a/styles/styles.scss b/public/styles/styles.scss
similarity index 73%
rename from styles/styles.scss
rename to public/styles/styles.scss
index 46f3aa2..84558f1 100644
--- a/styles/styles.scss
+++ b/public/styles/styles.scss
@@ -17,10 +17,8 @@ time, mark, audio, video {
font-size: 100%;
font: inherit;
vertical-align: baseline; }
-html {
- background-image: url('../images/bg.png');
-}
body {
+ background-image: url('../images/bg.png');
line-height: 1;
max-width: 100%;
overflow: hidden;
@@ -91,7 +89,7 @@ width: 100%;
text-align:left;
width: 450px;
margin: 15px auto;
- }
+ }
}
#instructions {
@@ -138,7 +136,7 @@ text-align: center;
max-width: 256px;
}
-#clipboardLeft {
+#clipboardLeft {
background-color: #BDBDFF;
width: 80%;
border-top: solid 10px #FFBD00;
@@ -201,7 +199,7 @@ padding-top: 2.4%;
from {
-webkit-transform: rotate(0deg);
}
- to {
+ to {
-webkit-transform: rotate(360deg);
}
}
@@ -331,14 +329,19 @@ margin: 25px -125px 0 0;
border-bottom: 0px;
}
+input:focus,
+select:focus,
+textarea:focus {
+ outline: none;
+}
+
.pane{
- width: 55%;
+ width: 400px;
background: black;
padding: 5%;
color: #FFF;
margin: 0px auto;
border-radius: 10px;
- min-width: 400px;
position: relative;
border: 14px solid brown;
border-image: url(../images/game_border2.png) 20 20 20 20 round round;
@@ -347,45 +350,69 @@ margin: 25px -125px 0 0;
background-position: center;
z-index: 1;
+ #leader_board{
+ color: white;
+ table{
+ width: 100%;
+ table-layout: fixed;
+ th{
+ padding-bottom: 20px;
+ text-align: right;
+ }
+ td{
+ padding-bottom: 10px;
+ text-align: right;
+ }
+ td:first-child{
+ text-align: left;
+ }
+ }
+ }
+
.border{
- border: 3px solid #CC7A29;
+ border: 3px solid #CC7A29 !important;
padding: 5px;
width: 200px;
border-radius: 6px;
}
+ #leader_board{
+ color: white;
+ }
+
.option{
- margin: 60px 40px;
+ margin-left: 22px;
.title{
+ border: 3px solid transparent;
+ width: 200px;
color: #FFB870;
- padding: 5px;
+ padding: 7px;
clear: both;
- margin: 22px 0px;
+ margin-left: -20px;
+ margin-top: 10px;
+ margin-bottom: 30px;
}
.players{
float: left;
width: 10%;
}
.sliders{
- float: left;
- width: 60%;
- p{
- color: white;
+ .options{
+ width: 360px;
+ p{
+ display: inline-block;
+ float: left;
+ width: 50px;
+ }
+ p.center{ padding-left: 29%; }
+ p.right{ padding-left: 29%; }
}
- .left{float: left;}
- .center{
- text-align: center;
- margin-left: 20px;}
- .right{
- float: right;
- left: 100%;
- margin-right: -27px;
- margin-top: -18px;}
}
.levels{
- float: right;
+ position: relative;
+ top: -62px;
+ left: -24px;
width: 10%;
- margin: -50px 40px;
}
.speeds{
float: left;
@@ -397,13 +424,14 @@ margin: 25px -125px 0 0;
width: 10%;
margin-left: 25px;
}
- #play{
- float: right;
- margin-right: 10px;
- }
}
}
+#play{
+ margin-top: 40px;
+ text-align: center;
+}
+
.level-number{
float: right;
border: 3px solid #0f0;
@@ -412,16 +440,38 @@ margin: 25px -125px 0 0;
width: 40px;
height: 20px;
text-align: center;
+ line-height: 1.3em;
+}
+
+#level_canvas_wrap{
+ height: 20px;
+}
+
+#level_canvas{
+ display: block;
+ height: 20px;
+ position: relative;
+ top: -18px;
+}
+
+#level_slider.ui-slider.ui-slider-horizontal.ui-widget.ui-widget-content.ui-corner-all{
+}
+
+.ui-slider.ui-slider-horizontal.ui-widget.ui-widget-content.ui-corner-all{
+ width: 320px;
+ height: 0px;
}
.ui-slider-handle.ui-state-default.ui-corner-all{
background: black;
margin: -16px 0px;
- width: 0;
- height: 0;
+ width: 0;
+ height: 0;
border-left: 20px solid transparent;
- border-right: 20px solid transparent;
+ border-right: 20px solid transparent;
border-top: 20px solid #B2B26B;
+ border-bottom: 0px solid #B2B26B;
+ outline: none;
}
.ui-slider.ui-slider-horizontal.ui-widget.ui-widget-content.ui-corner-all{
@@ -429,4 +479,71 @@ margin: 25px -125px 0 0;
content: "LOW MED HI";
border: 0px;
align-text: justify;
+}
+
+.modal{
+ border: 4px solid gray !important;
+}
+
+.nextLevel{
+ width: 200px;
+ float: left;
+}
+
+.nextLevelNumber{
+ float: left;
+}
+
+.next-level-button{
+ width: 16px;
+ float: right;
+ text-decoration: none;
+}
+
+.restart-button{
+ margin-right: 20px;
+ float: right;
+ width: 80px;
+}
+
+.submit-button{
+ margin-right: 20px;
+ float: right;
+ width: 80px;
+}
+
+.button-link {
+ font-size: 12px !important;
+ padding: 10px 15px;
+ background: #4479BA;
+ color: #FFF;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ border: solid 1px #20538D;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
+ -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
+ -webkit-transition-duration: 0.2s;
+ -moz-transition-duration: 0.2s;
+ transition-duration: 0.2s;
+ -webkit-user-select:none;
+ -moz-user-select:none;
+ -ms-user-select:none;
+ user-select:none;
+ cursor: hand;
+ cursor: pointer;
+}
+.button-link:hover {
+ background: #356094;
+ border: solid 1px #2A4E77;
+ text-decoration: none;
+}
+.button-link:active {
+ -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
+ -moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
+ box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
+ background: #2E5481;
+ border: solid 1px #203E5F;
}
\ No newline at end of file
diff --git a/public/wav/explode.wav b/public/wav/explode.wav
new file mode 100644
index 0000000..9e3646f
Binary files /dev/null and b/public/wav/explode.wav differ
diff --git a/public/wav/move.wav b/public/wav/move.wav
new file mode 100644
index 0000000..ff5390e
Binary files /dev/null and b/public/wav/move.wav differ
diff --git a/public/wav/rotate.wav b/public/wav/rotate.wav
new file mode 100644
index 0000000..cce8c08
Binary files /dev/null and b/public/wav/rotate.wav differ
diff --git a/server.js b/server.js
new file mode 100644
index 0000000..8e957a3
--- /dev/null
+++ b/server.js
@@ -0,0 +1,53 @@
+var express = require('express'),
+ port = 8888;
+
+var oneYear = 31557600000;
+
+var app = express.createServer();
+
+var Parse = require('node-parse-api').Parse;
+var APP_ID = "8kJxzEB8G8Rx3mYk8kM8snrHryd4dtqTMgd7MKpD";
+var MASTER_KEY = "DSgulGiahlyXFJ1s9qvSPRW4hdeKrgiozv7U12NS";
+var parse_app = new Parse(APP_ID, MASTER_KEY);
+
+var score = require('./public/javascripts/score.js')(parse_app);
+
+app.use(express.static(__dirname + '/public', { maxAge: oneYear }));
+app.use(express.cookieParser());
+app.use(express.session({ secret: 'secret' }));
+app.use(express.bodyParser());
+app.use(express.csrf());
+
+app.dynamicHelpers({
+ token: function(req, res) {
+ return req.session._csrf;
+ }
+});
+
+app.set("view engine", "jade");
+app.set('view options', { layout: false });
+
+app.get('/play', function(req, res){
+ res.render('play_game');
+});
+
+app.get('/', function(req, res){
+ res.render('index');
+});
+
+app.get('/highscore', function(req, res){
+ score.getHighScore(function(err, response) {
+ res.json({"error": err, "data": response});
+ });
+});
+
+app.post('/highscore', function(req, res) {
+ score.addHighScore(req.body.name, req.body.score, req.body.level, function(err, data) {
+ res.json({"error": err, "data": data});
+ })
+});
+
+app.listen(port);
+
+console.log('Listening on ' + port + ' in ' + app.settings.env + ' mode ...');
+console.log('Press Ctrl + C to stop.');
diff --git a/src/play_game.html b/src/play_game.html
deleted file mode 100644
index 6110baa..0000000
--- a/src/play_game.html
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
Goal Of The Game
-
-
Destroy the viruses by using the right vitamin capsules. When all of the viruses in the bottle are destroyed, you progress to the next stage. If the bottle gets filled all the way to the top, the game is over.
-
-
How To Eliminate Viruses
-
-
As the vitamin capsules drop use the Z or X keys to rotate them. Try to match up four of the same color in a vertical or horizontal row. If you do this, all four will disappear. With a little practice you'll be able to get rid of all the viruses!"
-
-
-