modification niveau memory
This commit is contained in:
parent
b69f8c03b6
commit
aa6bd3ea05
@ -34,7 +34,9 @@ class GameController extends Controller {
|
|||||||
} else {
|
} else {
|
||||||
$oes = Oeuvre::orderByRaw("RAND()")->take(5)->get();
|
$oes = Oeuvre::orderByRaw("RAND()")->take(5)->get();
|
||||||
}
|
}
|
||||||
return view('frontend/memo', ['oeuvres' => $oes, 'niveau' => $niveau]);
|
$params = json_decode($configjeu->parametres);
|
||||||
|
|
||||||
|
return view('frontend/memo', ['oeuvres' => $oes, 'niveau' => $niveau, 'nbBloc'=>$params->{"m".$niveau}]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function chooseDifPuzzle() {
|
public function chooseDifPuzzle() {
|
||||||
|
@ -31,10 +31,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function Memory( options, level ) {
|
function Memory( options, level, nbcase ) {
|
||||||
|
console.log(nbcase);
|
||||||
this.options = extend( {}, this.options );
|
this.options = extend( {}, this.options );
|
||||||
extend( this.options, options );
|
extend( this.options, options );
|
||||||
this._init(level);
|
this._init(level, nbcase);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,7 +45,7 @@
|
|||||||
* ready for game setup.
|
* ready for game setup.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Memory.prototype._init = function(level) {
|
Memory.prototype._init = function(level,nbcase) {
|
||||||
this.game = document.createElement("div");
|
this.game = document.createElement("div");
|
||||||
this.game.id = "mg";
|
this.game.id = "mg";
|
||||||
this.game.className = "mg";
|
this.game.className = "mg";
|
||||||
@ -65,7 +66,7 @@
|
|||||||
this.gameMessages.id = "mg__onend";
|
this.gameMessages.id = "mg__onend";
|
||||||
this.gameMessages.className = "mg__onend";
|
this.gameMessages.className = "mg__onend";
|
||||||
|
|
||||||
this._setupGame(level);
|
this._setupGame(level,nbcase);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -85,7 +86,7 @@
|
|||||||
* 3 : game is finished
|
* 3 : game is finished
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Memory.prototype._setupGame = function(level) {
|
Memory.prototype._setupGame = function(level, nbcase) {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.gameState = 1;
|
this.gameState = 1;
|
||||||
this.cards = shuffle(this.options.cards);
|
this.cards = shuffle(this.options.cards);
|
||||||
@ -98,7 +99,7 @@
|
|||||||
this.flippedTiles = 0;
|
this.flippedTiles = 0;
|
||||||
this.chosenLevel = "";
|
this.chosenLevel = "";
|
||||||
this.numMoves = 0;
|
this.numMoves = 0;
|
||||||
this._setupGameWrapper(level);
|
this._setupGameWrapper(level, nbcase);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,7 +109,8 @@
|
|||||||
* tiles will reside and where all the game play happens.
|
* tiles will reside and where all the game play happens.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Memory.prototype._setupGameWrapper = function(levelNode) {
|
Memory.prototype._setupGameWrapper = function(levelNode,nbcase) {
|
||||||
|
this.nbcase = nbcase;
|
||||||
this.level = levelNode;
|
this.level = levelNode;
|
||||||
this.gameContents.className = "mg__contents mg__level-"+this.level;
|
this.gameContents.className = "mg__contents mg__level-"+this.level;
|
||||||
this.game.appendChild(this.gameWrapper);
|
this.game.appendChild(this.gameWrapper);
|
||||||
@ -137,7 +139,7 @@
|
|||||||
else if(this.level == 2) {this.gridX = 3; this.gridY= 2; }
|
else if(this.level == 2) {this.gridX = 3; this.gridY= 2; }
|
||||||
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.gridX * this.gridY;
|
this.numTiles = this.nbcase*2;
|
||||||
//this.halfNumTiles = this.gridX;
|
//this.halfNumTiles = this.gridX;
|
||||||
this.halfNumTiles = this.numTiles/2;
|
this.halfNumTiles = this.numTiles/2;
|
||||||
this.newCards = [];
|
this.newCards = [];
|
||||||
|
BIN
SRC/public/pictures/homePic/fond2.jpg
Executable file
BIN
SRC/public/pictures/homePic/fond2.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 148 KiB |
@ -32,7 +32,7 @@
|
|||||||
cards : cards2,
|
cards : cards2,
|
||||||
onGameStart : function() { return false; },
|
onGameStart : function() { return false; },
|
||||||
onGameEnd : function() { return false; }
|
onGameEnd : function() { return false; }
|
||||||
}, {{$niveau}});
|
}, {{$niveau}}, {{$nbBloc}});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user