Suite intégration jeu

This commit is contained in:
batche
2022-12-21 10:05:36 +01:00
parent 77857a873d
commit d6da8bf70b
3 changed files with 14 additions and 15 deletions

View File

@@ -74,6 +74,7 @@
console.log("Response.ok : " + responseFromServer.ok )
console.log("//")
const responseInjson = await responseFromServer.json()
showWaitPage = false
if (!responseFromServer.ok || !responseInjson.token)
{
errorMessageWhenAttemptingToGetATicket = responseInjson.message;
@@ -88,8 +89,6 @@
}
else
{
showError = false
showWaitPage = false
const token = responseInjson.token
console.log("Token === " + token)
if (sound === "off") {
@@ -179,15 +178,6 @@
</div>
{/if}
{#if showWaitPage === true}
<div id="div_game">
<fieldset>
<legend>Connecting to the game...</legend>
<p>{waitingMessage}</p>
</fieldset>
</div>
{/if}
{#if optionsAreNotSet}
{#if showGameOption === true}
<form on:submit|preventDefault={init}>
@@ -251,9 +241,19 @@
</div>
{/if}
{/if}
<div id="canvas_container">
{#if showWaitPage === true}
<div id="div_game">
<fieldset>
<legend>Connecting to the game...</legend>
<p>{waitingMessage}</p>
</fieldset>
</div>
{/if}
<canvas id="gameArea"></canvas>
</div>
</body>

View File

@@ -10,10 +10,6 @@ export class GameArea {
ctx: CanvasRenderingContext2D;
constructor() {
this.canvas = document.getElementById("gameArea");
if (this.canvas)
console.log("Le canvas a été trouvé !")
else
console.log("Le canvas a été mangé par un être mystérieux...")
this.ctx = this.canvas.getContext("2d") as CanvasRenderingContext2D;
this.canvas.width = c.CanvasWidth;
this.canvas.height = c.CanvasWidth / c.CanvasRatio;