Skip to content
Snippets Groups Projects
Commit 6448c438 authored by Rayane Belguebli's avatar Rayane Belguebli
Browse files

fix hitbox et add css scoreboard & crédits

parent e540f960
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,28 @@ h1 em { ...@@ -29,6 +29,28 @@ h1 em {
color: #777; color: #777;
} }
h3 {
font-family: 'New Super Mario Font U', sans-serif;
color: #1341d6;
font-size: 50px;
}
h3 em {
font-style: normal;
font-weight: bold;
color: #777;
}
h4 {
font-family: 'New Super Mario Font U', sans-serif;
color: #1341d6;
font-size: 25px;
}
h4 em {
font-style: normal;
font-weight: bold;
color: #777;
}
canvas { canvas {
background-color: #000000; background-color: #000000;
border: 3px dashed #777; border: 3px dashed #777;
......
...@@ -142,6 +142,18 @@ ...@@ -142,6 +142,18 @@
}, },
{ {
"score": -15 "score": -15
},
{
"nom": "rayane",
"score": 0
},
{
"nom": "raayne*",
"score": -15
},
{
"nom": "rayane",
"score": -15
} }
] ]
} }
\ No newline at end of file
export default class setHtml { export default class setHtml {
static credits() { static credits() {
return ` return `
<p>Julien Bouin 33%</p> <h3>Groupe H</h3>
<p> Pseudo : Jogz </p> <h4>
<p> jeu préféré : Rocket League </p> <br>
<p>Rayane Belguebli 33%</p> <p>- Julien Bouin 33% / Pseudo : Jogz / jeu préféré : Rocket League </p>
<p> Pseudo : Rayanou </p> <br>
<p> jeu préféré : Fifa </p> <p>- Rayane Belguebli 33% / Pseudo : Rayanou / jeu préféré : Fifa </p>
<p>Mathis Decoster 33%</p> <br>
<p>pseudo: Wakly</p> <p>- Mathis Decoster 33% / pseudo: Wakly / jeu préféré : Teamfight Tactics</p>
<p>jeu préféré : Teamfight Tactics</p> <br>
<p>Groupe H</p>
</h4>
<button class="retourMenu">Retour au menu</button>`; <button class="retourMenu">Retour au menu</button>`;
} }
......
...@@ -6,7 +6,7 @@ export class Projectile extends Entite { ...@@ -6,7 +6,7 @@ export class Projectile extends Entite {
vitesse; vitesse;
constructor(x, y, image) { constructor(x, y, image) {
super(x, y, new Hitbox(122, 68, x, y), image); super(x, y, new Hitbox(122 / 2, 68, x, y), image);
this.vitesse = 10; this.vitesse = 10;
} }
......
...@@ -13,12 +13,12 @@ export class GestionScore { ...@@ -13,12 +13,12 @@ export class GestionScore {
scores.results.sort((a, b) => b.score - a.score); scores.results.sort((a, b) => b.score - a.score);
let html = let html =
'<table><thead><tr><th>Nom</th><th>Score</th></tr></thead><tbody>'; '<table><thead><tr><th><h4>Nom</h4></th><th><h4>Score</h4></th></tr></thead><tbody>';
const numberOfResults = Math.min(10, scores.results.length); const numberOfResults = Math.min(10, scores.results.length);
for (let i = 0; i < numberOfResults; i++) { for (let i = 0; i < numberOfResults; i++) {
const result = scores.results[i]; const result = scores.results[i];
html += `<tr><td>${result.nom}</td><td>${result.score}</td></tr>`; html += `<tr><td><h4>${result.nom}</h4></td><td><h4>${result.score}</h4></td></tr>`;
} }
html += '</tbody></table>'; html += '</tbody></table>';
......
...@@ -10,11 +10,11 @@ export default class enemi extends Entite { ...@@ -10,11 +10,11 @@ export default class enemi extends Entite {
difficulté; difficulté;
constructor(x, y, image, difficulté) { constructor(x, y, image, difficulté) {
super(x, y, new Hitbox(50 / 2, 66, x, y), image); super(x, y, new Hitbox(50 / 3, 66 / 2, x, y), image);
if (difficulté == 1) { if (difficulté == 1) {
this.vx = 3; this.vx = 3;
this.vy = 0; this.vy = 0;
this.hitbox = new Hitbox(69 / 2, 57, this.x, this.y); this.hitbox = new Hitbox(69 / 3, 57 / 2, this.x, this.y);
} else if (difficulté == 2) { } else if (difficulté == 2) {
this.vx = 5; this.vx = 5;
this.vy = 1; this.vy = 1;
...@@ -29,15 +29,6 @@ export default class enemi extends Entite { ...@@ -29,15 +29,6 @@ export default class enemi extends Entite {
this.positionInitialeY = y; this.positionInitialeY = y;
} }
colision(x, y, image) {
return (
x >= this.x &&
x <= this.x + image.width &&
y >= this.y &&
y <= this.y + image.height
);
}
getVies() { getVies() {
return this.vies; return this.vies;
} }
......
...@@ -308,7 +308,7 @@ function handleAvatarProjectileCollisions(avatar) { ...@@ -308,7 +308,7 @@ function handleAvatarProjectileCollisions(avatar) {
canLostLifeEnemi = false; canLostLifeEnemi = false;
setTimeout(function () { setTimeout(function () {
canLostLifeEnemi = true; canLostLifeEnemi = true;
}, 1000 / 60); }, 100);
} }
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment