diff --git a/public/graphics b/public/graphics new file mode 120000 index 0000000..30bdc45 --- /dev/null +++ b/public/graphics @@ -0,0 +1 @@ +../game/graphics/ \ No newline at end of file diff --git a/public/index.html b/public/index.html index ef2e273..868c4bf 100644 --- a/public/index.html +++ b/public/index.html @@ -11,6 +11,8 @@
+Un seul objectif : battre le meilleur score dans l'aventure épique de Trosh !
diff --git a/public/main.js b/public/main.js
index 8a7b0b6..d843412 100644
--- a/public/main.js
+++ b/public/main.js
@@ -71,7 +71,13 @@ $(function() {
var x = Math.round((2*Math.random()-1)*thresold);
var y = Math.round((2*Math.random()-1)*thresold);
$('body').css('transform', 'translate('+x+'px, '+y+'px)');
+ }
+
+ var h = $('#stars').height();
+ var w = $('#stars').width();
+ for (var i = 0; i < 10; i++) {
+ $('#stars').append($('').attr('src', 'graphics/star.png').css('top', (Math.random() * h) + 'px'))
}
(function anim() {
@@ -88,6 +94,18 @@ $(function() {
shake(Math.exp(10 * (shakeStart - now) / SHAKE_DURATION) * SHAKE_MAX_THRESOLD)
}
+ // Stars
+ $('#stars img').each(function(i, el) {
+ var e = $(el);
+ var pos = e.position()
+ if (pos.top > h) {
+ e.css('top', '0px');
+ e.css('left', Math.floor(Math.random() * w) + 'px');
+ } else {
+ e.css('top', (pos.top + 100) + 'px');
+ }
+ });
+
requestAnimationFrame(anim);
})();
diff --git a/public/style.css b/public/style.css
index be14235..69f1a73 100644
--- a/public/style.css
+++ b/public/style.css
@@ -10,6 +10,20 @@ body {
font-size: 17pt;
}
+#stars {
+ position: fixed;
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ bottom: 0px;
+}
+
+#stars img {
+ position: absolute;
+ width: 100px;
+ image-rendering: -moz-crisp-edges;
+}
+
#header {
margin-top: 15px;
}
@@ -66,7 +80,6 @@ body {
#footer p {
margin-top: 50px;
- font-size: 75%;
text-align: center;
}
--
libgit2 0.21.2