Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
106 lines (88 sloc) 6.08 KB
#game-wrap
%svg{ id: "ui", width: "325.4px", height: "265.7px", viewbox: "0 0 325.4 265.7", opacity: 0, visibility: "hidden" }
%g{ visibility: "hidden" }
%path{ d: "M39.3,60.2c0,0.2,0,0.4,0,0.7c-0.2,0-0.5,0-0.7,0c0-0.2,0-0.4,0-0.7c0-0.5,0-1-0.1-1.5\r\n\t\t\tc-2.8-10.3-5.6-20.5-8.4-30.8c6,0,12,0,18,0c-2.1,7.6-4.3,15.1-6.2,22.7C40.8,53.8,39.6,56.9,39.3,60.2z", style: "fill:#F05023;"}
%path{ d: "M29.9,27.9c2.8,10.3,5.6,20.5,8.4,30.8c0.1,0.5,0.1,1,0.1,1.5c-3.6-4.9-7.2-9.8-10.8-14.7\r\n\t\t\tc-4.2-5.7-8.5-11.5-12.7-17.2c0-0.1,0-0.2,0-0.4C19.9,27.9,24.9,27.9,29.9,27.9L29.9,27.9z", style: "fill:#F2612F;"}
%path{ d: "M39.3,60.2c0.3-3.3,1.5-6.4,2.3-9.5c2-7.6,4.1-15.1,6.2-22.7l0,0c5,0,10,0,15,0c0,0.1,0,0.2,0,0.4\r\n\t\t\tc-4.5,6.1-8.9,12.2-13.4,18.3C46,51.1,42.9,55.8,39.3,60.2z", style: "fill:#F2612F;"}
%path{ d: "M47.8,27.9c-6,0-12,0-18,0l0,0c0-0.1,0-0.2,0-0.4c1.3-1.4,2.1-3.2,3-4.8c1.8-3.3,4.2-6.2,5.5-9.8\r\n\t\t\tc0.2,0,0.5,0,0.7,0c2.4,5.1,5.5,9.8,8.6,14.6C47.8,27.7,47.8,27.8,47.8,27.9L47.8,27.9z", style: "fill:#F2612F;"}
%path{ d: "M47.8,27.6c-3-4.8-6.2-9.5-8.6-14.6c5.5,0,11,0,16.4,0c0,0.1-0.1,0.2-0.1,0.4\r\n\t\t\tc-0.9,0.2-0.9,1.1-1.3,1.7C52.1,19.2,50.3,23.5,47.8,27.6z", style: "fill:#D44227;"}
%path{ d: "M38.5,13c-1.4,3.5-3.7,6.5-5.5,9.8c-0.9,1.7-1.8,3.4-3,4.8c-2.3-3.8-4.1-8-6.2-12\r\n\t\t\tc-0.4-0.8-0.6-1.8-1.5-2.3c0-0.1,0-0.2,0.2-0.3C27.8,13,33.1,13,38.5,13z", style: "fill:#D44227;"}
%path{ d: "M22.3,13.3c0.9,0.5,1,1.5,1.5,2.3c2.1,4,3.8,8.1,6.2,12c0,0.1,0,0.2,0,0.4c-5,0-10,0-15,0\r\n\t\t\tc0-0.1,0-0.2,0-0.4C17.4,22.8,19.8,18,22.3,13.3z", style: "fill:#F05023;"}
%path{ d: "M47.8,27.6c2.4-4,4.2-8.4,6.5-12.5c0.3-0.6,0.4-1.5,1.3-1.7c2.4,4.7,4.8,9.5,7.2,14.2\r\n\t\t\tc0,0.1,0,0.2,0,0.4c-5,0-10,0-15,0C47.8,27.8,47.8,27.7,47.8,27.6z", style: "fill:#F05023;"}
%rect{ height: "37.5", style: "fill:none;", width: "64.4", x: "81.3", y: "17.5"}
%text{ id: "score", style: "fill:#FFFFFF; font-size:38px;", transform: "matrix(1 0 0 1 81.2712 45.4452)"} 0
%g{ id: "level-counter" }
%text{ style: "font-size:38px;", transform: "matrix(1 0 0 1 81.2712 90)"}
%tspan LEVEL
%tspan.highlighted{ id: "level-counter-value" } 1
%tspan of 10
%g{ id: "hint-trigger", class: "ui button", visibility: "hidden" }
%g
%polygon{ points: "35.2,150.9 46.9,150.9 36.9,157 \t\t\t", style: "fill:#F15B22;"}
%polygon{ points: "36.9,157 46.9,150.9 46.7,155.8 \t\t\t", style: "fill:#F05023;"}
%polygon{ points: "38.1,157.5 45.2,157.5 42.3,162.4 \t\t\t", style: "fill:#F36D21;"}
%polygon{ points: "38.1,157.5 38.1,162 42.3,162.4 \t\t\t", style: "fill:#F15B22;"}
%path{ d: "M35.2,147.2h11.5l0.8-7.1l7.8-6.1l2.4-13.7l-6.1-13.2l-13-3.8l-13.9,6.5l-5,13.3\r\n\t\t\tc0,0,4.2,10.5,4.3,10.8c0.1,0.3,9.1,6.1,9.1,6.1L35.2,147.2z", style: "fill:#F36D21;"}
%polygon{ points: "38.7,103.3 41.9,121.1 51.8,107.2 \t\t", style: "fill:#F78F1E;"}
%polygon{ points: "51.8,107.2 41.9,121.1 57.8,120.3 \t\t", style: "fill:#F6891F;"}
%polygon{ points: "55.4,134.1 41.9,121.1 47.6,140.1 \t\t", style: "fill:#ED4524;"}
%polygon{ points: "35.2,147.2 39.4,136.1 46.8,147.2 \t\t", style: "fill:#C43127;"}
%polygon{ points: "46.8,147.2 47.6,140.1 39.4,136.1 \t\t", style: "fill:#D44227;"}
%polygon{ points: "39.4,136.1 35.2,147.2 33.3,140 \t\t", style: "fill:#ED4524;"}
%polygon{ points: "39.4,136.1 24.2,134 33.3,140 \t\t", style: "fill:#F15622;"}
%polygon{ points: "39.4,136.1 41.9,121.1 47.6,140.1 \t\t", style: "fill:#F36D21;"}
%polygon{ points: "19.9,123.1 41.9,121.1 39.4,136.1 \t\t", style: "fill:#F15623;"}
%polygon{ points: "19.9,123.1 24.2,134 39.4,136.1 \t\t", style: "fill:#E75625;"}
%polygon{ points: "19.9,123.1 24.9,109.9 41.9,121.1 \t\t", style: "fill:#E75625;"}
%text{ style: "font-size:38px;", transform: "matrix(1 0 0 1 81.2712 142.5897)"} HINT
-# %g{ id: "menu-trigger", class: "ui button" }
-# %text{ style: "font-size:38px;", transform: "matrix(1 0 0 1 81.2697 239.7337)"} MENU
-# %rect{ height: "5.5", style: "fill:#F78F1E;", width: "32.7", x: "23.8", y: "214.5"}
-# %rect{ height: "5.5", style: "fill:#F15623;", width: "32.7", x: "23.8", y: "223.9"}
-# %rect{ height: "5.5", style: "fill:#D44227;", width: "32.7", x: "23.8", y: "233.3"}
%g{ id: "menu-trigger", class: "ui button" }
%text{ style: "font-size:38px;", transform: "matrix(1 0 0 1 81.2697 39.7337)"} MENU
%rect{ height: "5.5", style: "fill:#F78F1E;", width: "32.7", x: "23.8", y: "14.5"}
%rect{ height: "5.5", style: "fill:#F15623;", width: "32.7", x: "23.8", y: "23.9"}
%rect{ height: "5.5", style: "fill:#D44227;", width: "32.7", x: "23.8", y: "33.3"}
#won-modal.overlay.hidden
.modal
= inline_svg "won.min.svg"
#failed-modal.overlay.hidden
.modal
= inline_svg "failed.min.svg"
:javascript
var assets = {
intro: "#{asset_path('intro.svg')}",
world: "#{asset_path('world.svg')}",
hollow: "#{asset_path('hollow.svg')}",
characters: {
0: "#{asset_path('characters/01.svg')}",
1: "#{asset_path('characters/02.svg')}",
2: "#{asset_path('characters/03.svg')}",
3: "#{asset_path('characters/04.svg')}",
4: "#{asset_path('characters/05.svg')}",
5: "#{asset_path('characters/06.svg')}",
6: "#{asset_path('characters/07.svg')}",
7: "#{asset_path('characters/08.svg')}",
8: "#{asset_path('characters/09.svg')}",
9: "#{asset_path('characters/10.svg')}"
}
}
var game = new GameController(assets);
game.start();
$(document).delegate('#content', 'keydown', function(e) {
var keyCode = e.keyCode || e.which;
if (keyCode == 9) {
e.preventDefault();
var start = $(this).get(0).selectionStart;
var end = $(this).get(0).selectionEnd;
// set textarea value to: text before caret + tab + text after caret
$(this).val($(this).val().substring(0, start)
+ "\t"
+ $(this).val().substring(end));
// put caret at right position again
$(this).get(0).selectionStart =
$(this).get(0).selectionEnd = start + 1;
}
});
You can’t perform that action at this time.