Skip to content

Commit 4bb4e7f

Browse files
committed
Modification 2 des fichiers style.css, game.html et script.js
1 parent de5d55f commit 4bb4e7f

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

css/style.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ canvas {
22
padding :0;
33
margin: auto;
44
display: block;
5-
width: 515px;
6-
height: 515px;
5+
width: 525px;
6+
height: 525px;
77
position: relative;
88
top:10px;
99
bottom:0;
@@ -20,7 +20,7 @@ canvas {
2020
}
2121
#pauserestart{
2222
top: 15px;
23-
left:30px;
23+
left:38px;
2424
position:relative;
2525
width: 525px;
2626
height: 25px;

game.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<script type="text/javascript" src="js/script.js">
4040
</script>
4141
<div id="pauserestart">
42-
<img src="assets/images/interface/indique.png" alt="PAUSE P RESTART R" width="515" height="25" />
42+
<img src="assets/images/interface/indique.png" alt="PAUSE P RESTART R" width="505" height="25" />
4343
</div>
4444
</body>
4545

js/script.js

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ serpent.src = "assets/images/snake/headd.png";
3434
corps = new Image();
3535
corps.src = "assets/images/serpent/body.png";
3636
back = new Image();
37-
back.src = "assets/images/interface/back.png";
37+
back.src = "assets/images/interface/back.PNG";
3838

3939
//fruits
4040
f1 = new Image();
@@ -85,7 +85,7 @@ n = 3;
8585
startingMinutes = 3;
8686
go = startingMinutes * 60;
8787
afficher = n + ":" + m + "0";
88-
energie = 0;
88+
energie = 2;
8989
flou = 0;
9090
posx = 200;
9191
posy = 518;
@@ -98,7 +98,7 @@ function main() {
9898
snakeheady += deplacey * hauteur;
9999

100100
// Game Over
101-
gameover();
101+
//gameover();
102102
contexte.clearRect(0, 0, canvas.width, canvas.height);
103103
contexte.fillStyle = "#DEB887";
104104
contexte.fillRect(0, 0, canvas.width, canvas.height);
@@ -208,19 +208,7 @@ function main() {
208208
}
209209
contexte.drawImage(fruits[fruitsuivant], fruitx, fruity);
210210

211-
//Le Chono;
212-
contexte.fillStyle = '#2c3e50';
213-
contexte.fillRect(0, 500, 525, 25);
214-
contexte.font = 'bold 20px sans-serif';
215-
contexte.strokeStyle = '#2c3e50';
216-
contexte.fillStyle = 'white';
217-
contexte.textBaseline = 'middle';
218-
219-
contexte.strokeText('TIME: ' + n + ':' + m, posx, posy);
220-
contexte.fillText('TIME: ' + n + ':' + m, posx, posy);
221-
222-
223-
if (energie > 3) {
211+
if (energie > 1) {
224212
energie = 0;
225213

226214
clearInterval(intervalID);
@@ -399,7 +387,7 @@ function keySprint(evenement) {
399387
corps = new Image();
400388
corps.src = "assets/images/snake/body.png";
401389
back = new Image();
402-
back.src = "assets/images/interface/back.png";
390+
back.src = "assets/images/interface/back.PNG";
403391

404392
//les fruits
405393
f1 = new Image();

0 commit comments

Comments
 (0)