cas ou pas assez d'image pour un certain niveau de difficulté
This commit is contained in:
parent
a3c5c92801
commit
684ff4336b
BIN
SRC/public/imgs/sad.png
Normal file
BIN
SRC/public/imgs/sad.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 140 KiB |
@ -142,8 +142,14 @@
|
|||||||
else { this.gridX = 2; this.gridY=4 ; }
|
else { this.gridX = 2; this.gridY=4 ; }
|
||||||
// this.gridY = this.gridX ;
|
// this.gridY = this.gridX ;
|
||||||
this.numTiles = this.nbcase*2;
|
this.numTiles = this.nbcase*2;
|
||||||
//this.halfNumTiles = this.gridX;
|
console.log("nombre de carte enregistré7 : ");
|
||||||
|
console.log(this.cards.length);
|
||||||
this.halfNumTiles = this.numTiles/2;
|
this.halfNumTiles = this.numTiles/2;
|
||||||
|
if (this.cards.length < this.halfNumTiles) { console.log("pas assez de carte"); document.getElementById("mg__contents").innerHTML="<img height='80px' src='/imgs/sad.png'><h1>Pas assez de cartes enregistrées par le référent </h1>";}
|
||||||
|
else {
|
||||||
|
|
||||||
|
//this.halfNumTiles = this.gridX;
|
||||||
|
|
||||||
this.newCards = [];
|
this.newCards = [];
|
||||||
for ( var i = 0; i < this.halfNumTiles; i++ ) {
|
for ( var i = 0; i < this.halfNumTiles; i++ ) {
|
||||||
this.newCards.push(this.cards[i], this.cards[i]);
|
this.newCards.push(this.cards[i], this.cards[i]);
|
||||||
@ -174,6 +180,7 @@
|
|||||||
this.options.onGameStart();
|
this.options.onGameStart();
|
||||||
this._gamePlay(this.level);
|
this._gamePlay(this.level);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Memory _gamePlay
|
* Memory _gamePlay
|
||||||
@ -364,8 +371,6 @@ Memory.prototype._winGame = function(levelNode) {
|
|||||||
this._clearGame();
|
this._clearGame();
|
||||||
firework();
|
firework();
|
||||||
|
|
||||||
/*console.log("niveau5 : ");*/
|
|
||||||
console.log(levelNode);
|
|
||||||
if(levelNode == 1){this.gameMessages.innerHTML = '<img style="height: 270px;" src="/imgs/trophees/bronze.png"><br>\
|
if(levelNode == 1){this.gameMessages.innerHTML = '<img style="height: 270px;" src="/imgs/trophees/bronze.png"><br>\
|
||||||
<button id="mg__onend--restart" class="mg__button"><span class="icon-spinner11"></span></button>';}
|
<button id="mg__onend--restart" class="mg__button"><span class="icon-spinner11"></span></button>';}
|
||||||
|
|
||||||
@ -379,7 +384,6 @@ else
|
|||||||
{ this.gameMessages.innerHTML = '<h2 class="mg__onend--heading"><span class="icon-trophy"></span></h2>\
|
{ this.gameMessages.innerHTML = '<h2 class="mg__onend--heading"><span class="icon-trophy"></span></h2>\
|
||||||
<button id="mg__onend--restart" class="mg__button"><span class="icon-spinner11"></span></button>';}
|
<button id="mg__onend--restart" class="mg__button"><span class="icon-spinner11"></span></button>';}
|
||||||
|
|
||||||
console.log("trophé 4!");
|
|
||||||
var r = new XMLHttpRequest();
|
var r = new XMLHttpRequest();
|
||||||
r.open("GET", "/setRecords" + "/" + levelNode, true);
|
r.open("GET", "/setRecords" + "/" + levelNode, true);
|
||||||
r.send();
|
r.send();
|
||||||
|
Reference in New Issue
Block a user