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 {
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 {
background-color: #000000;
border: 3px dashed #777;
......
......@@ -142,6 +142,18 @@
},
{
"score": -15
},
{
"nom": "rayane",
"score": 0
},
{
"nom": "raayne*",
"score": -15
},
{
"nom": "rayane",
"score": -15
}
]
}
\ No newline at end of file
export default class setHtml {
static credits() {
return `
<p>Julien Bouin 33%</p>
<p> Pseudo : Jogz </p>
<p> jeu préféré : Rocket League </p>
<p>Rayane Belguebli 33%</p>
<p> Pseudo : Rayanou </p>
<p> jeu préféré : Fifa </p>
<p>Mathis Decoster 33%</p>
<p>pseudo: Wakly</p>
<p>jeu préféré : Teamfight Tactics</p>
<p>Groupe H</p>
<h3>Groupe H</h3>
<h4>
<br>
<p>- Julien Bouin 33% / Pseudo : Jogz / jeu préféré : Rocket League </p>
<br>
<p>- Rayane Belguebli 33% / Pseudo : Rayanou / jeu préféré : Fifa </p>
<br>
<p>- Mathis Decoster 33% / pseudo: Wakly / jeu préféré : Teamfight Tactics</p>
<br>
</h4>
<button class="retourMenu">Retour au menu</button>`;
}
......
......@@ -6,7 +6,7 @@ export class Projectile extends Entite {
vitesse;
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;
}
......
......@@ -13,12 +13,12 @@ export class GestionScore {
scores.results.sort((a, b) => b.score - a.score);
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);
for (let i = 0; i < numberOfResults; 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>';
......
......@@ -10,11 +10,11 @@ export default class enemi extends Entite {
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) {
this.vx = 3;
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) {
this.vx = 5;
this.vy = 1;
......@@ -29,15 +29,6 @@ export default class enemi extends Entite {
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() {
return this.vies;
}
......
......@@ -308,7 +308,7 @@ function handleAvatarProjectileCollisions(avatar) {
canLostLifeEnemi = false;
setTimeout(function () {
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