diff --git a/assets/css/style.css b/assets/css/style.css index 40c31cb..7d810b2 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -76,8 +76,8 @@ body{ text-align: center; position: absolute; width: 100%; - height: 73%; - top: 0; + height: 72.7%; + top: 0px; padding-top: 150px; background: rgba(155, 0, 0, 0.85); box-shadow: inset 0px 0px 60px 0px rgba(0,0,0,0.75); @@ -144,6 +144,8 @@ body{ padding-top: 7px; padding-bottom: 3px; overflow: hidden; + width: 1140px; + height: 540px; } .line{ @@ -195,11 +197,11 @@ body{ .startmenu{ text-align: center; - position: absolute; + position: relative; width: 100%; - height: 73%; - top: 0; - padding-top: 150px; + height: 100%; + top: -7px; + padding-top: 60px; background: rgba(0, 0, 0, 1); box-shadow: inset 0px 0px 60px 0px rgba(0,0,0,0.75); z-index: 10; @@ -212,7 +214,7 @@ body{ font-size: 64px; color: #fff; margin: inherit; - padding-bottom: 60px; + padding-bottom: 40px; animation: pulse 3s infinite; } @@ -260,7 +262,7 @@ body{ color: #000; } -.startmenu img{ +.startmenu .tank{ width: 50%; position: absolute; left: -45px; @@ -270,6 +272,11 @@ body{ animation: tankPulse 3s infinite; } +.startmenu .tuto{ + max-width: 30%; + margin-bottom: 15px; +} + @keyframes tankPulse{ 0%{ transform: rotate(0deg) scale(1); @@ -290,8 +297,169 @@ body{ position: absolute; left: 15; bottom: 15px; + cursor: pointer; } .mute-off{ background-position: 0px -64px; +} + +.copyright{ + color: #fff; + width: 100%; + position: absolute; + margin-top: 50px; + text-align: center; + margin-bottom: 30px; +} + +.copyright ul{ + margin: inherit; + padding: inherit; + padding-top: 10px; + margin-top: 0px; +} + +.copyright ul li{ + display: inline; +} + +.copyright ul > li > a{ + color: #fff; + font-size: 12px; + transition: 0.15s; +} + +.copyright ul > li > a:hover{ + color: green; +} + +.volume{ + position: absolute; + left: 100px; + bottom: 30px; +} + +input[type=range] { + -webkit-appearance: none; + margin: 10px 0; + width: 100%; + opacity: 0.7; +} +input[type=range]:focus { + outline: none; +} +input[type=range]::-webkit-slider-runnable-track { + width: 100%; + height: 10px; + cursor: pointer; + animate: 0.2s; + box-shadow: 0px 0px 0px #000000; + background: #e7e7e7; + border-radius: 0px; + border: 0px solid #000000; +} +input[type=range]::-webkit-slider-thumb { + box-shadow: 0px 0px 1px #000000; + border: 0px solid #000000; + height: 20px; + width: 20px; + border-radius: 50px; + background: #FFFFFF; + cursor: pointer; + -webkit-appearance: none; + margin-top: -5px; +} +input[type=range]:focus::-webkit-slider-runnable-track { + background: #e7e7e7; +} +input[type=range]::-moz-range-track { + width: 100%; + height: 10px; + cursor: pointer; + animate: 0.2s; + box-shadow: 0px 0px 0px #000000; + background: #e7e7e7; + border-radius: 0px; + border: 0px solid #000000; +} +input[type=range]::-moz-range-thumb { + box-shadow: 0px 0px 1px #000000; + border: 0px solid #000000; + height: 20px; + width: 20px; + border-radius: 50px; + background: #FFFFFF; + cursor: pointer; +} +input[type=range]::-ms-track { + width: 100%; + height: 10px; + cursor: pointer; + animate: 0.2s; + background: transparent; + border-color: transparent; + color: transparent; +} +input[type=range]::-ms-fill-lower { + background: #e7e7e7; + border: 0px solid #000000; + border-radius: 0px; + box-shadow: 0px 0px 0px #000000; +} +input[type=range]::-ms-fill-upper { + background: #e7e7e7; + border: 0px solid #000000; + border-radius: 0px; + box-shadow: 0px 0px 0px #000000; +} +input[type=range]::-ms-thumb { + box-shadow: 0px 0px 1px #000000; + border: 0px solid #000000; + height: 20px; + width: 20px; + border-radius: 50px; + background: #FFFFFF; + cursor: pointer; +} +input[type=range]:focus::-ms-fill-lower { + background: #e7e7e7; +} +input[type=range]:focus::-ms-fill-upper { + background: #e7e7e7; +} + + + + +@media (max-width: 1440px){ + .map{ + transform: scale(0.8); + } + .startmenu{ + height: 490px; + } + .startmenu .tuto{ + max-width: 40%; + margin-bottom: 15px; + } + .startmenu h1{ + font-size: 38px; + padding-bottom: 30px; + } + .copyright{ + color: #fff; + width: 100%; + position: absolute; + margin-top: 0px; + text-align: center; + margin-bottom: 20px; + } + +} + +@media (max-width: 1280px){ + .header h1{ + display: none; + } } \ No newline at end of file diff --git a/assets/fonts/Mario-Kart-DS.ttf b/assets/fonts/Mario-Kart-DS.ttf deleted file mode 100644 index 011a906..0000000 Binary files a/assets/fonts/Mario-Kart-DS.ttf and /dev/null differ diff --git a/assets/img/keyboard-de_tank.png b/assets/img/keyboard-de_tank.png new file mode 100644 index 0000000..4cb8a83 Binary files /dev/null and b/assets/img/keyboard-de_tank.png differ diff --git a/assets/js/script.js b/assets/js/script.js index 8e586d5..d49050e 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -140,6 +140,7 @@ function run (difficulty) { } else if (event.keyCode == 32){ event.preventDefault(); tirer(); + audio_tir.play(); } }else{ return; @@ -147,7 +148,6 @@ function run (difficulty) { } setInterval(function(){ - console.log('test'); if(bulletX == 0 || bulletY == 0){ return; } @@ -212,6 +212,7 @@ function run (difficulty) { e.textContent = Number(e.textContent)+100; }); bulletDestination.classList.add('cible-touchee'); + audio_touche.play(); bulletX = 0; bulletY = 0; setTimeout(function(){ @@ -254,7 +255,9 @@ function run (difficulty) { gameover.style.display = 'block'; playing = false; clearInterval(ntm); - nanoPlayer.pause(); + audio_musique.pause(); + audio_musique.currentTime = 0.0; + audio_gameover.play(); } }, difficulty); @@ -267,21 +270,36 @@ var startmenu = document.querySelector('.startmenu'); var easy = document.querySelector('.play.easy'); var hard = document.querySelector('.play.hard'); var mute = document.querySelector('#mute'); +var volume = document.querySelector('.volume'); + +var audio_musique = new Audio(); +audio_musique.src = 'assets/sounds/song.mp3'; + +var audio_tir = new Audio(); +audio_tir.src = 'assets/sounds/laser.wav'; + +var audio_gameover = new Audio(); +audio_gameover.src = 'assets/sounds/gameover.wav'; + +var audio_touche = new Audio(); +audio_touche.src = 'assets/sounds/touche.wav'; replay.addEventListener('click', function(){ - run('easy'); + startmenu.style.display = 'block'; }); easy.addEventListener('click', function(){ run('easy'); startmenu.style.display = 'none'; - nanoPlayer.play(); + audio_musique.play(); + volume.style.display = 'block'; }); hard.addEventListener('click', function(){ run('hard'); startmenu.style.display = 'none'; - nanoPlayer.play(); + audio_musique.play(); + volume.style.display = 'block'; }); mute.addEventListener('click', function(e){ @@ -289,9 +307,26 @@ mute.addEventListener('click', function(e){ if(mute.classList.contains('mute-off')){ mute.classList.remove('mute-off'); - nanoPlayer.play(); + volume.style.display = 'block'; + audio_musique.play(); + audio_tir.volume = 0.5; + audio_gameover.volume = 0.5; + audio_touche.volume = 0.5; }else{ mute.classList.add('mute-off'); - nanoPlayer.pause(); + audio_musique.pause(); + volume.style.display = 'none'; + audio_tir.volume = 0; + audio_gameover.volume = 0; + audio_touche.volume = 0; } -}); \ No newline at end of file +}); + +function SetVolume(val) +{ + audio_musique.volume = val / 100; + audio_tir.volume = val / 100; + audio_gameover.volume = val / 100; + audio_touche.volume = val / 100; + +} \ No newline at end of file diff --git a/assets/sounds/gameover.wav b/assets/sounds/gameover.wav new file mode 100644 index 0000000..6dd7aa0 Binary files /dev/null and b/assets/sounds/gameover.wav differ diff --git a/assets/sounds/laser.wav b/assets/sounds/laser.wav new file mode 100644 index 0000000..339e4c2 Binary files /dev/null and b/assets/sounds/laser.wav differ diff --git a/song.mp3 b/assets/sounds/song.mp3 similarity index 100% rename from song.mp3 rename to assets/sounds/song.mp3 diff --git a/assets/sounds/touche.wav b/assets/sounds/touche.wav new file mode 100644 index 0000000..c2186a2 Binary files /dev/null and b/assets/sounds/touche.wav differ diff --git a/index.html b/index.html index 583de08..39057b7 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,5 @@ + de_tank @@ -6,31 +7,33 @@ - -

de_tank

-
-

SCORE

-
-
-
-

GAME OVER

-

Votre score :

- Rejouer -
+
+

SCORE

+
+
+
+

GAME OVER

+

Votre score :

+ Rejouer +

DE_TANK

+ tuto

Vous devez détruire les cibles,

si plus de 3 cibles sont affichées c'est PERDU.

Facile

Pas facile - tank + tank
+
+ +
@@ -252,26 +255,19 @@
+
- - - - + diff --git a/lazer.mp3 b/lazer.mp3 deleted file mode 100644 index 27f3e70..0000000 Binary files a/lazer.mp3 and /dev/null differ