added fourinarow module
4
src/games/fourinarow/credits-fr.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<p>
|
||||
<br>- developpement: Michel Gutierrez (@<a target="_blank" href="http://twitter.com/_mig_">_mig_</a>) & Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>)
|
||||
<br>- graphisme: Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>)
|
||||
</p>
|
4
src/games/fourinarow/credits.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<p>
|
||||
<br>- development: Michel Gutierrez (@<a target="_blank" href="http://twitter.com/_mig_">_mig_</a>) & Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>)
|
||||
<br>- graphic design: Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>)
|
||||
</p>
|
3
src/games/fourinarow/description-fr.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<p>Four in a row est un jeu très connu, les règles sont simples et le jeu est abordable à tout âge.</p>
|
||||
|
||||
<p>Une légende urbaine circule selon laquelle le jeu aurait été inventé par David Bowie.</p>
|
3
src/games/fourinarow/description.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<p>Four in a row is a very well known game, simple rules and anyone can play.</p>
|
||||
|
||||
<p>Some say the game was invented by David Bowie, we will let them believe so :)</p>
|
BIN
src/games/fourinarow/fiar-thumb.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
src/games/fourinarow/fiar-torus-thumb.png
Normal file
After Width: | Height: | Size: 12 KiB |
270
src/games/fourinarow/fiarbase-model.js
Normal file
|
@ -0,0 +1,270 @@
|
|||
/*
|
||||
* Copyright (c) 2013 - Jocly - www.jocly.com - All rights reserved
|
||||
*/
|
||||
|
||||
Model.Game.InitGame = function() {
|
||||
var width=this.mOptions.width;
|
||||
var height=this.mOptions.height;
|
||||
var lines=this.mOptions.lines;
|
||||
var directions=[[-1,-1],[0,-1],[1,-1],[-1,0]];
|
||||
var tuples=[];
|
||||
for(var r=0;r<height;r++)
|
||||
for(var c=0;c<width;c++) {
|
||||
for(var d=0;d<directions.length;d++) {
|
||||
var dx=directions[d][0];
|
||||
var dy=directions[d][1];
|
||||
var i;
|
||||
var tuple=[];
|
||||
for(i=0;i<lines;i++) {
|
||||
var pos;
|
||||
if(this.mOptions.torus)
|
||||
pos=(r+dy*i)*width+(c+dx*i+width)%width;
|
||||
else
|
||||
pos=(r+dy*i)*width+c+dx*i;
|
||||
|
||||
if(this.mOptions.torus && (r+dy*i<0 || r+dy*i>=height))
|
||||
break;
|
||||
else if(!this.mOptions.torus && (c+dx*i<0 || c+dx*i>=width || r+dy*i<0 || r+dy*i>=height))
|
||||
break;
|
||||
else
|
||||
tuple.push(pos);
|
||||
}
|
||||
if(i==lines) {
|
||||
tuples.push(tuple);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.g.TuplesList=tuples;
|
||||
var tuplesMap={};
|
||||
for(var i=0;i<tuples.length;i++) {
|
||||
var tuple=tuples[i];
|
||||
for(var j=0;j<tuple.length;j++) {
|
||||
var pos=tuple[j];
|
||||
if(tuplesMap[pos]===undefined)
|
||||
tuplesMap[pos]=[];
|
||||
tuplesMap[pos].push(tuple);
|
||||
}
|
||||
}
|
||||
this.g.Tuples=tuplesMap;
|
||||
this.zobrist=new JocGame.Zobrist({
|
||||
board: {
|
||||
type: "array",
|
||||
size: this.mOptions.width*this.mOptions.height,
|
||||
values: ["1","-1"],
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Model.Move.Init = function(args) {
|
||||
this.op=args.op;
|
||||
this.col=args.col;
|
||||
}
|
||||
|
||||
Model.Move.CopyFrom=function(move) {
|
||||
this.Init(move);
|
||||
}
|
||||
|
||||
Model.Move.ToString=function() {
|
||||
var str="";
|
||||
switch(this.op) {
|
||||
case '+': str+='+'; break;
|
||||
case '-': str+='-'; break;
|
||||
default: str+='?';
|
||||
}
|
||||
str+=String.fromCharCode(65+this.col);
|
||||
return str;
|
||||
}
|
||||
|
||||
Model.Board.Init = function(aGame) {
|
||||
this.zSign=0;
|
||||
}
|
||||
|
||||
Model.Board.InitialPosition = function(aGame) {
|
||||
this.board=[];
|
||||
var width=aGame.mOptions.width;
|
||||
var height=aGame.mOptions.height;
|
||||
for(var r=0;r<height;r++) {
|
||||
for(var c=0;c<width;c++)
|
||||
this.board.push(0);
|
||||
}
|
||||
this.tuples={}
|
||||
for(var i=1;i<=aGame.mOptions.lines;i++) {
|
||||
this.tuples[i]=0;
|
||||
this.tuples[-i]=0;
|
||||
}
|
||||
this.cols=[];
|
||||
for(var c=0;c<width;c++)
|
||||
this.cols.push(0);
|
||||
if(aGame.mOptions.fillSides) {
|
||||
for(var i=0;i<height;i++) {
|
||||
var pos=i*width;
|
||||
var who=(i%2)?-1:1;
|
||||
var col=0;
|
||||
this.board[pos]=who;
|
||||
this.cols[col]++;
|
||||
this.tuples[who]++;
|
||||
this.zSign=aGame.zobrist.update(this.zSign,"board",who,pos);
|
||||
|
||||
var pos=i*width+width-1;
|
||||
var who=(i%2)?1:-1;
|
||||
var col=width-1;
|
||||
this.board[pos]=who;
|
||||
this.cols[col]++;
|
||||
this.tuples[who]++;
|
||||
this.zSign=aGame.zobrist.update(this.zSign,"board",who,pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Model.Board.GenerateMoves = function(aGame) {
|
||||
var moves=[],maxHeight=aGame.mOptions.height;
|
||||
for(var c=0;c<aGame.mOptions.width;c++)
|
||||
if(this.cols[c]<maxHeight)
|
||||
moves.push({
|
||||
op: '+',
|
||||
col: c,
|
||||
});
|
||||
if(aGame.mOptions.remove)
|
||||
for(var c=0;c<aGame.mOptions.width;c++)
|
||||
if(this.board[c]==this.mWho)
|
||||
moves.push({
|
||||
op: '-',
|
||||
col: c,
|
||||
});
|
||||
this.mMoves=moves;
|
||||
//console.log("GenerateMoves",moves.length,moves);
|
||||
if(moves.length==0) {
|
||||
this.mFinished=true;
|
||||
this.mWinner=JocGame.DRAW;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Model.Board.Evaluate = function(aGame) {
|
||||
this.mEvaluation=0;
|
||||
this.mWinner=0;
|
||||
if(aGame.mOptions.preventRepeat && aGame.GetRepeatOccurence(this)>2) {
|
||||
this.mFinished=true;
|
||||
this.mWinner=JocGame.DRAW;
|
||||
return;
|
||||
}
|
||||
if(this.tuples[aGame.mOptions.lines]>0) {
|
||||
this.mFinished=true;
|
||||
this.mWinner=1;
|
||||
}
|
||||
if(this.tuples[-aGame.mOptions.lines]>0) {
|
||||
this.mFinished=true;
|
||||
if(this.mWinner)
|
||||
this.mWinner=JocGame.DRAW;
|
||||
else
|
||||
this.mWinner=-1;
|
||||
return;
|
||||
}
|
||||
if(this.mFinished)
|
||||
return;
|
||||
var evParam=aGame.mOptions.levelOptions;
|
||||
for(var i=1;i<aGame.mOptions.lines;i++) {
|
||||
this.mEvaluation+=this.tuples[i]*evParam['evalTuple'+i];
|
||||
this.mEvaluation-=this.tuples[-i]*evParam['evalTuple'+i];
|
||||
}
|
||||
}
|
||||
|
||||
Model.Board.ApplyMove = function(aGame,move) {
|
||||
//console.log("+ApplyMove",move)
|
||||
var $this=this;
|
||||
if(move.op=='+') {
|
||||
var c=move.col;
|
||||
var r=this.cols[c];
|
||||
var pos=r*aGame.mOptions.width+c;
|
||||
for(var i=0;i<aGame.g.Tuples[pos].length;i++) {
|
||||
var tuple=aGame.g.Tuples[pos][i];
|
||||
var counter={
|
||||
'1': 0,
|
||||
'0': 0,
|
||||
'-1': 0,
|
||||
}
|
||||
for(var j=0;j<tuple.length;j++)
|
||||
counter[this.board[tuple[j]]]++;
|
||||
if(counter[1]>0 && counter[-1]==0)
|
||||
this.tuples[counter[1]]--;
|
||||
else if(counter[-1]>0 && counter[1]==0)
|
||||
this.tuples[-counter[-1]]--;
|
||||
counter[this.mWho]++;
|
||||
if(counter[1]>0 && counter[-1]==0)
|
||||
this.tuples[counter[1]]++;
|
||||
else if(counter[-1]>0 && counter[1]==0)
|
||||
this.tuples[-counter[-1]]++;
|
||||
}
|
||||
this.board[pos]=this.mWho;
|
||||
this.cols[c]++;
|
||||
this.zSign=aGame.zobrist.update(this.zSign,"board",this.mWho,pos);
|
||||
} else if(move.op=='-') {
|
||||
for(var r=0;r<this.cols[move.col];r++) {
|
||||
var pos=r*aGame.mOptions.width+move.col;
|
||||
for(var i=0;i<aGame.g.Tuples[pos].length;i++) {
|
||||
var tuple=aGame.g.Tuples[pos][i];
|
||||
var counter={
|
||||
'1': 0,
|
||||
'0': 0,
|
||||
'-1': 0,
|
||||
}
|
||||
for(var j=0;j<tuple.length;j++)
|
||||
counter[this.board[tuple[j]]]++;
|
||||
if(counter[1]>0 && counter[-1]==0)
|
||||
this.tuples[counter[1]]--;
|
||||
else if(counter[-1]>0 && counter[1]==0)
|
||||
this.tuples[-counter[-1]]--;
|
||||
}
|
||||
}
|
||||
for(var i=0;i<this.cols[move.col];i++) {
|
||||
var pos=i*aGame.mOptions.width+move.col;
|
||||
var pos1=pos+aGame.mOptions.width;
|
||||
var whoAbove=0;
|
||||
if(pos1<this.board.length)
|
||||
whoAbove=this.board[pos1];
|
||||
this.zSign=aGame.zobrist.update(this.zSign,"board",this.board[pos],pos);
|
||||
if(whoAbove)
|
||||
this.zSign=aGame.zobrist.update(this.zSign,"board",whoAbove,pos);
|
||||
this.board[pos]=whoAbove;
|
||||
}
|
||||
this.cols[move.col]--;
|
||||
for(var r=0;r<this.cols[move.col];r++) {
|
||||
var pos=r*aGame.mOptions.width+move.col;
|
||||
for(var i=0;i<aGame.g.Tuples[pos].length;i++) {
|
||||
var tuple=aGame.g.Tuples[pos][i];
|
||||
var counter={
|
||||
'1': 0,
|
||||
'0': 0,
|
||||
'-1': 0,
|
||||
}
|
||||
for(var j=0;j<tuple.length;j++)
|
||||
counter[this.board[tuple[j]]]++;
|
||||
if(counter[1]>0 && counter[-1]==0)
|
||||
this.tuples[counter[1]]++;
|
||||
else if(counter[-1]>0 && counter[1]==0)
|
||||
this.tuples[-counter[-1]]++;
|
||||
}
|
||||
}
|
||||
} else
|
||||
console.error("Invalid move",move);
|
||||
//console.log("-ApplyMove")
|
||||
}
|
||||
|
||||
Model.Board.CopyFrom = function(aBoard) {
|
||||
this.tuples={};
|
||||
for(var i in aBoard.tuples)
|
||||
this.tuples[i]=aBoard.tuples[i];
|
||||
this.board=[];
|
||||
for(var pos=0;pos<aBoard.board.length;pos++)
|
||||
this.board.push(aBoard.board[pos]);
|
||||
this.cols=[];
|
||||
for(var col=0;col<aBoard.cols.length;col++)
|
||||
this.cols.push(aBoard.cols[col]);
|
||||
this.mWho=aBoard.mWho;
|
||||
this.zSign=aBoard.zSign;
|
||||
}
|
||||
|
||||
Model.Board.GetSignature = function() {
|
||||
return this.zSign;
|
||||
}
|
||||
|
913
src/games/fourinarow/fiarbase-xd-view.js
Normal file
|
@ -0,0 +1,913 @@
|
|||
/*
|
||||
*
|
||||
* Copyright (c) 2013 - Jocly - www.jocly.com
|
||||
*
|
||||
* This file is part of the Jocly game platform and cannot be used outside of this context without the written permission of Jocly.
|
||||
*
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
var SIZE, fullPath;
|
||||
var full2dWidth,full2dHeight;
|
||||
// 3d data in blender units
|
||||
var NBCOLS,NBROWS;
|
||||
var CELLSIZE=2;
|
||||
var interspace=CELLSIZE/5;
|
||||
var CELLTHICKNESS=.1;
|
||||
var connect4Color;
|
||||
var BLENDER2WORLD;//=1000;
|
||||
var bTorus;
|
||||
var alpha,R;
|
||||
var nbBackLights;
|
||||
var lightsR;
|
||||
var backLightIntensity;
|
||||
|
||||
function colOrientation(c,step,deg){
|
||||
var angle=step==0?0:Math.PI;
|
||||
if (bTorus) angle+=(-c*alpha);
|
||||
if (deg) angle=angle*180/Math.PI;
|
||||
return angle;
|
||||
}
|
||||
|
||||
View.Game.fiarCoord2d = function(c,r) {
|
||||
return [(c+.5)*SIZE-full2dWidth/2,((this.mOptions.height-1)/2-r)*SIZE];
|
||||
}
|
||||
|
||||
View.Game.fiarCoord3d = function(c,r,offset) {
|
||||
var x,y,z;
|
||||
var rotZ=0;
|
||||
var roffset = offset || 0;
|
||||
z=(r+.5-NBROWS/2)*CELLSIZE*BLENDER2WORLD;
|
||||
if (bTorus){
|
||||
rotZ=colOrientation(c,0,true);
|
||||
var r=R*Math.cos(alpha/2)-interspace/2;
|
||||
r+=roffset;
|
||||
y=r*Math.cos(c*alpha)*BLENDER2WORLD;
|
||||
x=r*Math.sin(c*alpha)*BLENDER2WORLD;
|
||||
}else{
|
||||
x=(c+.5-NBCOLS/2)*CELLSIZE*BLENDER2WORLD;
|
||||
y=0;
|
||||
}
|
||||
return [x,y,z,rotZ];
|
||||
}
|
||||
|
||||
View.Game.xdInit = function(xdv) {
|
||||
SIZE=Math.ceil(12000/(Math.max(this.mOptions.width,this.mOptions.height)));
|
||||
full2dWidth=SIZE*this.mOptions.width;
|
||||
full2dHeight=SIZE*this.mOptions.height;
|
||||
fullPath=this.mViewOptions.fullPath;
|
||||
bTorus=this.mOptions.torus;
|
||||
|
||||
// 3d data
|
||||
BLENDER2WORLD=1000;
|
||||
NBCOLS=this.mOptions.width;
|
||||
NBROWS=this.mOptions.height;
|
||||
alpha=(Math.PI*2)/NBCOLS;
|
||||
R = (CELLSIZE/2)/Math.sin(alpha/2);
|
||||
nbBackLights=bTorus?3:2;
|
||||
lightsR=bTorus?40000:20000; //7*R*BLENDER2WORLD
|
||||
backLightIntensity=bTorus?1.5:1.5;
|
||||
connect4Color=bTorus?0x0066ff:0x0066ff;
|
||||
|
||||
for (var i=0;i<nbBackLights;i++) {
|
||||
(function(i) {
|
||||
xdv.createGadget("lightback"+i, {
|
||||
"3d": {
|
||||
type: "custom3d",
|
||||
create: function() {
|
||||
var backlight = new THREE.SpotLight( 0xbbbbbb, backLightIntensity );
|
||||
backlight.castShadow = bTorus?false:true;
|
||||
|
||||
backlight.shadow.camera.near= bTorus?30:15;
|
||||
backlight.shadow.camera.far = bTorus?40:35;
|
||||
backlight.shadow.camera.fov = bTorus?60:70;
|
||||
|
||||
backlight.shadow.mapSize.width = 4096;
|
||||
backlight.shadow.mapSize.height= 4096;
|
||||
|
||||
var object3d = new THREE.Object3D();
|
||||
var target = new THREE.Object3D();
|
||||
target.position.set(
|
||||
-lightsR*Math.cos(i*(2*Math.PI)/nbBackLights),
|
||||
0,
|
||||
-lightsR*Math.sin(i*(2*Math.PI)/nbBackLights)
|
||||
);
|
||||
object3d.add(target);
|
||||
backlight.target = target;
|
||||
object3d.add(backlight);
|
||||
|
||||
return object3d;
|
||||
},
|
||||
x: lightsR*Math.cos(i*(2*Math.PI)/nbBackLights),
|
||||
y: lightsR*Math.sin(i*(2*Math.PI)/nbBackLights),
|
||||
//z: 5000,
|
||||
//x: -20000,
|
||||
//z: 10000,
|
||||
//y: 3000,
|
||||
}
|
||||
});
|
||||
})(i);
|
||||
}
|
||||
|
||||
|
||||
// standard board
|
||||
|
||||
function moveCellFlat(c,r,mesh,step){
|
||||
mesh.position.y=0;
|
||||
mesh.position.y=(r+.5-NBROWS/2)*CELLSIZE;
|
||||
mesh.position.x=step==0?(-interspace/2):(interspace/2);
|
||||
mesh.position.z=(c+.5-NBCOLS/2)*CELLSIZE;
|
||||
//mesh.rotation.y=step>0?0:Math.PI;
|
||||
mesh.rotation.y=colOrientation(c,step);
|
||||
}
|
||||
// cylinder board
|
||||
function moveCellTorus(c,r,mesh,step){
|
||||
mesh.position.y=(r+.5-NBROWS/2)*CELLSIZE;
|
||||
|
||||
var r=R*Math.cos(alpha/2);
|
||||
r=r-step*(interspace+CELLTHICKNESS);
|
||||
|
||||
mesh.position.x=r*Math.cos(c*alpha);
|
||||
mesh.position.z=r*Math.sin(c*alpha);
|
||||
|
||||
//mesh.rotation.y=step==0?0:Math.PI;
|
||||
//mesh.rotation.y+=(-c*alpha);
|
||||
mesh.rotation.y=colOrientation(c,step);
|
||||
|
||||
|
||||
if (step>0) mesh.scale.z = 1-interspace*Math.tan(alpha/2);
|
||||
}
|
||||
var moveCell = bTorus?moveCellTorus:moveCellFlat;
|
||||
|
||||
xdv.createGadget("board3d",{
|
||||
"3d": {
|
||||
type: "custommesh3d",
|
||||
create: function(callback){
|
||||
|
||||
var parentObject = new THREE.Object3D();//create an empty container
|
||||
|
||||
var nbCells=NBCOLS*NBROWS;
|
||||
|
||||
var resCount=4; // cell+ring+foot+board xtras
|
||||
var childObjects=[];
|
||||
|
||||
function checkLoaded(){
|
||||
if (--resCount==0){
|
||||
for (var n=0 ; n < childObjects.length ; n++) {
|
||||
parentObject.add(childObjects[n]);
|
||||
}
|
||||
callback(parentObject);
|
||||
}
|
||||
}
|
||||
|
||||
var matBlueFlat = new THREE.MeshPhongMaterial( {
|
||||
wireframe: false ,
|
||||
shading: THREE.FlatShading ,
|
||||
color: connect4Color,
|
||||
specular: 0x111111,
|
||||
shininess:40,
|
||||
} ) ;
|
||||
|
||||
|
||||
var $this=this;
|
||||
var smooth=0;
|
||||
var url="smoothedfilegeo|"+smooth+"|"+fullPath+"/res/xd-view/meshes/connect4cell.js";
|
||||
this.getResource(url,function(geometry , materials){
|
||||
for (var step=0 ; step < 2 ; step++){
|
||||
for (var r = 0 ; r < NBROWS ; r++){
|
||||
for (var c = 0 ; c < NBCOLS ; c++ ){
|
||||
var mesh = new THREE.Mesh( geometry , matBlueFlat ) ;
|
||||
mesh.receiveShadow=false;
|
||||
mesh.castShadow=true;
|
||||
moveCell(c,r,mesh,step);
|
||||
childObjects.push(mesh);
|
||||
}
|
||||
}
|
||||
}
|
||||
checkLoaded();
|
||||
});
|
||||
smooth=0;
|
||||
url="smoothedfilegeo|"+smooth+"|"+fullPath+"/res/xd-view/meshes/connect4cell-ring-smoothed.js";
|
||||
this.getResource(url,function(geometry , materials){
|
||||
for (var step=0 ; step < 2 ; step++){
|
||||
for (var r = 0 ; r < NBROWS ; r++){
|
||||
for (var c = 0 ; c < NBCOLS ; c++ ){
|
||||
var mesh = new THREE.Mesh( geometry , new THREE.MeshPhongMaterial( {
|
||||
wireframe: false ,
|
||||
shading: THREE.SmoothShading ,
|
||||
color: connect4Color,
|
||||
specular: 0x333333,
|
||||
} ) );
|
||||
mesh.receiveShadow=false;
|
||||
mesh.castShadow=true;
|
||||
moveCell(c,r,mesh,step);
|
||||
childObjects.push(mesh);
|
||||
}
|
||||
}
|
||||
}
|
||||
checkLoaded();
|
||||
});
|
||||
smooth=0;
|
||||
url="smoothedfilegeo|"+smooth+"|"+fullPath+"/res/xd-view/meshes/connect4cell-foot.js";
|
||||
this.getResource(url,function(geometry , materials){
|
||||
if (!bTorus){
|
||||
for (var step=0 ; step < 2 ; step++){
|
||||
var mesh = new THREE.Mesh( geometry , matBlueFlat );
|
||||
var z=step==0?NBCOLS/2*CELLSIZE:-NBCOLS/2*CELLSIZE;
|
||||
mesh.position.x=0;
|
||||
mesh.position.y=(-NBROWS/2+.5)*CELLSIZE;
|
||||
mesh.position.z=z;
|
||||
childObjects.push(mesh);
|
||||
|
||||
var border1=new THREE.Mesh(
|
||||
new THREE.BoxGeometry(.6,CELLSIZE*NBROWS,.2),
|
||||
matBlueFlat);
|
||||
border1.position.z=z;
|
||||
childObjects.push(border1);
|
||||
}
|
||||
}
|
||||
checkLoaded();
|
||||
});
|
||||
// board xtras
|
||||
{
|
||||
if (bTorus){
|
||||
for (var c=0;c<NBCOLS;c++){
|
||||
var bar=new THREE.Mesh(
|
||||
new THREE.BoxGeometry(interspace*1.4,interspace,CELLSIZE*1.2),
|
||||
matBlueFlat);
|
||||
moveCell(c,-.5,bar,.5);
|
||||
childObjects.push(bar);
|
||||
}
|
||||
}else{
|
||||
var border1=new THREE.Mesh(
|
||||
new THREE.BoxGeometry(.6,.2,CELLSIZE*NBCOLS),
|
||||
matBlueFlat);
|
||||
border1.position.y=-(NBROWS/2)*CELLSIZE;
|
||||
childObjects.push(border1);
|
||||
}
|
||||
checkLoaded();
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
for(var r=0;r<this.mOptions.height;r++)
|
||||
for(var c=0;c<this.mOptions.width;c++) {
|
||||
var pos=r*this.mOptions.width+c;
|
||||
var coord2d=this.fiarCoord2d(c,r);
|
||||
xdv.createGadget("cell#"+pos, {
|
||||
"2d" : {
|
||||
type : "sprite",
|
||||
x : coord2d[0],
|
||||
y : coord2d[1],
|
||||
z : 2,
|
||||
file : fullPath+"/res/sprites2d.png",
|
||||
clipx: 0,
|
||||
clipy: 0,
|
||||
clipwidth: 200,
|
||||
clipheight: 200,
|
||||
width: SIZE,
|
||||
height: SIZE,
|
||||
},
|
||||
});
|
||||
}
|
||||
for(var c=0;c<this.mOptions.width;c++) {
|
||||
var $this=this;
|
||||
(function(c){
|
||||
var notation=String.fromCharCode(65+c);
|
||||
var coord2d=$this.fiarCoord2d(c,$this.mOptions.height-1);
|
||||
var coord3d=$this.fiarCoord3d(c,$this.mOptions.height-.7,bTorus?1:0);
|
||||
var centeringOffset=0.2*BLENDER2WORLD;
|
||||
if (bTorus){
|
||||
coord3d[3]+=90;
|
||||
var a=c*alpha;
|
||||
coord3d[0]+=centeringOffset*Math.cos(a);
|
||||
coord3d[1]-=centeringOffset*Math.sin(a);
|
||||
}else{
|
||||
coord3d[3]-=90;
|
||||
coord3d[0]-=.2*BLENDER2WORLD;
|
||||
}
|
||||
xdv.createGadget("text#"+c,{
|
||||
"2d": {
|
||||
type : "element",
|
||||
x : coord2d[0],
|
||||
y : coord2d[1],
|
||||
z : 3,
|
||||
initialClasses: "fiar-text",
|
||||
display : function(element, width, height) {
|
||||
element.css({
|
||||
"font-size" : (height * .5) + "pt",
|
||||
"line-height" : (height * 1) + "px",
|
||||
}).text(notation);
|
||||
},
|
||||
},
|
||||
"3d":{
|
||||
type: "custommesh3d",
|
||||
x: coord3d[1],
|
||||
y: coord3d[0],
|
||||
z: coord3d[2]+CELLSIZE/2*BLENDER2WORLD,
|
||||
rotate: coord3d[3],
|
||||
create: function() {
|
||||
var $this = this;
|
||||
this.getResource('font|'+fullPath+
|
||||
'/res/xd-view/fonts/helvetiker_regular.typeface.json',
|
||||
function(font) {
|
||||
var gg=new THREE.TextGeometry(""+notation,{
|
||||
size: 0.6,
|
||||
height: 0.05,
|
||||
curveSegments: 6,
|
||||
font: font,
|
||||
});
|
||||
var gm=new THREE.MeshPhongMaterial( { color: 0xff0000 } );
|
||||
var mesh= new THREE.Mesh( gg , gm );
|
||||
$this.objectReady(mesh);
|
||||
});
|
||||
return null;
|
||||
},
|
||||
}
|
||||
});
|
||||
xdv.createGadget("clicker#"+c+"t", {
|
||||
"2d" : {
|
||||
type : "element",
|
||||
x : (c+.5)*SIZE-6000,
|
||||
y : -SIZE,
|
||||
z : 4,
|
||||
width: SIZE,
|
||||
height: $this.mOptions.height*SIZE,
|
||||
/*
|
||||
css: {
|
||||
"background-color": "rgba(255,0,0,.6)",
|
||||
"border": "1px solid Black",
|
||||
}
|
||||
*/
|
||||
},
|
||||
"3d" : {
|
||||
type: "custommesh3d",
|
||||
create: function(callback){
|
||||
|
||||
var pivot = new THREE.Object3D();//create an empty container
|
||||
//var pivot = new THREE.Mesh(new THREE.CubeGeometry(10,10,10),new THREE.MeshPhongMaterial());//create an empty container
|
||||
|
||||
var gg=new THREE.BoxGeometry((2*CELLTHICKNESS+interspace)*.05,CELLSIZE*NBROWS,CELLSIZE);
|
||||
var mesh = new THREE.Mesh( gg ,
|
||||
new THREE.MeshPhongMaterial( {
|
||||
wireframe: true ,
|
||||
color: Math.random()*0xffffff,
|
||||
shininess:10,
|
||||
transparent: true,
|
||||
opacity: 0,
|
||||
} ) );
|
||||
mesh.position.z=(c+.5-NBCOLS/2)*CELLSIZE;
|
||||
moveCell(c,NBROWS/2-.5,mesh,0);
|
||||
//mesh.rotation.y=colOrientation(c,0);
|
||||
pivot.add(mesh);
|
||||
callback(pivot);
|
||||
},
|
||||
},
|
||||
});
|
||||
xdv.createGadget("clicker#"+c+"b", {
|
||||
"2d" : {
|
||||
type : "element",
|
||||
x : (c+.5)*SIZE-6000,
|
||||
y : ($this.mOptions.height/2)*SIZE,
|
||||
z : 4,
|
||||
width: SIZE,
|
||||
height: 2*SIZE,
|
||||
/*
|
||||
css: {
|
||||
"background-color": "rgba(0,0,255,.6)",
|
||||
"border": "1px solid Black",
|
||||
}
|
||||
*/
|
||||
},
|
||||
"3d" : {
|
||||
type: "custommesh3d",
|
||||
create: function(callback){
|
||||
var group = new THREE.Object3D();//create an empty container
|
||||
var gg=new THREE.BoxGeometry((4*CELLTHICKNESS+interspace)*1.1,CELLSIZE,CELLSIZE);
|
||||
var mesh = new THREE.Mesh( gg ,
|
||||
new THREE.MeshPhongMaterial( {
|
||||
wireframe: true ,
|
||||
color: Math.random()*0xffffff,
|
||||
shininess:250,
|
||||
transparent: true,
|
||||
opacity: 0,
|
||||
} ) );
|
||||
mesh.position.z=(c+.5-NBCOLS/2)*CELLSIZE;
|
||||
moveCell(c,0,mesh,0);
|
||||
//mesh.rotation.y=colOrientation(c,0);
|
||||
group.add(mesh);
|
||||
callback(group);
|
||||
},
|
||||
},
|
||||
});
|
||||
})(c);
|
||||
}
|
||||
|
||||
function createScreen(videoTexture) {
|
||||
var $this=this;
|
||||
var smooth=0;
|
||||
this.getResource("smoothedfilegeo|"+smooth+"|"+fullPath+"/res/xd-view/meshes/stade-screen.js",function(geometry , materials) {
|
||||
var materials0=[];
|
||||
|
||||
for(var i=0;i<materials.length;i++){
|
||||
if (materials[i].name=="mat.screen"){
|
||||
var mat=materials[i].clone();
|
||||
mat.map=videoTexture;
|
||||
mat.overdraw = true;
|
||||
mat.emissive = {r:1,g:1,b:1};
|
||||
//mat.side = THREE.DoubleSide;
|
||||
materials0.push(mat);
|
||||
}else{
|
||||
var mat=materials[i].clone();
|
||||
mat.shading=THREE.FlatShading;
|
||||
materials0.push(mat);
|
||||
}
|
||||
}
|
||||
var mesh = new THREE.Mesh( geometry , new THREE.MultiMaterial( materials0 ) );
|
||||
|
||||
mesh.visible = false;
|
||||
$this.objectReady(mesh);
|
||||
});
|
||||
return null;
|
||||
};
|
||||
|
||||
var scaleScreen=5;
|
||||
var zScreen=0;
|
||||
var xScreen=3000;
|
||||
var yScreen=(NBCOLS/2+2)*CELLSIZE*BLENDER2WORLD;
|
||||
var screenAngle=25;
|
||||
xdv.createGadget("videoa",{
|
||||
"3d": {
|
||||
type : "video3d",
|
||||
makeMesh: function(videoTexture){
|
||||
return createScreen.call(this,videoTexture);
|
||||
},
|
||||
z: zScreen,
|
||||
x: xScreen,
|
||||
y: yScreen,
|
||||
rotate: -(180-screenAngle),
|
||||
scale: [scaleScreen,scaleScreen,scaleScreen],
|
||||
},
|
||||
});
|
||||
xdv.createGadget("videob",{
|
||||
"3d": {
|
||||
type : "video3d",
|
||||
makeMesh: function(videoTexture){
|
||||
return createScreen.call(this,videoTexture);
|
||||
},
|
||||
z: zScreen,
|
||||
x: xScreen,
|
||||
y: -yScreen,
|
||||
rotate: -screenAngle,
|
||||
scale: [scaleScreen,scaleScreen,scaleScreen],
|
||||
},
|
||||
});
|
||||
|
||||
var fillerW=.05;
|
||||
for(var c=0;c<(this.mOptions.width+1);c++) {
|
||||
xdv.createGadget("filler#c"+c, {
|
||||
"2d" : {
|
||||
type : "element",
|
||||
x : c*SIZE-full2dWidth/2,
|
||||
y : 0,
|
||||
z : 3,
|
||||
width: SIZE*.05,
|
||||
height: (this.mOptions.height+fillerW)*SIZE,
|
||||
css: {
|
||||
"background-color": "#0065d0",
|
||||
}
|
||||
|
||||
},
|
||||
});
|
||||
}
|
||||
for(var r=0;r<(this.mOptions.height+1);r++) {
|
||||
xdv.createGadget("filler#r"+r, {
|
||||
"2d" : {
|
||||
type : "element",
|
||||
y : r*SIZE-full2dHeight/2,
|
||||
x : 0,
|
||||
z : 3,
|
||||
height: SIZE*.05,
|
||||
width: (this.mOptions.width+fillerW)*SIZE,
|
||||
css: {
|
||||
"background-color": "#0065d0",
|
||||
}
|
||||
|
||||
},
|
||||
});
|
||||
}
|
||||
if (bTorus){
|
||||
for (var c=0;c<2;c++){
|
||||
xdv.createGadget("fillertorus#c"+c, {
|
||||
"2d" : {
|
||||
type : "element",
|
||||
x : c*full2dWidth-full2dWidth/2,
|
||||
y : 0,
|
||||
z : 4,
|
||||
width: SIZE*.08,
|
||||
height: (this.mOptions.height+fillerW)*SIZE,
|
||||
initialClasses: c==0?"fiar-holes-left":"fiar-holes-right",
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var tokens={},tokenCounter=1;
|
||||
|
||||
View.Game.fiarIsToken = function(c,r) {
|
||||
var token=tokens[c+"/"+r];
|
||||
return !!token;
|
||||
}
|
||||
|
||||
View.Game.fiarRemoveToken = function(c,r) {
|
||||
var token=tokens[c+"/"+r];
|
||||
if(token)
|
||||
delete tokens[c+"/"+r];
|
||||
}
|
||||
|
||||
View.Game.fiarMoveToken = function(c0,r0,c,r) {
|
||||
var token=tokens[c0+"/"+r0];
|
||||
if(token) {
|
||||
delete tokens[c0+"/"+r0];
|
||||
tokens[c+"/"+r]=token;
|
||||
}
|
||||
}
|
||||
|
||||
View.Game.fiarGetToken = function(xdv,c,r,who) {
|
||||
var token=tokens[c+"/"+r];
|
||||
if(!token) {
|
||||
token="token#"+(tokenCounter++);
|
||||
var coord2d=this.fiarCoord2d(c,r);
|
||||
var coord3d=this.fiarCoord3d(c,r);
|
||||
xdv.createGadget(token, {
|
||||
"2d" : {
|
||||
type : "sprite",
|
||||
x : coord2d[0],
|
||||
y : coord2d[1],
|
||||
z : 1,
|
||||
file : fullPath+"/res/sprites2d.png",
|
||||
clipx: 0,
|
||||
clipy: 0,
|
||||
clipwidth: 200,
|
||||
clipheight: 200,
|
||||
width: SIZE,
|
||||
height: SIZE,
|
||||
},
|
||||
"3d" : {
|
||||
type: "meshfile",
|
||||
file : fullPath+"/res/xd-view/meshes/connect4-token.js",
|
||||
flatShading: true,
|
||||
x: coord3d[1],
|
||||
y: coord3d[0],
|
||||
z: coord3d[2],
|
||||
rotate: coord3d[3],
|
||||
receiveShadow:false //bTorus?false:true,
|
||||
}
|
||||
});
|
||||
tokens[c+"/"+r]=token;
|
||||
}
|
||||
if(arguments.length>3){
|
||||
var url=fullPath+"/res/xd-view/meshes/connect4-yellow.png";
|
||||
if (who==1) url=fullPath+"/res/xd-view/meshes/connect4-red.png";
|
||||
xdv.updateGadget(token,{
|
||||
"2d": {
|
||||
clipx : who==1?200:400,
|
||||
},
|
||||
"3d": {
|
||||
materials : {
|
||||
"token-mat" : {
|
||||
map: url,
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
View.Game.xdBuildScene = function(xdv) {
|
||||
for(var pos=0;pos<this.mOptions.width*this.mOptions.height;pos++)
|
||||
xdv.updateGadget("cell#"+pos, {
|
||||
"base" : {
|
||||
visible : true,
|
||||
},
|
||||
});
|
||||
xdv.updateGadget("board3d",{
|
||||
"3d":{
|
||||
visible : true,
|
||||
}
|
||||
});
|
||||
xdv.updateGadget("lightside",{
|
||||
"3d": {
|
||||
visible: true,
|
||||
},
|
||||
});
|
||||
for (var i=0;i<nbBackLights;i++){
|
||||
xdv.updateGadget("lightback"+i,{
|
||||
"3d": {
|
||||
visible: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
xdv.updateGadget("videoa",{
|
||||
"3d": {
|
||||
visible: true,
|
||||
playerSide: 1,
|
||||
},
|
||||
});
|
||||
|
||||
xdv.updateGadget("videob",{
|
||||
"3d": {
|
||||
visible: true,
|
||||
//rotate: 90,
|
||||
playerSide: -1,
|
||||
},
|
||||
});
|
||||
for(var c=0;c<this.mOptions.width;c++){
|
||||
xdv.updateGadget("text#"+c,{
|
||||
base: {
|
||||
visible: this.mNotation,
|
||||
}
|
||||
});
|
||||
}
|
||||
for(var c=0;c<(this.mOptions.width+1);c++) {
|
||||
xdv.updateGadget("filler#c"+c, {
|
||||
"2d": {
|
||||
visible: true,
|
||||
}
|
||||
});
|
||||
}
|
||||
for(var r=0;r<(this.mOptions.height+1);r++) {
|
||||
xdv.updateGadget("filler#r"+r, {
|
||||
"2d": {
|
||||
visible: true,
|
||||
}
|
||||
});
|
||||
}
|
||||
if (bTorus){
|
||||
for (var c=0;c<2;c++){
|
||||
xdv.updateGadget("fillertorus#c"+c, {
|
||||
"2d": {
|
||||
visible: true,
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
View.Board.xdDisplay = function(xdv, aGame) {
|
||||
var wTokens={};
|
||||
if(this.mFinished)
|
||||
for(var i=0;i<aGame.g.TuplesList.length;i++) {
|
||||
var tuple=aGame.g.TuplesList[i];
|
||||
var counter={
|
||||
1: 0,
|
||||
0: 0,
|
||||
'-1': 0,
|
||||
};
|
||||
for(var j=0;j<tuple.length;j++)
|
||||
counter[this.board[tuple[j]]]++;
|
||||
if(counter[1]==aGame.mOptions.lines || counter['-1']==aGame.mOptions.lines)
|
||||
for(var j=0;j<tuple.length;j++)
|
||||
wTokens[tuple[j]]=true;
|
||||
}
|
||||
for(var r=0;r<aGame.mOptions.height;r++) {
|
||||
for(var c=0;c<aGame.mOptions.width;c++) {
|
||||
var pos=r*aGame.mOptions.width+c;
|
||||
if(this.board[pos]==0) {
|
||||
if(aGame.fiarIsToken(c,r)) {
|
||||
var token=aGame.fiarGetToken(xdv,c,r);
|
||||
xdv.updateGadget(token,{
|
||||
base: {
|
||||
visible: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
} else {
|
||||
var token=aGame.fiarGetToken(xdv,c,r,this.board[pos]);
|
||||
var coord2d=aGame.fiarCoord2d(c,r);
|
||||
var coord3d=aGame.fiarCoord3d(c,r);
|
||||
var url=fullPath+"/res/xd-view/meshes/connect4";
|
||||
if (this.board[pos]==1)
|
||||
url+="-red";
|
||||
else
|
||||
url+="-yellow";
|
||||
if (pos in wTokens)
|
||||
url+="-star";
|
||||
url+=".png";
|
||||
xdv.updateGadget(token,{
|
||||
base: {
|
||||
visible: true,
|
||||
},
|
||||
"2d": {
|
||||
x : coord2d[0],
|
||||
y : coord2d[1],
|
||||
clipy : (pos in wTokens)?200:0,
|
||||
},
|
||||
"3d": {
|
||||
x: coord3d[1],
|
||||
y: coord3d[0],
|
||||
z: coord3d[2],
|
||||
rotate: coord3d[3],
|
||||
materials : {
|
||||
"token-mat" : {
|
||||
map: url,
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
View.Board.xdBuildHTStateMachine = function(xdv, htsm, aGame) {
|
||||
var $this=this;
|
||||
function Select() {
|
||||
for(var i=0;i<$this.mMoves.length;i++) {
|
||||
var move=$this.mMoves[i];
|
||||
if(move.op=='+') {
|
||||
(function(col) {
|
||||
xdv.updateGadget("clicker#"+col+"t",{
|
||||
base: {
|
||||
visible: true,
|
||||
click: function() {
|
||||
htsm.smQueueEvent("E_CLICK",{col:col,op:'+'});
|
||||
},
|
||||
},
|
||||
});
|
||||
if(!aGame.mOptions.remove)
|
||||
xdv.updateGadget("clicker#"+move.col+"b",{
|
||||
base: {
|
||||
visible: true,
|
||||
click: function() {
|
||||
htsm.smQueueEvent("E_CLICK",{col:col,op:'+'});
|
||||
},
|
||||
},
|
||||
});
|
||||
})(move.col);
|
||||
} else if(move.op=='-') {
|
||||
(function(col) {
|
||||
xdv.updateGadget("clicker#"+move.col+"b",{
|
||||
base: {
|
||||
visible: true,
|
||||
click: function() {
|
||||
htsm.smQueueEvent("E_CLICK",{col:col,op:'-'});
|
||||
},
|
||||
},
|
||||
});
|
||||
})(move.col);
|
||||
}
|
||||
}
|
||||
}
|
||||
function Clean() {
|
||||
for(var col=0;col<aGame.mOptions.width;col++) {
|
||||
xdv.updateGadget("clicker#"+col+"t",{
|
||||
base: {
|
||||
visible: false,
|
||||
click: null,
|
||||
},
|
||||
});
|
||||
xdv.updateGadget("clicker#"+col+"b",{
|
||||
base: {
|
||||
visible: false,
|
||||
click: null,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
function Click(args) {
|
||||
if(args.op=='+')
|
||||
$this.fiarAnimateDrop(xdv,aGame,args.col,$this.cols[args.col],function() {
|
||||
aGame.HumanMove({
|
||||
col: args.col,
|
||||
op: '+',
|
||||
});
|
||||
});
|
||||
else if(args.op=='-')
|
||||
$this.fiarAnimateOut(xdv,aGame,args.col,$this.cols[args.col]-1,function() {
|
||||
aGame.HumanMove({
|
||||
col: args.col,
|
||||
op: '-',
|
||||
});
|
||||
});
|
||||
}
|
||||
htsm.smTransition("S_INIT", "E_INIT", "S_SELECT", [ Select ]);
|
||||
htsm.smTransition("S_SELECT", "E_CLICK", "S_ANIMATE", [ Clean, Click ]);
|
||||
htsm.smTransition(["S_SELECT","S_ANIMATE"], "E_END", "S_DONE", [ ]);
|
||||
htsm.smEntering("S_DONE",[Clean]);
|
||||
}
|
||||
|
||||
View.Board.xdPlayedMove = function(xdv, aGame, aMove) {
|
||||
if(aMove.op=='+')
|
||||
this.fiarAnimateDrop(xdv,aGame,aMove.col,this.cols[aMove.col]-1,function() {
|
||||
aGame.MoveShown();
|
||||
});
|
||||
else if(aMove.op=='-')
|
||||
this.fiarAnimateOut(xdv,aGame,aMove.col,this.cols[aMove.col],function() {
|
||||
aGame.MoveShown();
|
||||
});
|
||||
}
|
||||
|
||||
View.Board.fiarAnimateDrop = function(xdv,aGame,c,r,callback) {
|
||||
var token = aGame.fiarGetToken(xdv,c,r,this.mWho);
|
||||
var coord2d=aGame.fiarCoord2d(c,r);
|
||||
var coord3d=aGame.fiarCoord3d(c,r);
|
||||
xdv.updateGadget(token,{
|
||||
base: {
|
||||
visible: true,
|
||||
},
|
||||
"2d": {
|
||||
x: coord2d[0],
|
||||
y: -13000,
|
||||
clipy: 0,
|
||||
},
|
||||
"3d":{
|
||||
y: coord3d[0],
|
||||
z: NBROWS/2*CELLSIZE*BLENDER2WORLD,
|
||||
}
|
||||
});
|
||||
|
||||
aGame.PlaySound("sound2");
|
||||
|
||||
xdv.updateGadget(token,{
|
||||
"2d": {
|
||||
y: coord2d[1],
|
||||
},
|
||||
"3d":{
|
||||
z: coord3d[2],
|
||||
}
|
||||
},400,function() {
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
View.Board.fiarAnimateOut = function(xdv,aGame,c,topr,callback) {
|
||||
var animCount=0;
|
||||
var moved=[];
|
||||
function AnimEnd() {
|
||||
if(--animCount==0) {
|
||||
for(var i=0;i<moved.length;i++) {
|
||||
var from=moved[i].from;
|
||||
var to=moved[i].to;
|
||||
aGame.fiarMoveToken(from.c,from.r,to.c,to.r);
|
||||
}
|
||||
callback();
|
||||
}
|
||||
}
|
||||
var outToken=aGame.fiarGetToken(xdv,c,0,this.mWho);
|
||||
var coord2d=aGame.fiarCoord2d(c,0);
|
||||
var coord3d=aGame.fiarCoord3d(c,0);
|
||||
animCount++;
|
||||
xdv.updateGadget(outToken,{
|
||||
"2d": {
|
||||
x: coord2d[0],
|
||||
y: 13000,
|
||||
},
|
||||
"3d": {
|
||||
y: coord3d[0],
|
||||
z: -13000,
|
||||
}
|
||||
},600,function() {
|
||||
xdv.removeGadget(outToken);
|
||||
aGame.fiarRemoveToken(c,0);
|
||||
AnimEnd();
|
||||
});
|
||||
for(var i=1;i<=topr;i++) {
|
||||
(function(r) {
|
||||
var token=aGame.fiarGetToken(xdv,c,r);
|
||||
if(token) {
|
||||
moved.push({
|
||||
from: {
|
||||
c: c,
|
||||
r: r,
|
||||
},
|
||||
to: {
|
||||
c: c,
|
||||
r: r-1,
|
||||
},
|
||||
});
|
||||
var coord2d=aGame.fiarCoord2d(c,r-1);
|
||||
var coord3d=aGame.fiarCoord3d(c,r-1);
|
||||
animCount++;
|
||||
xdv.updateGadget(token,{
|
||||
"2d": {
|
||||
y: coord2d[1],
|
||||
},
|
||||
"3d": {
|
||||
z: coord3d[2],
|
||||
}
|
||||
},600,function() {
|
||||
AnimEnd();
|
||||
});
|
||||
}
|
||||
})(i)
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
13
src/games/fourinarow/fiarbase.css
Normal file
|
@ -0,0 +1,13 @@
|
|||
.fiar-text{
|
||||
text-align: center;
|
||||
cursor:default;
|
||||
}
|
||||
.fiar-holes-left{
|
||||
background-image: url(res/images/holeleft.png);
|
||||
background-repeat:repeat-y;
|
||||
background-size: contain;
|
||||
}.fiar-holes-right{
|
||||
background-image: url(res/images/holeright.png);
|
||||
background-repeat:repeat-y;
|
||||
background-size: contain;
|
||||
}
|
774
src/games/fourinarow/index.js
Normal file
|
@ -0,0 +1,774 @@
|
|||
|
||||
var mvs = {
|
||||
"models": {
|
||||
"fourinarow": {
|
||||
"plazza": "true",
|
||||
"title-en": "Four In A Row",
|
||||
"module": "fourinarow",
|
||||
"js": [
|
||||
"fiarbase-model.js"
|
||||
],
|
||||
"summary": "Four In A Row game",
|
||||
"thumbnail": "fiar-thumb.png",
|
||||
"rules": {
|
||||
"en": "rules.html",
|
||||
"fr": "rules-fr.html"
|
||||
},
|
||||
"description": {
|
||||
"en": "description.html",
|
||||
"fr": "description-fr.html"
|
||||
},
|
||||
"credits": {
|
||||
"en": "credits.html",
|
||||
"fr": "credits-fr.html"
|
||||
},
|
||||
"gameOptions": {
|
||||
"width": 7,
|
||||
"height": 6,
|
||||
"lines": 4,
|
||||
"remove": false,
|
||||
"levelOptions": {
|
||||
"evalTuple1": 1,
|
||||
"evalTuple2": 2,
|
||||
"evalTuple3": 4,
|
||||
"evalTuple4": 8,
|
||||
"evalTuple5": 16,
|
||||
"evalTuple6": 32
|
||||
},
|
||||
"uctTransposition": "state"
|
||||
},
|
||||
"levels": [
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "easy",
|
||||
"label": "Easy",
|
||||
"maxNodes": 1000,
|
||||
"isDefault": true
|
||||
},
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "fast",
|
||||
"label": "Fast [1sec]",
|
||||
"maxDuration": 1
|
||||
},
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "strong",
|
||||
"label": "Strong",
|
||||
"maxNodes": 10000
|
||||
}
|
||||
]
|
||||
},
|
||||
"fourinarow96": {
|
||||
"plazza": "true",
|
||||
"title-en": "Four In A Row 9x6",
|
||||
"module": "fourinarow",
|
||||
"js": [
|
||||
"fiarbase-model.js"
|
||||
],
|
||||
"summary": "Four In A Row on a 9x6 board",
|
||||
"thumbnail": "fiar-thumb.png",
|
||||
"rules": {
|
||||
"en": "rules.html",
|
||||
"fr": "rules-fr.html"
|
||||
},
|
||||
"description": {
|
||||
"en": "description.html",
|
||||
"fr": "description-fr.html"
|
||||
},
|
||||
"credits": {
|
||||
"en": "credits.html",
|
||||
"fr": "credits-fr.html"
|
||||
},
|
||||
"gameOptions": {
|
||||
"width": 9,
|
||||
"height": 6,
|
||||
"lines": 4,
|
||||
"remove": false,
|
||||
"levelOptions": {
|
||||
"evalTuple1": 1,
|
||||
"evalTuple2": 2,
|
||||
"evalTuple3": 4,
|
||||
"evalTuple4": 8,
|
||||
"evalTuple5": 16,
|
||||
"evalTuple6": 32
|
||||
},
|
||||
"uctTransposition": "state"
|
||||
},
|
||||
"levels": [
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "easy",
|
||||
"label": "Easy",
|
||||
"maxNodes": 1000,
|
||||
"isDefault": true
|
||||
},
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "fast",
|
||||
"label": "Fast [1sec]",
|
||||
"maxDuration": 1
|
||||
},
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "strong",
|
||||
"label": "Strong",
|
||||
"maxNodes": 10000
|
||||
}
|
||||
]
|
||||
},
|
||||
"fiarpopout": {
|
||||
"plazza": "true",
|
||||
"title-en": "Popout",
|
||||
"module": "fourinarow",
|
||||
"js": [
|
||||
"fiarbase-model.js"
|
||||
],
|
||||
"summary": "Four In A Row with removals",
|
||||
"thumbnail": "fiar-thumb.png",
|
||||
"rules": {
|
||||
"en": "rules.html",
|
||||
"fr": "rules-fr.html"
|
||||
},
|
||||
"description": {
|
||||
"en": "description.html",
|
||||
"fr": "description-fr.html"
|
||||
},
|
||||
"credits": {
|
||||
"en": "credits.html",
|
||||
"fr": "credits-fr.html"
|
||||
},
|
||||
"gameOptions": {
|
||||
"width": 7,
|
||||
"height": 6,
|
||||
"lines": 4,
|
||||
"remove": true,
|
||||
"levelOptions": {
|
||||
"evalTuple1": 1,
|
||||
"evalTuple2": 2,
|
||||
"evalTuple3": 4,
|
||||
"evalTuple4": 8,
|
||||
"evalTuple5": 16,
|
||||
"evalTuple6": 32
|
||||
},
|
||||
"uctTransposition": "state",
|
||||
"preventRepeat": true
|
||||
},
|
||||
"levels": [
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "easy",
|
||||
"label": "Easy",
|
||||
"maxNodes": 1000,
|
||||
"isDefault": true
|
||||
},
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "fast",
|
||||
"label": "Fast [1sec]",
|
||||
"maxDuration": 1
|
||||
},
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "strong",
|
||||
"label": "Strong",
|
||||
"maxNodes": 10000
|
||||
}
|
||||
]
|
||||
},
|
||||
"fiveinarow": {
|
||||
"plazza": "true",
|
||||
"title-en": "Five In A Row",
|
||||
"module": "fourinarow",
|
||||
"js": [
|
||||
"fiarbase-model.js"
|
||||
],
|
||||
"summary": "Variant of Four In A Row",
|
||||
"thumbnail": "fiar-thumb.png",
|
||||
"rules": {
|
||||
"en": "rules.html",
|
||||
"fr": "rules-fr.html"
|
||||
},
|
||||
"description": {
|
||||
"en": "description.html",
|
||||
"fr": "description-fr.html"
|
||||
},
|
||||
"credits": {
|
||||
"en": "credits.html",
|
||||
"fr": "credits-fr.html"
|
||||
},
|
||||
"gameOptions": {
|
||||
"width": 9,
|
||||
"height": 6,
|
||||
"lines": 5,
|
||||
"remove": false,
|
||||
"levelOptions": {
|
||||
"evalTuple1": 1,
|
||||
"evalTuple2": 2,
|
||||
"evalTuple3": 4,
|
||||
"evalTuple4": 8,
|
||||
"evalTuple5": 16,
|
||||
"evalTuple6": 32
|
||||
},
|
||||
"uctTransposition": "state",
|
||||
"fillSides": true
|
||||
},
|
||||
"levels": [
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "easy",
|
||||
"label": "Easy",
|
||||
"maxNodes": 1000,
|
||||
"isDefault": true
|
||||
},
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "fast",
|
||||
"label": "Fast [1sec]",
|
||||
"maxDuration": 1
|
||||
},
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "strong",
|
||||
"label": "Strong",
|
||||
"maxNodes": 10000
|
||||
}
|
||||
]
|
||||
},
|
||||
"torus4": {
|
||||
"plazza": "true",
|
||||
"title-en": "Torus 4",
|
||||
"module": "fourinarow",
|
||||
"js": [
|
||||
"fiarbase-model.js"
|
||||
],
|
||||
"summary": "Four In A Row on a cylinder",
|
||||
"thumbnail": "fiar-torus-thumb.png",
|
||||
"rules": {
|
||||
"en": "rules.html",
|
||||
"fr": "rules-fr.html"
|
||||
},
|
||||
"description": {
|
||||
"en": "description.html",
|
||||
"fr": "description-fr.html"
|
||||
},
|
||||
"credits": {
|
||||
"en": "credits.html",
|
||||
"fr": "credits-fr.html"
|
||||
},
|
||||
"gameOptions": {
|
||||
"width": 9,
|
||||
"height": 6,
|
||||
"lines": 4,
|
||||
"remove": false,
|
||||
"levelOptions": {
|
||||
"evalTuple1": 1,
|
||||
"evalTuple2": 2,
|
||||
"evalTuple3": 4,
|
||||
"evalTuple4": 8,
|
||||
"evalTuple5": 16,
|
||||
"evalTuple6": 32
|
||||
},
|
||||
"uctTransposition": "state",
|
||||
"torus": true
|
||||
},
|
||||
"levels": [
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "easy",
|
||||
"label": "Easy",
|
||||
"maxNodes": 1000,
|
||||
"isDefault": true
|
||||
},
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "fast",
|
||||
"label": "Fast [1sec]",
|
||||
"maxDuration": 1
|
||||
},
|
||||
{
|
||||
"ai": "uct",
|
||||
"playoutDepth": 0,
|
||||
"minVisitsExpand": 1,
|
||||
"c": 0.55,
|
||||
"ignoreLeaf": false,
|
||||
"name": "strong",
|
||||
"label": "Strong",
|
||||
"maxNodes": 10000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"views": {
|
||||
"fourinarow": {
|
||||
"title-en": "Four In A Row View",
|
||||
"module": "fourinarow",
|
||||
"js": [
|
||||
"fiarbase-xd-view.js"
|
||||
],
|
||||
"xdView": true,
|
||||
"css": [
|
||||
"fiarbase.css"
|
||||
],
|
||||
"preferredRatio": 1,
|
||||
"useShowMoves": false,
|
||||
"useNotation": true,
|
||||
"sounds": {
|
||||
"sound1": "sound1",
|
||||
"sound2": "sound2"
|
||||
},
|
||||
"defaultOptions": {
|
||||
"sounds": true,
|
||||
"moves": true,
|
||||
"notation": false
|
||||
},
|
||||
"skins": [
|
||||
{
|
||||
"name": "fiar3d",
|
||||
"title": "3D Classic",
|
||||
"3d": true,
|
||||
"camera": {
|
||||
"radius": 20,
|
||||
"limitCamMoves": true,
|
||||
"rotationAngle": 180,
|
||||
"elevationAngle": 0,
|
||||
"elevationMin": -89,
|
||||
"elevationMax": 89,
|
||||
"distMax": 30
|
||||
},
|
||||
"world": {
|
||||
"lightIntensity": 0.2,
|
||||
"skyLightIntensity": 0.2,
|
||||
"lightCastShadow": false,
|
||||
"fog": true,
|
||||
"color": 0,
|
||||
"lightPosition": {
|
||||
"x": 10,
|
||||
"y": 5,
|
||||
"z": 0
|
||||
},
|
||||
"lightShadowDarkness": 0.55,
|
||||
"ambientLightColor": 2236996
|
||||
},
|
||||
"preload": [
|
||||
"map|/res/xd-view/meshes/connect4-red-star.png",
|
||||
"map|/res/xd-view/meshes/connect4-red.png",
|
||||
"map|/res/xd-view/meshes/connect4-yellow-star.png",
|
||||
"map|/res/xd-view/meshes/connect4-yellow.png",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell-ring-smoothed.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4-token.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell-foot.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "fiar2d",
|
||||
"title": "2D Classic",
|
||||
"3d": false,
|
||||
"preload": [
|
||||
"image|/res/sprites2d.png"
|
||||
]
|
||||
}
|
||||
],
|
||||
"animateSelfMoves": false,
|
||||
"visuals": {
|
||||
"600x600": [
|
||||
"res/visuals/fourinarow-600x600-3d.jpg",
|
||||
"res/visuals/fourinarow-600x600-2d.jpg"
|
||||
]
|
||||
}
|
||||
},
|
||||
"fourinarow96": {
|
||||
"title-en": "Four In A Row View",
|
||||
"module": "fourinarow",
|
||||
"js": [
|
||||
"fiarbase-xd-view.js"
|
||||
],
|
||||
"xdView": true,
|
||||
"css": [
|
||||
"fiarbase.css"
|
||||
],
|
||||
"preferredRatio": 1,
|
||||
"useShowMoves": false,
|
||||
"useNotation": true,
|
||||
"sounds": {
|
||||
"sound1": "sound1",
|
||||
"sound2": "sound2"
|
||||
},
|
||||
"defaultOptions": {
|
||||
"sounds": true,
|
||||
"moves": true,
|
||||
"notation": false
|
||||
},
|
||||
"skins": [
|
||||
{
|
||||
"name": "fiar3d",
|
||||
"title": "3D Classic",
|
||||
"3d": true,
|
||||
"camera": {
|
||||
"radius": 20,
|
||||
"limitCamMoves": true,
|
||||
"rotationAngle": 180,
|
||||
"elevationAngle": 0,
|
||||
"elevationMin": -89,
|
||||
"elevationMax": 89,
|
||||
"distMax": 30
|
||||
},
|
||||
"world": {
|
||||
"lightIntensity": 0.2,
|
||||
"skyLightIntensity": 0.2,
|
||||
"lightCastShadow": false,
|
||||
"fog": true,
|
||||
"color": 0,
|
||||
"lightPosition": {
|
||||
"x": 10,
|
||||
"y": 5,
|
||||
"z": 0
|
||||
},
|
||||
"lightShadowDarkness": 0.55,
|
||||
"ambientLightColor": 2236996
|
||||
},
|
||||
"preload": [
|
||||
"map|/res/xd-view/meshes/connect4-red-star.png",
|
||||
"map|/res/xd-view/meshes/connect4-red.png",
|
||||
"map|/res/xd-view/meshes/connect4-yellow-star.png",
|
||||
"map|/res/xd-view/meshes/connect4-yellow.png",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell-ring-smoothed.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4-token.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell-foot.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "fiar2d",
|
||||
"title": "2D Classic",
|
||||
"3d": false,
|
||||
"preload": [
|
||||
"image|/res/sprites2d.png"
|
||||
]
|
||||
}
|
||||
],
|
||||
"animateSelfMoves": false,
|
||||
"visuals": {
|
||||
"600x600": [
|
||||
"res/visuals/fourinarow-9x6-600x600-3d.jpg",
|
||||
"res/visuals/fourinarow-9x6-600x600-2d.jpg"
|
||||
]
|
||||
}
|
||||
},
|
||||
"fiarpopout": {
|
||||
"title-en": "Four In A Row View",
|
||||
"module": "fourinarow",
|
||||
"js": [
|
||||
"fiarbase-xd-view.js"
|
||||
],
|
||||
"xdView": true,
|
||||
"css": [
|
||||
"fiarbase.css"
|
||||
],
|
||||
"preferredRatio": 1,
|
||||
"useShowMoves": false,
|
||||
"useNotation": true,
|
||||
"sounds": {
|
||||
"sound1": "sound1",
|
||||
"sound2": "sound2"
|
||||
},
|
||||
"defaultOptions": {
|
||||
"sounds": true,
|
||||
"moves": true,
|
||||
"notation": false
|
||||
},
|
||||
"skins": [
|
||||
{
|
||||
"name": "fiar3d",
|
||||
"title": "3D Classic",
|
||||
"3d": true,
|
||||
"camera": {
|
||||
"radius": 20,
|
||||
"limitCamMoves": true,
|
||||
"rotationAngle": 180,
|
||||
"elevationAngle": 0,
|
||||
"elevationMin": -89,
|
||||
"elevationMax": 89,
|
||||
"distMax": 30
|
||||
},
|
||||
"world": {
|
||||
"lightIntensity": 0.2,
|
||||
"skyLightIntensity": 0.2,
|
||||
"lightCastShadow": false,
|
||||
"fog": true,
|
||||
"color": 0,
|
||||
"lightPosition": {
|
||||
"x": 10,
|
||||
"y": 5,
|
||||
"z": 0
|
||||
},
|
||||
"lightShadowDarkness": 0.55,
|
||||
"ambientLightColor": 2236996
|
||||
},
|
||||
"preload": [
|
||||
"map|/res/xd-view/meshes/connect4-red-star.png",
|
||||
"map|/res/xd-view/meshes/connect4-red.png",
|
||||
"map|/res/xd-view/meshes/connect4-yellow-star.png",
|
||||
"map|/res/xd-view/meshes/connect4-yellow.png",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell-ring-smoothed.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4-token.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell-foot.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "fiar2d",
|
||||
"title": "2D Classic",
|
||||
"3d": false,
|
||||
"preload": [
|
||||
"image|/res/sprites2d.png"
|
||||
]
|
||||
}
|
||||
],
|
||||
"animateSelfMoves": false,
|
||||
"visuals": {
|
||||
"600x600": [
|
||||
"res/visuals/popout-600x600-3d.jpg",
|
||||
"res/visuals/popout-600x600-2d.jpg"
|
||||
]
|
||||
}
|
||||
},
|
||||
"fiveinarow": {
|
||||
"title-en": "Four In A Row View",
|
||||
"module": "fourinarow",
|
||||
"js": [
|
||||
"fiarbase-xd-view.js"
|
||||
],
|
||||
"xdView": true,
|
||||
"css": [
|
||||
"fiarbase.css"
|
||||
],
|
||||
"preferredRatio": 1,
|
||||
"useShowMoves": false,
|
||||
"useNotation": true,
|
||||
"sounds": {
|
||||
"sound1": "sound1",
|
||||
"sound2": "sound2"
|
||||
},
|
||||
"defaultOptions": {
|
||||
"sounds": true,
|
||||
"moves": true,
|
||||
"notation": false
|
||||
},
|
||||
"skins": [
|
||||
{
|
||||
"name": "fiar3d",
|
||||
"title": "3D Classic",
|
||||
"3d": true,
|
||||
"camera": {
|
||||
"radius": 20,
|
||||
"limitCamMoves": true,
|
||||
"rotationAngle": 180,
|
||||
"elevationAngle": 0,
|
||||
"elevationMin": -89,
|
||||
"elevationMax": 89,
|
||||
"distMax": 30
|
||||
},
|
||||
"world": {
|
||||
"lightIntensity": 0.2,
|
||||
"skyLightIntensity": 0.2,
|
||||
"lightCastShadow": false,
|
||||
"fog": true,
|
||||
"color": 0,
|
||||
"lightPosition": {
|
||||
"x": 10,
|
||||
"y": 5,
|
||||
"z": 0
|
||||
},
|
||||
"lightShadowDarkness": 0.55,
|
||||
"ambientLightColor": 2236996
|
||||
},
|
||||
"preload": [
|
||||
"map|/res/xd-view/meshes/connect4-red-star.png",
|
||||
"map|/res/xd-view/meshes/connect4-red.png",
|
||||
"map|/res/xd-view/meshes/connect4-yellow-star.png",
|
||||
"map|/res/xd-view/meshes/connect4-yellow.png",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell-ring-smoothed.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4-token.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell-foot.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "fiar2d",
|
||||
"title": "2D Classic",
|
||||
"3d": false,
|
||||
"preload": [
|
||||
"image|/res/sprites2d.png"
|
||||
]
|
||||
}
|
||||
],
|
||||
"animateSelfMoves": false,
|
||||
"visuals": {
|
||||
"600x600": [
|
||||
"res/visuals/fiveinarow-600x600-3d.jpg",
|
||||
"res/visuals/fiveinarow-600x600-2d.jpg"
|
||||
]
|
||||
}
|
||||
},
|
||||
"torus4": {
|
||||
"title-en": "Four In A Row View",
|
||||
"module": "fourinarow",
|
||||
"js": [
|
||||
"fiarbase-xd-view.js"
|
||||
],
|
||||
"xdView": true,
|
||||
"css": [
|
||||
"fiarbase.css"
|
||||
],
|
||||
"preferredRatio": 1,
|
||||
"useShowMoves": false,
|
||||
"useNotation": true,
|
||||
"sounds": {
|
||||
"sound1": "sound1",
|
||||
"sound2": "sound2"
|
||||
},
|
||||
"defaultOptions": {
|
||||
"sounds": true,
|
||||
"moves": true,
|
||||
"notation": false
|
||||
},
|
||||
"skins": [
|
||||
{
|
||||
"name": "fiar3d",
|
||||
"title": "3D Classic",
|
||||
"3d": true,
|
||||
"camera": {
|
||||
"radius": 20,
|
||||
"limitCamMoves": true,
|
||||
"rotationAngle": 180,
|
||||
"elevationAngle": 0,
|
||||
"elevationMin": -89,
|
||||
"elevationMax": 89,
|
||||
"distMax": 30
|
||||
},
|
||||
"world": {
|
||||
"lightIntensity": 0.2,
|
||||
"skyLightIntensity": 0.2,
|
||||
"lightCastShadow": false,
|
||||
"fog": true,
|
||||
"color": 0,
|
||||
"lightPosition": {
|
||||
"x": 10,
|
||||
"y": 5,
|
||||
"z": 0
|
||||
},
|
||||
"lightShadowDarkness": 0.55,
|
||||
"ambientLightColor": 2236996
|
||||
},
|
||||
"preload": [
|
||||
"map|/res/xd-view/meshes/connect4-red-star.png",
|
||||
"map|/res/xd-view/meshes/connect4-red.png",
|
||||
"map|/res/xd-view/meshes/connect4-yellow-star.png",
|
||||
"map|/res/xd-view/meshes/connect4-yellow.png",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell-ring-smoothed.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4-token.js",
|
||||
"smoothedfilegeo|0|/res/xd-view/meshes/connect4cell-foot.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "fiar2d",
|
||||
"title": "2D Classic",
|
||||
"3d": false,
|
||||
"preload": [
|
||||
"image|/res/sprites2d.png"
|
||||
]
|
||||
}
|
||||
],
|
||||
"animateSelfMoves": false,
|
||||
"visuals": {
|
||||
"600x600": [
|
||||
"res/visuals/torus4-600x600-3d.jpg",
|
||||
"res/visuals/torus4-600x600-2d.jpg"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var games = {};
|
||||
|
||||
for(var name in mvs.models) {
|
||||
games[name] = {
|
||||
name: name,
|
||||
modelScripts: mvs.models[name].js,
|
||||
config: {
|
||||
status: true,
|
||||
model: mvs.models[name]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(var name in mvs.views) {
|
||||
if(games[name]) {
|
||||
games[name].viewScripts = mvs.views[name].js;
|
||||
games[name].config.view = mvs.views[name];
|
||||
}
|
||||
}
|
||||
|
||||
exports.games = Object.keys(games).map((name)=>{
|
||||
return games[name];
|
||||
});
|
BIN
src/games/fourinarow/res/images/boardwin.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
src/games/fourinarow/res/images/holeleft.png
Normal file
After Width: | Height: | Size: 336 B |
BIN
src/games/fourinarow/res/images/holeright.png
Normal file
After Width: | Height: | Size: 338 B |
BIN
src/games/fourinarow/res/sounds/sound1.mp3
Normal file
BIN
src/games/fourinarow/res/sounds/sound1.ogg
Normal file
BIN
src/games/fourinarow/res/sounds/sound2.mp3
Normal file
BIN
src/games/fourinarow/res/sounds/sound2.ogg
Normal file
BIN
src/games/fourinarow/res/sprites2d.png
Normal file
After Width: | Height: | Size: 71 KiB |
BIN
src/games/fourinarow/res/visuals/fiveinarow-600x600-2d.jpg
Normal file
After Width: | Height: | Size: 74 KiB |
BIN
src/games/fourinarow/res/visuals/fiveinarow-600x600-3d.jpg
Normal file
After Width: | Height: | Size: 67 KiB |
BIN
src/games/fourinarow/res/visuals/fourinarow-600x600-2d.jpg
Normal file
After Width: | Height: | Size: 80 KiB |
BIN
src/games/fourinarow/res/visuals/fourinarow-600x600-3d.jpg
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
src/games/fourinarow/res/visuals/fourinarow-9x6-600x600-2d.jpg
Normal file
After Width: | Height: | Size: 71 KiB |
BIN
src/games/fourinarow/res/visuals/fourinarow-9x6-600x600-3d.jpg
Normal file
After Width: | Height: | Size: 70 KiB |
BIN
src/games/fourinarow/res/visuals/popout-600x600-2d.jpg
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
src/games/fourinarow/res/visuals/popout-600x600-3d.jpg
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
src/games/fourinarow/res/visuals/torus4-600x600-2d.jpg
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
src/games/fourinarow/res/visuals/torus4-600x600-3d.jpg
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
src/games/fourinarow/res/xd-view/meshes/connect4-red-star.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
src/games/fourinarow/res/xd-view/meshes/connect4-red.png
Normal file
After Width: | Height: | Size: 21 KiB |
58
src/games/fourinarow/res/xd-view/meshes/connect4-token.js
Normal file
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
|
||||
"metadata" :
|
||||
{
|
||||
"formatVersion" : 3.1,
|
||||
"generatedBy" : "Blender 2.66 Exporter",
|
||||
"vertices" : 64,
|
||||
"faces" : 92,
|
||||
"normals" : 64,
|
||||
"colors" : 0,
|
||||
"uvs" : [130],
|
||||
"materials" : 1,
|
||||
"morphTargets" : 0,
|
||||
"bones" : 0
|
||||
},
|
||||
|
||||
"scale" : 1.000000,
|
||||
|
||||
"materials" : [ {
|
||||
"DbgColor" : 15658734,
|
||||
"DbgIndex" : 0,
|
||||
"DbgName" : "token-mat",
|
||||
"blending" : "NormalBlending",
|
||||
"colorDiffuse" : [1,1,1],
|
||||
"colorSpecular" : [0.0, 0.0, 0.0],
|
||||
"depthTest" : true,
|
||||
"depthWrite" : true,
|
||||
"mapDiffuse" : "connect4-red.png",
|
||||
"mapDiffuseWrap" : ["repeat", "repeat"],
|
||||
"shading" : "Phong",
|
||||
"specularCoef" : 0,
|
||||
"opacity" : 1.0,
|
||||
"transparent" : false,
|
||||
"vertexColors" : false
|
||||
}],
|
||||
|
||||
"vertices" : [0.0671261,-3.8775e-08,-1,-0.0610531,-4.84523e-08,-1,0.0671261,-0.19509,-0.980785,-0.0610531,-0.19509,-0.980785,0.0671262,-0.382683,-0.92388,-0.0610531,-0.382683,-0.92388,0.0671262,-0.55557,-0.83147,-0.0610531,-0.55557,-0.83147,0.0671262,-0.707107,-0.707107,-0.061053,-0.707107,-0.707107,0.0671262,-0.83147,-0.55557,-0.061053,-0.83147,-0.55557,0.0671262,-0.92388,-0.382683,-0.061053,-0.92388,-0.382683,0.0671262,-0.980785,-0.19509,-0.061053,-0.980785,-0.19509,0.0671262,-1,-3.17865e-08,-0.061053,-1,-3.17865e-08,0.0671262,-0.980785,0.19509,-0.061053,-0.980785,0.19509,0.0671262,-0.92388,0.382683,-0.061053,-0.92388,0.382683,0.0671262,-0.83147,0.55557,-0.061053,-0.83147,0.55557,0.0671262,-0.707107,0.707107,-0.061053,-0.707107,0.707107,0.0671262,-0.55557,0.83147,-0.0610531,-0.55557,0.83147,0.0671262,-0.382683,0.92388,-0.0610531,-0.382683,0.92388,0.0671261,-0.19509,0.980785,-0.0610531,-0.19509,0.980785,0.0671261,3.74489e-07,1,-0.0610531,3.64812e-07,1,0.0671261,0.195091,0.980785,-0.0610531,0.195091,0.980785,0.0671261,0.382684,0.923879,-0.0610531,0.382684,0.923879,0.0671261,0.555571,0.831469,-0.0610531,0.555571,0.831469,0.0671261,0.707107,0.707106,-0.0610531,0.707107,0.707106,0.0671261,0.83147,0.55557,-0.0610532,0.83147,0.55557,0.0671261,0.92388,0.382683,-0.0610532,0.92388,0.382683,0.0671261,0.980785,0.195089,-0.0610532,0.980785,0.195089,0.0671261,1,-1.00931e-06,-0.0610532,1,-1.00931e-06,0.0671261,0.980785,-0.195091,-0.0610532,0.980785,-0.195091,0.0671261,0.923879,-0.382684,-0.0610532,0.923879,-0.382684,0.0671261,0.831469,-0.555571,-0.0610532,0.831469,-0.555571,0.0671261,0.707106,-0.707108,-0.0610531,0.707106,-0.707108,0.0671261,0.555569,-0.83147,-0.0610531,0.555569,-0.83147,0.0671261,0.382682,-0.92388,-0.0610531,0.382682,-0.92388,0.0671261,0.195089,-0.980786,-0.0610531,0.195089,-0.980786],
|
||||
|
||||
"morphTargets" : [],
|
||||
|
||||
"normals" : [0.68569,0,-0.727866,0.68569,-0.142003,-0.713889,-0.68569,-0.142003,-0.713889,-0.68569,0,-0.727866,0.68569,-0.278542,-0.672475,-0.68569,-0.278542,-0.672475,0.68569,-0.40437,-0.605213,-0.68569,-0.40437,-0.605213,0.68569,-0.514664,-0.514664,-0.68569,-0.514664,-0.514664,0.68569,-0.605213,-0.40437,-0.68569,-0.605213,-0.40437,0.68569,-0.672475,-0.278542,-0.68569,-0.672475,-0.278542,0.68569,-0.713889,-0.142003,-0.68569,-0.713889,-0.142003,0.68569,-0.727866,0,-0.68569,-0.727866,0,0.68569,-0.713889,0.142003,-0.68569,-0.713889,0.142003,0.68569,-0.672475,0.278542,-0.68569,-0.672475,0.278542,0.68569,-0.605213,0.40437,-0.68569,-0.605213,0.40437,0.68569,-0.514664,0.514664,-0.68569,-0.514664,0.514664,0.68569,-0.40437,0.605213,-0.68569,-0.40437,0.605213,0.68569,-0.278542,0.672475,-0.68569,-0.278542,0.672475,0.68569,-0.142003,0.713889,-0.68569,-0.142003,0.713889,0.68569,0,0.727866,-0.68569,0,0.727866,0.68569,0.142003,0.713889,-0.68569,0.142003,0.713889,0.68569,0.278542,0.672475,-0.68569,0.278542,0.672475,0.68569,0.40437,0.605213,-0.68569,0.40437,0.605213,0.68569,0.514695,0.514664,-0.68569,0.514664,0.514664,0.68569,0.605213,0.40437,-0.68569,0.605213,0.40437,0.68569,0.672475,0.278542,-0.68569,0.672475,0.278542,0.68569,0.713889,0.142003,-0.68569,0.713889,0.142003,0.68569,0.727866,0,-0.68569,0.727866,0,0.68569,0.713889,-0.142003,-0.68569,0.713889,-0.142003,0.68569,0.672475,-0.278542,-0.68569,0.672475,-0.278542,0.68569,0.605213,-0.40437,-0.68569,0.605213,-0.40437,0.68569,0.514664,-0.514695,-0.68569,0.514664,-0.514695,0.68569,0.40437,-0.605213,-0.68569,0.40437,-0.605213,0.68569,0.278542,-0.672475,-0.68569,0.278542,-0.672475,-0.68569,0.142003,-0.713889,0.68569,0.142003,-0.713889],
|
||||
|
||||
"colors" : [],
|
||||
|
||||
"uvs" : [[0.321306,0.556312,0.30067,0.556312,0.300674,0.484762,0.321311,0.484762,0.280033,0.556312,0.280037,0.484761,0.259397,0.556312,0.2594,0.484761,0.23876,0.556312,0.238763,0.484761,0.218123,0.556312,0.218127,0.484761,0.197486,0.556312,0.19749,0.484761,0.176849,0.556312,0.176854,0.484761,0.156212,0.556312,0.156217,0.48476,0.175768,0.556319,0.196403,0.556318,0.196389,0.484771,0.175754,0.484772,0.217039,0.556318,0.217024,0.484771,0.237674,0.556317,0.23766,0.48477,0.25831,0.556317,0.258295,0.48477,0.278945,0.556316,0.278931,0.484769,0.29958,0.556316,0.299566,0.484769,0.320216,0.556315,0.320202,0.484768,0.340851,0.556315,0.340837,0.484768,0.361486,0.556314,0.361473,0.484767,0.382122,0.556314,0.382109,0.484767,0.402757,0.556314,0.402745,0.484766,0.423392,0.556313,0.423381,0.484766,0.444027,0.556313,0.444017,0.484765,0.464663,0.556313,0.464653,0.484765,0.485298,0.556312,0.485289,0.484764,0.486394,0.556312,0.486402,0.484764,0.465759,0.556312,0.465766,0.484764,0.445123,0.556312,0.445129,0.484763,0.424487,0.556312,0.424493,0.484763,0.403851,0.556312,0.403857,0.484763,0.383215,0.556312,0.38322,0.484762,0.362579,0.556312,0.362583,0.484762,0.58587,0.933634,0.50162,0.942251,0.417308,0.934266,0.66682,0.908747,0.336174,0.909986,0.74136,0.868545,0.261334,0.870344,0.806624,0.814573,0.195667,0.816862,0.860105,0.748906,0.141695,0.751598,0.899747,0.674067,0.101493,0.67706,0.924027,0.592933,0.076605,0.596109,0.932012,0.50862,0.067988,0.51186,0.923395,0.42437,0.075973,0.427548,0.898507,0.34342,0.100253,0.346413,0.858305,0.26888,0.139895,0.271574,0.804333,0.203616,0.193376,0.205907,0.738667,0.150136,0.258641,0.151935,0.663828,0.110494,0.333181,0.111733,0.582693,0.086214,0.414131,0.086846,0.498381,0.078229,0.341942,0.556312,0.341947,0.484762,0.596072,0.932365,0.512372,0.943046,0.428196,0.937192,0.346781,0.91503,0.676079,0.905561,0.271254,0.877409,0.74932,0.863663,0.204517,0.825777,0.812979,0.808281,0.149136,0.762118,0.864611,0.741545,0.107238,0.688878,0.90223,0.666019,0.080434,0.60887,0.924393,0.584603,0.069753,0.52517,0.930246,0.500429,0.075607,0.440995,0.919566,0.41673,0.09777,0.359578,0.892762,0.336722,0.135391,0.284051,0.850864,0.263482,0.187023,0.217315,0.795483,0.199822,0.250682,0.161934,0.728747,0.14819,0.65322,0.110569,0.323923,0.120036,0.571805,0.088406,0.403932,0.093232,0.487631,0.082552]],
|
||||
|
||||
"faces" : [43,0,2,3,1,0,0,1,2,3,0,1,2,3,43,2,4,5,3,0,1,4,5,2,1,4,5,2,43,4,6,7,5,0,4,6,7,5,4,6,7,5,43,6,8,9,7,0,6,8,9,7,6,8,9,7,43,8,10,11,9,0,8,10,11,9,8,10,11,9,43,10,12,13,11,0,10,12,13,11,10,12,13,11,43,12,14,15,13,0,12,14,15,13,12,14,15,13,43,14,16,17,15,0,14,16,17,15,14,16,17,15,43,16,18,19,17,0,18,19,20,21,16,18,19,17,43,18,20,21,19,0,19,22,23,20,18,20,21,19,43,20,22,23,21,0,22,24,25,23,20,22,23,21,43,22,24,25,23,0,24,26,27,25,22,24,25,23,43,24,26,27,25,0,26,28,29,27,24,26,27,25,43,26,28,29,27,0,28,30,31,29,26,28,29,27,43,28,30,31,29,0,30,32,33,31,28,30,31,29,43,30,32,33,31,0,32,34,35,33,30,32,33,31,43,32,34,35,33,0,34,36,37,35,32,34,35,33,43,34,36,37,35,0,36,38,39,37,34,36,37,35,43,36,38,39,37,0,38,40,41,39,36,38,39,37,43,38,40,41,39,0,40,42,43,41,38,40,41,39,43,40,42,43,41,0,42,44,45,43,40,42,43,41,43,42,44,45,43,0,44,46,47,45,42,44,45,43,43,44,46,47,45,0,46,48,49,47,44,46,47,45,43,46,48,49,47,0,48,50,51,49,46,48,49,47,43,48,50,51,49,0,50,52,53,51,48,50,51,49,43,50,52,53,51,0,52,54,55,53,50,52,53,51,43,52,54,55,53,0,54,56,57,55,52,54,55,53,43,54,56,57,55,0,56,58,59,57,54,56,57,55,43,56,58,59,57,0,58,60,61,59,56,58,59,57,43,58,60,61,59,0,60,62,63,61,58,60,61,59,42,47,49,51,0,64,65,66,47,49,51,42,45,47,51,0,67,64,66,45,47,51,42,45,51,53,0,67,66,68,45,51,53,42,43,45,53,0,69,67,68,43,45,53,42,43,53,55,0,69,68,70,43,53,55,42,41,43,55,0,71,69,70,41,43,55,42,41,55,57,0,71,70,72,41,55,57,42,39,41,57,0,73,71,72,39,41,57,42,39,57,59,0,73,72,74,39,57,59,42,37,39,59,0,75,73,74,37,39,59,42,37,59,61,0,75,74,76,37,59,61,42,35,37,61,0,77,75,76,35,37,61,42,35,61,63,0,77,76,78,35,61,62,42,33,35,63,0,79,77,78,33,35,62,42,33,63,1,0,79,78,80,33,62,3,42,31,33,1,0,81,79,80,31,33,3,42,3,31,1,0,82,81,80,2,31,3,42,3,29,31,0,82,83,81,2,29,31,42,3,5,29,0,82,84,83,2,5,29,42,5,27,29,0,84,85,83,5,27,29,42,5,7,27,0,84,86,85,5,7,27,42,7,25,27,0,86,87,85,7,25,27,42,7,9,25,0,86,88,87,7,9,25,42,9,23,25,0,88,89,87,9,23,25,42,9,11,23,0,88,90,89,9,11,23,42,11,21,23,0,90,91,89,11,21,23,42,11,13,21,0,90,92,91,11,13,21,42,13,19,21,0,92,93,91,13,19,21,42,13,15,19,0,92,94,93,13,15,19,42,15,17,19,0,94,95,93,15,17,19,43,62,0,1,63,0,96,0,3,97,63,0,3,62,43,60,62,63,61,0,62,96,97,63,60,63,62,61,42,50,48,46,0,98,99,100,50,48,46,42,50,46,44,0,98,100,101,50,46,44,42,52,50,44,0,102,98,101,52,50,44,42,52,44,42,0,102,101,103,52,44,42,42,54,52,42,0,104,102,103,54,52,42,42,54,42,40,0,104,103,105,54,42,40,42,56,54,40,0,106,104,105,56,54,40,42,56,40,38,0,106,105,107,56,40,38,42,58,56,38,0,108,106,107,58,56,38,42,58,38,36,0,108,107,109,58,38,36,42,60,58,36,0,110,108,109,60,58,36,42,60,36,34,0,110,109,111,60,36,34,42,62,60,34,0,112,110,111,63,60,34,42,62,34,32,0,112,111,113,63,34,32,42,0,62,32,0,114,112,113,0,63,32,42,0,32,30,0,114,113,115,0,32,30,42,0,30,2,0,114,115,116,0,30,1,42,30,28,2,0,115,117,116,30,28,1,42,28,4,2,0,117,118,116,28,4,1,42,28,26,4,0,117,119,118,28,26,4,42,26,6,4,0,119,120,118,26,6,4,42,26,24,6,0,119,121,120,26,24,6,42,24,8,6,0,121,122,120,24,8,6,42,24,22,8,0,121,123,122,24,22,8,42,22,10,8,0,123,124,122,22,10,8,42,22,12,10,0,123,125,124,22,12,10,42,22,20,12,0,123,126,125,22,20,12,42,20,14,12,0,126,127,125,20,14,12,42,20,18,14,0,126,128,127,20,18,14,42,18,16,14,0,128,129,127,18,16,14],
|
||||
|
||||
"bones" : [],
|
||||
|
||||
"skinIndices" : [],
|
||||
|
||||
"skinWeights" : [],
|
||||
|
||||
"animation" : {}
|
||||
|
||||
|
||||
}
|
BIN
src/games/fourinarow/res/xd-view/meshes/connect4-yellow-star.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
src/games/fourinarow/res/xd-view/meshes/connect4-yellow.png
Normal file
After Width: | Height: | Size: 29 KiB |
56
src/games/fourinarow/res/xd-view/meshes/connect4cell-foot.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
|
||||
"metadata" :
|
||||
{
|
||||
"formatVersion" : 3.1,
|
||||
"generatedBy" : "Blender 2.66 Exporter",
|
||||
"vertices" : 34,
|
||||
"faces" : 32,
|
||||
"normals" : 34,
|
||||
"colors" : 0,
|
||||
"uvs" : [],
|
||||
"materials" : 1,
|
||||
"morphTargets" : 0,
|
||||
"bones" : 0
|
||||
},
|
||||
|
||||
"scale" : 1.000000,
|
||||
|
||||
"materials" : [ {
|
||||
"DbgColor" : 15658734,
|
||||
"DbgIndex" : 0,
|
||||
"DbgName" : "mat-cell",
|
||||
"blending" : "NormalBlending",
|
||||
"colorDiffuse" : [0.0, 0.0, 0.0],
|
||||
"colorSpecular" : [0.0, 0.0, 0.0],
|
||||
"depthTest" : true,
|
||||
"depthWrite" : true,
|
||||
"shading" : "Phong",
|
||||
"specularCoef" : 32,
|
||||
"opacity" : 1.0,
|
||||
"transparent" : false,
|
||||
"vertexColors" : false
|
||||
}],
|
||||
|
||||
"vertices" : [-0.293,-1,0.1,-0.293,-1,-0.1,0.293,-1,-0.1,0.293,-1,0.1,-0.293,1,0.1,-0.293,1,-0.1,0.293,1,-0.1,0.293,1,0.1,-0.337803,-1.15337,0.1,-0.337803,-1.15337,-0.0999999,0.337803,-1.15337,-0.0999999,0.337803,-1.15337,0.1,0,1,-0.1,0,-1,-0.1,0,1,0.1,0,-1,0.1,2.54201e-09,-1.80263,-0.0999999,2.54201e-09,-1.80263,0.1,-1.47078,-2.15337,0.043954,-1.47078,-2.15337,-0.0439538,-1.3275,-2.15337,-0.0999999,-1.3275,-2.15337,0.1,1.47078,-2.15337,-0.0439538,1.47078,-2.15337,0.043954,1.3275,-2.15337,-0.0999999,1.3275,-2.15337,0.1,0.739025,-1.65337,-0.0928433,0.66375,-1.91395,-0.0999999,0.739025,-1.65337,0.0928435,0.66375,-1.91395,0.1,-0.66375,-1.91395,-0.0999999,-0.739025,-1.65337,-0.0928433,-0.739025,-1.65337,0.0928435,-0.66375,-1.91395,0.1],
|
||||
|
||||
"morphTargets" : [],
|
||||
|
||||
"normals" : [-0.665365,0.095187,-0.74041,-0.665365,0.095187,0.74041,-0.577349,0.577349,0.577349,-0.577349,0.577349,-0.577349,0,0.707083,-0.707083,0.577349,0.577349,-0.577349,0.665365,0.095187,-0.74041,0,0,-1,0.577349,0.577349,0.577349,0.665365,0.095187,0.74041,0,0,1,0,0.707083,0.707083,0.583209,0.303049,0.753655,0.583209,0.303049,-0.753655,-0.136814,-0.639302,-0.756645,0.472427,0.511063,-0.71807,0.768609,-0.391552,-0.505844,-0.068941,-0.660695,-0.747459,-0.583209,0.303049,-0.753655,-0.583209,0.303049,0.753655,0,-0.664449,-0.747307,0,-0.664449,0.747307,-0.472427,0.511063,-0.71807,0.136814,-0.639302,-0.756645,0.068941,-0.660695,-0.747459,-0.768609,-0.391552,-0.505844,-0.768609,-0.391552,0.505844,0.068941,-0.660695,0.747459,0.136814,-0.639302,0.756645,-0.472427,0.511063,0.71807,-0.068941,-0.660695,0.747459,0.768609,-0.391552,0.505844,0.472427,0.511063,0.71807,-0.136814,-0.639302,0.756645],
|
||||
|
||||
"colors" : [],
|
||||
|
||||
"uvs" : [],
|
||||
|
||||
"faces" : [35,1,0,4,5,0,0,1,2,3,35,12,6,2,13,0,4,5,6,7,35,6,7,3,2,0,5,8,9,6,35,0,15,14,4,0,1,10,11,2,35,2,3,11,10,0,6,9,12,13,35,14,12,5,4,0,11,4,3,2,35,27,26,22,24,0,14,15,16,17,35,0,1,9,8,0,1,0,18,19,35,13,2,10,16,0,7,6,13,20,35,15,0,8,17,0,10,1,19,21,35,5,12,13,1,0,3,4,7,0,35,7,14,15,3,0,8,11,10,9,35,7,6,12,14,0,8,5,4,11,35,31,30,20,19,0,22,23,24,25,35,1,13,16,9,0,0,7,20,18,35,3,15,17,11,0,9,10,21,12,35,18,19,20,21,0,26,25,24,27,35,33,32,18,21,0,28,29,26,27,35,30,33,21,20,0,23,28,27,24,35,32,31,19,18,0,29,22,25,26,35,25,24,22,23,0,30,17,16,31,35,26,28,23,22,0,15,32,31,16,35,29,27,24,25,0,33,14,17,30,35,28,29,25,23,0,32,33,30,31,35,16,10,26,27,0,20,13,15,14,35,10,11,28,26,0,13,12,32,15,35,17,16,27,29,0,21,20,14,33,35,11,17,29,28,0,12,21,33,32,35,9,16,30,31,0,18,20,23,22,35,17,8,32,33,0,21,19,29,28,35,16,17,33,30,0,20,21,28,23,35,8,9,31,32,0,19,18,22,29],
|
||||
|
||||
"bones" : [],
|
||||
|
||||
"skinIndices" : [],
|
||||
|
||||
"skinWeights" : [],
|
||||
|
||||
"animation" : {}
|
||||
|
||||
|
||||
}
|
56
src/games/fourinarow/res/xd-view/meshes/connect4cell.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
|
||||
"metadata" :
|
||||
{
|
||||
"formatVersion" : 3.1,
|
||||
"generatedBy" : "Blender 2.66 Exporter",
|
||||
"vertices" : 72,
|
||||
"faces" : 100,
|
||||
"normals" : 72,
|
||||
"colors" : 0,
|
||||
"uvs" : [],
|
||||
"materials" : 1,
|
||||
"morphTargets" : 0,
|
||||
"bones" : 0
|
||||
},
|
||||
|
||||
"scale" : 1.000000,
|
||||
|
||||
"materials" : [ {
|
||||
"DbgColor" : 15658734,
|
||||
"DbgIndex" : 0,
|
||||
"DbgName" : "mat-cell",
|
||||
"blending" : "NormalBlending",
|
||||
"colorDiffuse" : [0.0, 0.28755074739456177, 0.800000011920929],
|
||||
"colorSpecular" : [0.8626540899276733, 0.8626540899276733, 0.8626540899276733],
|
||||
"depthTest" : true,
|
||||
"depthWrite" : true,
|
||||
"shading" : "Phong",
|
||||
"specularCoef" : 32,
|
||||
"opacity" : 1.0,
|
||||
"transparent" : false,
|
||||
"vertexColors" : false
|
||||
}],
|
||||
|
||||
"vertices" : [-0.1,1,1,-0.1,1,-1,-0.1,0.813121,-8.20692e-07,-0.1,0.797497,-0.158633,-0.1,0.751226,-0.311169,-0.1,0.797497,0.158631,-0.1,0.751226,0.311167,-0.1,0.676086,0.451745,-0.1,0.574964,0.574963,-0.1,0.451746,0.676085,-0.1,0.311168,0.751226,-0.1,0.158632,0.797497,-0.0999999,-1,1,-0.1,0.676085,-0.451747,-0.1,2.96716e-07,0.813121,-0.1,-0.158632,0.797497,-0.1,-0.311168,0.751226,-0.1,-0.451746,0.676086,-0.1,-0.574963,0.574963,-0.0999999,-0.676086,0.451746,-0.0999999,-0.751226,0.311168,-0.0999999,-0.797497,0.158632,-0.0999999,-1,-1,-0.1,0.574963,-0.574964,-0.0999999,-0.813121,-2.58463e-08,-0.0999999,-0.797497,-0.158632,-0.0999999,-0.751226,-0.311168,-0.0999999,-0.676086,-0.451746,-0.1,-0.574963,-0.574963,-0.1,-0.451746,-0.676085,-0.1,-0.311168,-0.751226,-0.1,-0.158632,-0.797497,-0.1,0.451745,-0.676086,-0.1,-3.93175e-08,-0.813121,-0.1,0.158631,-0.797497,-0.1,0.311167,-0.751226,-7.45058e-08,1,-1,7.45058e-08,-1,-0.999999,7.45058e-08,-0.999999,1,-7.45058e-08,1,1,0,3.04266e-07,0.813121,1.11759e-08,-0.158632,0.797497,2.23517e-08,-0.311168,0.751226,-1.11759e-08,0.158632,0.797497,-2.23517e-08,0.311168,0.751226,-3.35276e-08,0.451746,0.676085,-4.47035e-08,0.574964,0.574963,-5.21541e-08,0.676086,0.451745,-5.58794e-08,0.751226,0.311167,-5.96046e-08,0.797497,0.158631,3.35276e-08,-0.451746,0.676086,-5.96046e-08,0.813121,-8.20692e-07,-5.96046e-08,0.797497,-0.158633,-5.58794e-08,0.751226,-0.311169,-5.21541e-08,0.676085,-0.451747,-4.47035e-08,0.574963,-0.574964,-3.35276e-08,0.451745,-0.676086,-2.23517e-08,0.311167,-0.751226,-1.11759e-08,0.158631,-0.797497,4.47035e-08,-0.574963,0.574963,0,-3.17678e-08,-0.813121,1.11759e-08,-0.158632,-0.797497,2.23517e-08,-0.311168,-0.751226,3.35276e-08,-0.451746,-0.676085,4.47035e-08,-0.574963,-0.574963,5.21541e-08,-0.676086,-0.451746,5.58794e-08,-0.751226,-0.311168,5.96046e-08,-0.797497,-0.158632,5.21541e-08,-0.676086,0.451746,5.96046e-08,-0.813121,-2.58463e-08,5.96046e-08,-0.797497,0.158632,5.58794e-08,-0.751226,0.311168],
|
||||
|
||||
"morphTargets" : [],
|
||||
|
||||
"normals" : [-0.72982,-0.261605,0.63155,-0.72982,-0.379772,0.568377,-0.577349,0.577319,-0.577349,-0.72982,-0.133335,0.670461,-0.72982,0,0.683584,-0.577319,-0.577349,-0.577349,-0.72982,0.133335,0.670461,-0.72982,-0.483383,0.483383,-0.72982,0.261605,0.63155,-0.72982,0.379772,0.568377,-0.72982,0.483383,0.483383,-0.72982,0.568377,0.379772,-0.72982,0.63155,0.261605,-0.72982,0.670461,0.133335,-0.72982,0.683584,0,-0.577349,-0.577349,0.577319,-0.72982,0.670461,-0.133335,-0.72982,-0.568377,0.379772,-0.72982,0.63155,-0.261605,-0.72982,0.568377,-0.379772,-0.72982,0.483383,-0.483383,-0.72982,0.379772,-0.568377,-0.72982,0.261605,-0.63155,-0.72982,0.133335,-0.670461,-0.72982,0,-0.683584,-0.577349,0.577319,0.577349,-0.72982,-0.133335,-0.670461,-0.72982,-0.63155,0.261605,-0.72982,-0.261605,-0.63155,-0.72982,-0.379772,-0.568377,-0.72982,-0.483383,-0.483383,-0.72982,-0.568377,-0.379772,-0.72982,-0.63155,-0.261605,-0.72982,-0.670461,-0.133335,-0.72982,-0.683584,0,-0.72982,-0.670461,0.133366,0.72982,0.63155,-0.261605,0.72982,0.568377,-0.379772,0.577349,-0.577319,0.577349,0.72982,0.670461,-0.133335,0.72982,0.683584,0,0.577349,-0.577349,-0.577319,0.72982,0.670461,0.133335,0.72982,0.483383,-0.483383,0.72982,0.63155,0.261605,0.72982,0.568377,0.379772,0.72982,0.483383,0.483383,0.72982,0.379772,0.568377,0.72982,0.261605,0.63155,0.72982,0.133335,0.670461,0.72982,0,0.683584,0.577349,0.577349,-0.577319,0.72982,-0.133335,0.670461,0.72982,0.379772,-0.568377,0.72982,-0.261605,0.63155,0.72982,-0.379772,0.568377,0.72982,-0.483383,0.483383,0.72982,-0.568377,0.379772,0.72982,-0.63155,0.261605,0.72982,-0.670461,0.133366,0.72982,-0.683584,0,0.577319,0.577349,0.577349,0.72982,-0.670461,-0.133335,0.72982,0.261605,-0.63155,0.72982,-0.63155,-0.261605,0.72982,-0.568377,-0.379772,0.72982,-0.483383,-0.483383,0.72982,-0.379772,-0.568377,0.72982,-0.261605,-0.63155,0.72982,-0.133335,-0.670461,0.72982,0,-0.683584,0.72982,0.133335,-0.670461],
|
||||
|
||||
"colors" : [],
|
||||
|
||||
"uvs" : [],
|
||||
|
||||
"faces" : [34,35,32,1,0,0,1,2,34,1,34,35,0,2,3,0,34,1,33,34,0,2,4,3,35,1,22,31,33,0,2,5,6,4,34,32,23,1,0,1,7,2,34,22,30,31,0,5,8,6,34,22,29,30,0,5,9,8,34,22,28,29,0,5,10,9,34,22,27,28,0,5,11,10,34,22,26,27,0,5,12,11,34,22,25,26,0,5,13,12,34,22,24,25,0,5,14,13,35,22,12,21,24,0,5,15,16,14,34,23,13,1,0,7,17,2,34,12,20,21,0,15,18,16,34,12,19,20,0,15,19,18,34,12,18,19,0,15,20,19,34,12,17,18,0,15,21,20,34,12,16,17,0,15,22,21,34,12,15,16,0,15,23,22,34,12,14,15,0,15,24,23,35,12,0,11,14,0,15,25,26,24,34,13,4,1,0,17,27,2,34,0,10,11,0,25,28,26,34,0,9,10,0,25,29,28,34,0,8,9,0,25,30,29,34,0,7,8,0,25,31,30,34,0,6,7,0,25,32,31,34,0,5,6,0,25,33,32,35,0,1,2,5,0,25,2,34,33,34,3,2,1,0,35,34,2,34,4,3,1,0,27,35,2,34,71,68,38,0,36,37,38,34,38,70,71,0,38,39,36,34,38,69,70,0,38,40,39,35,38,37,67,69,0,38,41,42,40,34,68,59,38,0,37,43,38,34,37,66,67,0,41,44,42,34,37,65,66,0,41,45,44,34,37,64,65,0,41,46,45,34,37,63,64,0,41,47,46,34,37,62,63,0,41,48,47,34,37,61,62,0,41,49,48,34,37,60,61,0,41,50,49,35,37,36,58,60,0,41,51,52,50,34,59,50,38,0,43,53,38,34,36,57,58,0,51,54,52,34,36,56,57,0,51,55,54,34,36,55,56,0,51,56,55,34,36,54,55,0,51,57,56,34,36,53,54,0,51,58,57,34,36,52,53,0,51,59,58,34,36,51,52,0,51,60,59,35,36,39,49,51,0,51,61,62,60,34,50,42,38,0,53,63,38,34,39,48,49,0,61,64,62,34,39,47,48,0,61,65,64,34,39,46,47,0,61,66,65,34,39,45,46,0,61,67,66,34,39,44,45,0,61,68,67,34,39,43,44,0,61,69,68,35,39,38,40,43,0,61,38,70,69,34,41,40,38,0,71,70,38,34,42,41,38,0,63,71,38,35,37,38,12,22,0,41,38,15,5,35,0,12,38,39,0,25,15,38,61,35,0,39,36,1,0,25,61,51,2,35,22,1,36,37,0,5,2,51,41,35,31,61,60,33,0,6,49,50,4,35,30,62,61,31,0,8,48,49,6,35,29,63,62,30,0,9,47,48,8,35,28,64,63,29,0,10,46,47,9,35,27,65,64,28,0,11,45,46,10,35,26,66,65,27,0,12,44,45,11,35,25,67,66,26,0,13,42,44,12,35,24,69,67,25,0,14,40,42,13,35,21,70,69,24,0,16,39,40,14,35,20,71,70,21,0,18,36,39,16,35,19,68,71,20,0,19,37,36,18,35,18,59,68,19,0,20,43,37,19,35,17,50,59,18,0,21,53,43,20,35,16,42,50,17,0,22,63,53,21,35,15,41,42,16,0,23,71,63,22,35,14,40,41,15,0,24,70,71,23,35,11,43,40,14,0,26,69,70,24,35,10,44,43,11,0,28,68,69,26,35,9,45,44,10,0,29,67,68,28,35,8,46,45,9,0,30,66,67,29,35,7,47,46,8,0,31,65,66,30,35,6,48,47,7,0,32,64,65,31,35,5,49,48,6,0,33,62,64,32,35,2,51,49,5,0,34,60,62,33,35,3,52,51,2,0,35,59,60,34,35,4,53,52,3,0,27,58,59,35,35,13,54,53,4,0,17,57,58,27,35,23,55,54,13,0,7,56,57,17,35,32,56,55,23,0,1,55,56,7,35,35,57,56,32,0,0,54,55,1,35,58,34,33,60,0,52,3,4,50,35,34,58,57,35,0,3,52,54,0],
|
||||
|
||||
"bones" : [],
|
||||
|
||||
"skinIndices" : [],
|
||||
|
||||
"skinWeights" : [],
|
||||
|
||||
"animation" : {}
|
||||
|
||||
|
||||
}
|
73
src/games/fourinarow/res/xd-view/meshes/stade-screen.js
Normal file
|
@ -0,0 +1,73 @@
|
|||
{
|
||||
|
||||
"metadata" :
|
||||
{
|
||||
"formatVersion" : 3.1,
|
||||
"generatedBy" : "Blender 2.66 Exporter",
|
||||
"vertices" : 16,
|
||||
"faces" : 9,
|
||||
"normals" : 1,
|
||||
"colors" : 0,
|
||||
"uvs" : [5],
|
||||
"materials" : 2,
|
||||
"morphTargets" : 0,
|
||||
"bones" : 0
|
||||
},
|
||||
|
||||
"scale" : 1.000000,
|
||||
|
||||
"materials" : [ {
|
||||
"DbgColor" : 15658734,
|
||||
"DbgIndex" : 0,
|
||||
"DbgName" : "mat.screen.frame",
|
||||
"blending" : "NormalBlending",
|
||||
"colorDiffuse" : [0.009773542877637487, 0.009773542877637487, 0.009773542877637487],
|
||||
"colorSpecular" : [0.5544217228889465, 0.5544217228889465, 0.5544217228889465],
|
||||
"depthTest" : true,
|
||||
"depthWrite" : true,
|
||||
"shading" : "Lambert",
|
||||
"specularCoef" : 50,
|
||||
"opacity" : 1.0,
|
||||
"transparent" : false,
|
||||
"vertexColors" : false
|
||||
},
|
||||
|
||||
{
|
||||
"DbgColor" : 15597568,
|
||||
"DbgIndex" : 1,
|
||||
"DbgName" : "mat.screen",
|
||||
"blending" : "NormalBlending",
|
||||
"colorDiffuse" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865],
|
||||
"colorSpecular" : [0.2541455030441284, 0.333633154630661, 0.5],
|
||||
"depthTest" : true,
|
||||
"depthWrite" : true,
|
||||
"mapDiffuseWrap" : ["repeat", "repeat"],
|
||||
"shading" : "Lambert",
|
||||
"specularCoef" : 50,
|
||||
"opacity" : 1.0,
|
||||
"transparent" : false,
|
||||
"vertexColors" : false
|
||||
}],
|
||||
|
||||
"vertices" : [-1.06636,-0.799769,0.0284454,1.06636,-0.799769,0.0284454,-1.06636,0.799769,0.0284453,1.06636,0.799769,0.0284453,1.56636,-0.799769,0.0284454,1.56636,0.799769,0.0284453,-1.56636,-0.799769,0.0284454,-1.56636,0.799769,0.0284453,-1.06636,0.899769,0.0284453,1.06636,0.899769,0.0284453,1.56636,0.899769,0.0284453,-1.56636,0.899769,0.0284453,-1.06636,-0.899769,0.0284454,1.06636,-0.899769,0.0284454,1.56636,-0.899769,0.0284454,-1.56636,-0.899769,0.0284454],
|
||||
|
||||
"morphTargets" : [],
|
||||
|
||||
"normals" : [0,0,1],
|
||||
|
||||
"colors" : [],
|
||||
|
||||
"uvs" : [[0,0,8.7e-05,8.7e-05,0.999956,8.7e-05,0.999956,0.999913,8.7e-05,0.999913]],
|
||||
|
||||
"faces" : [43,4,1,13,14,0,0,0,0,0,0,0,0,0,43,0,6,15,12,0,0,0,0,0,0,0,0,0,43,0,1,3,2,1,1,2,3,4,0,0,0,0,43,1,0,12,13,0,0,0,0,0,0,0,0,0,43,3,5,10,9,0,0,0,0,0,0,0,0,0,43,3,1,4,5,0,0,0,0,0,0,0,0,0,43,0,2,7,6,0,0,0,0,0,0,0,0,0,43,7,2,8,11,0,0,0,0,0,0,0,0,0,43,2,3,9,8,0,0,0,0,0,0,0,0,0],
|
||||
|
||||
"bones" : [],
|
||||
|
||||
"skinIndices" : [],
|
||||
|
||||
"skinWeights" : [],
|
||||
|
||||
"animation" : {}
|
||||
|
||||
|
||||
}
|
33
src/games/fourinarow/rules-fr.html
Normal file
|
@ -0,0 +1,33 @@
|
|||
<style type='text/css'>
|
||||
img.imgfit {
|
||||
width: auto !important;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>Chaque joueur joue un jeton par tour, le premier qui aligne 4 jetons de sa couleur dans n'importe quelle direction gagne la partie.</p>
|
||||
|
||||
<img class="imgfit" src="{GAME}/res/images/boardwin.jpg" style=""/>
|
||||
|
||||
<h2>Variantes</h2>
|
||||
|
||||
<p><b>Popout</b>: à son tour le joueur peut décider de ne pas insérer un jeton mais à la place de retirer un des siens si celui-ci est en bas d'une colonne. Les autres jetons descendront alors tous d'une rangée.</p>
|
||||
|
||||
<p><b>5 in a row</b>: mêmes règles mais il s'agit d'aligner 5 jetons. Au départ le plateau n'est pas vide, les 2 colonnes de droite et de gauche sont remplies de jetons aux couleurs alternées.</p>
|
||||
|
||||
<p><b>Torus</b>: dans ce jeu le plateau est replié sur lui même de sorte que les cases de droite deviennent adjacentes aux cases de gauches.</p>
|
||||
|
||||
<h2>Versions disponibles</h2>
|
||||
|
||||
<ul>
|
||||
<li>4 in row, plateau 7x6</li>
|
||||
<li>4 in row, plateau 7x6, popout</li>
|
||||
<li>4 in row, plateau 9x6</li>
|
||||
<li>5 in row, plateau 9x6</li>
|
||||
<li>Torus 4, plateau cylindrinque 9x6</li>
|
||||
</ul>
|
33
src/games/fourinarow/rules.html
Normal file
|
@ -0,0 +1,33 @@
|
|||
<style type='text/css'>
|
||||
img.imgfit {
|
||||
width: auto !important;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>Each player plays one piece per turn, the first player to align 4 pieces in any direction wins the game.</p>
|
||||
|
||||
<img class="imgfit" src="{GAME}/res/images/boardwin.jpg" style=""/>
|
||||
|
||||
<h2>Variants</h2>
|
||||
|
||||
<p><b>Popout</b>: at your turn, you have the possibility to not add a token but to remove one of yours at the bottom of a column. All the upper tokens will then fall down one row.</p>
|
||||
|
||||
<p><b>5 in a row</b>: same rules apply, but you need to align 5 instead of 4 pieces. The initial board is not empty, both left and right columns are filled with alternated colors.</p>
|
||||
|
||||
<p><b>Torus</b>: in this game, the board is curved like a cylinder so that left and right cells become adjacent</p>
|
||||
|
||||
<h2>Available games</h2>
|
||||
|
||||
<ul>
|
||||
<li>4 in row, 7x6 board</li>
|
||||
<li>4 in row, 7x6 board, popout</li>
|
||||
<li>4 in row, 9x6 board</li>
|
||||
<li>5 in row, 9x6 board</li>
|
||||
<li>Torus 4, 9x6 cylinder board</li>
|
||||
</ul>
|