Suite intégration jeu
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
import { IsBoolean, IsNotEmpty, IsNumber, IsString } from "class-validator";
|
import { IsBoolean, IsNotEmpty, IsNumber, IsString } from "class-validator";
|
||||||
|
|
||||||
export class UpdateGameDto {
|
export class UpdateGameDto {
|
||||||
|
@IsString()
|
||||||
|
@IsNotEmpty()
|
||||||
|
gameServerIdOfTheMatch : string
|
||||||
@IsNumber()
|
@IsNumber()
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
playerOneUsernameResult : number
|
playerOneUsernameResult : number
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
console.log("Response.ok : " + responseFromServer.ok )
|
console.log("Response.ok : " + responseFromServer.ok )
|
||||||
console.log("//")
|
console.log("//")
|
||||||
const responseInjson = await responseFromServer.json()
|
const responseInjson = await responseFromServer.json()
|
||||||
|
showWaitPage = false
|
||||||
if (!responseFromServer.ok || !responseInjson.token)
|
if (!responseFromServer.ok || !responseInjson.token)
|
||||||
{
|
{
|
||||||
errorMessageWhenAttemptingToGetATicket = responseInjson.message;
|
errorMessageWhenAttemptingToGetATicket = responseInjson.message;
|
||||||
@@ -88,8 +89,6 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
showError = false
|
|
||||||
showWaitPage = false
|
|
||||||
const token = responseInjson.token
|
const token = responseInjson.token
|
||||||
console.log("Token === " + token)
|
console.log("Token === " + token)
|
||||||
if (sound === "off") {
|
if (sound === "off") {
|
||||||
@@ -179,15 +178,6 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if showWaitPage === true}
|
|
||||||
<div id="div_game">
|
|
||||||
<fieldset>
|
|
||||||
<legend>Connecting to the game...</legend>
|
|
||||||
<p>{waitingMessage}</p>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if optionsAreNotSet}
|
{#if optionsAreNotSet}
|
||||||
{#if showGameOption === true}
|
{#if showGameOption === true}
|
||||||
<form on:submit|preventDefault={init}>
|
<form on:submit|preventDefault={init}>
|
||||||
@@ -251,9 +241,19 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div id="canvas_container">
|
<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>
|
<canvas id="gameArea"></canvas>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,6 @@ export class GameArea {
|
|||||||
ctx: CanvasRenderingContext2D;
|
ctx: CanvasRenderingContext2D;
|
||||||
constructor() {
|
constructor() {
|
||||||
this.canvas = document.getElementById("gameArea");
|
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.ctx = this.canvas.getContext("2d") as CanvasRenderingContext2D;
|
||||||
this.canvas.width = c.CanvasWidth;
|
this.canvas.width = c.CanvasWidth;
|
||||||
this.canvas.height = c.CanvasWidth / c.CanvasRatio;
|
this.canvas.height = c.CanvasWidth / c.CanvasRatio;
|
||||||
|
|||||||
Reference in New Issue
Block a user