added hunt module

This commit is contained in:
mig 2017-04-08 23:49:21 +02:00
parent b9469a813e
commit 17f87c1c65
153 changed files with 6516 additions and 0 deletions

View file

@ -0,0 +1,3 @@
<p>TODO: credit people, countries, tribes, ...</p>
<p>Jocly development: Michel gutierrez (@<a target="_blank" href="http://twitter.com/_mig_">_mig_</a>).</p>
<p>Graphic design: Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>).</p>

View file

@ -0,0 +1,2 @@
<p>TODO: game description with images, references, ...</p>

View file

@ -0,0 +1,211 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
Model.Game.InitGame = function() {
var $this=this;
this.HuntInitGame();
Object.assign(this.g.huntOptions,{
compulsaryCatch: true,
catchLongestLine: false,
multipleCatch: false,
});
Object.assign(this.g.huntEval,{
});
function Connect(pos0,pos1,dir0,dir1) {
$this.g.Graph[pos0][dir0]=pos1;
$this.g.Graph[pos1][dir1]=pos0;
}
var ratio=(2*5.3)/3.8;
var a=3.8*ratio, b=1.7*ratio, c=0.6*ratio, d=5, e=0.3;
var alpha=Math.atan(d/a);
var beta=Math.atan(Math.tan(alpha)/3);
//considering a 6x6 grid
var rectHeight=2;
var rectWidth=6;
var bottomLineY=5;
var topPoint=[0,rectWidth/2];
var bottomP0=[bottomLineY,0];
var bottomP1=[bottomLineY,rectWidth/3];
var bottomP2=[bottomLineY,2*rectWidth/3];
var bottomP3=[bottomLineY,rectWidth];
function InstersectLine(p1,p2,line){
var a=(p1[1]-p2[1])/(p1[0]-p2[0]);
var b=p1[1]-a*p1[0];
return [line,a*line+b];
}
var points=[];
points.push(topPoint);
points.push([2,0.5]);
points.push(InstersectLine(topPoint,bottomP0,2));
points.push(InstersectLine(topPoint,bottomP1,2));
points.push(InstersectLine(topPoint,bottomP2,2));
points.push(InstersectLine(topPoint,bottomP3,2));
points.push([2,rectWidth-0.5]);
points.push([3,0]);
points.push(InstersectLine(topPoint,bottomP0,3));
points.push(InstersectLine(topPoint,bottomP1,3));
points.push(InstersectLine(topPoint,bottomP2,3));
points.push(InstersectLine(topPoint,bottomP3,3));
points.push([3,rectWidth]);
points.push([4,-0.5]);
points.push(InstersectLine(topPoint,bottomP0,4));
points.push(InstersectLine(topPoint,bottomP1,4));
points.push(InstersectLine(topPoint,bottomP2,4));
points.push(InstersectLine(topPoint,bottomP3,4));
points.push([4,rectWidth+0.5]);
points.push(bottomP0);
points.push(bottomP1);
points.push(bottomP2);
points.push(bottomP3);
/* var points=[
[0,d],
[a,0],
[a,2*d],
[b,d-b*Math.tan(alpha)],
[b+c,d-(b+c)*Math.tan(alpha)],
[b+2*c,d-(b+2*c)*Math.tan(alpha)],
[b,d+b*Math.tan(alpha)],
[b+c,d+(b+c)*Math.tan(alpha)],
[b+2*c,d+(b+2*c)*Math.tan(alpha)],
[b,d-b*Math.sin(beta)],
[b+c,d-(b+c)*Math.sin(beta)],
[b+2*c,d-(b+2*c)*Math.sin(beta)],
[b,d+b*Math.sin(beta)],
[b+c,d+(b+c)*Math.sin(beta)],
[b+2*c,d+(b+2*c)*Math.sin(beta)],
[b,-e],
[b+c,-e],
[b+2*c,-e],
[b,2*d+e],
[b+c,2*d+e],
[b+2*c,2*d+e],
[a,d-a*Math.tan(beta)],
[a,d+a*Math.tan(beta)],
];*/
for(var i in points) {
var point=points[i];
this.g.Graph.push([]);
this.g.RC.push(point);
}
Connect(1,2,1,0);
Connect(2,3,1,0);
Connect(3,4,1,0);
Connect(4,5,1,0);
Connect(5,6,1,0);
Connect(7,8,1,0);
Connect(8,9,1,0);
Connect(9,10,1,0);
Connect(10,11,1,0);
Connect(11,12,1,0);
Connect(13,14,1,0);
Connect(14,15,1,0);
Connect(15,16,1,0);
Connect(16,17,1,0);
Connect(17,18,1,0);
Connect(19,20,1,0);
Connect(20,21,1,0);
Connect(21,22,1,0);
Connect(19,14,8,9);
Connect(14,8,8,9);
Connect(8,2,8,9);
Connect(2,0,8,9);
Connect(20,15,6,7);
Connect(15,9,6,7);
Connect(9,3,6,7);
Connect(3,0,6,7);
Connect(21,16,4,5);
Connect(16,10,4,5);
Connect(10,4,4,5);
Connect(4,0,4,5);
Connect(22,17,2,3);
Connect(17,11,2,3);
Connect(11,5,2,3);
Connect(5,0,2,3);
Connect(13,7,8,9);
Connect(7,1,8,9);
Connect(18,12,8,9);
Connect(12,6,8,9);
/*Connect(15,3,1,0);
Connect(3,9,1,0);
Connect(9,12,1,0);
Connect(12,6,1,0);
Connect(6,18,1,0);
Connect(16,4,1,0);
Connect(4,10,1,0);
Connect(10,13,1,0);
Connect(13,7,1,0);
Connect(7,19,1,0);
Connect(17,5,1,0);
Connect(5,11,1,0);
Connect(11,14,1,0);
Connect(14,8,1,0);
Connect(8,20,1,0);
Connect(1,21,1,0);
Connect(21,22,1,0);
Connect(22,2,1,0);
Connect(1,5,8,9);
Connect(5,4,8,9);
Connect(4,3,8,9);
Connect(3,0,8,9);
Connect(21,11,6,7);
Connect(11,10,6,7);
Connect(10,9,6,7);
Connect(9,0,6,7);
Connect(22,14,4,5);
Connect(14,13,4,5);
Connect(13,12,4,5);
Connect(12,0,4,5);
Connect(2,8,2,3);
Connect(8,7,2,3);
Connect(7,6,2,3);
Connect(6,0,2,3);
Connect(17,16,8,9);
Connect(16,15,8,9);
Connect(20,19,8,9);
Connect(19,18,8,9);*/
this.g.catcher=JocGame.PLAYER_B;
this.g.catcherMin=3;
this.g.catcheeMin=1;
//this.g.initialPos=[[-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2],[0,9,12]];
//this.g.initialPos=[[-2,-2,-2],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]];
this.g.initialPos=[[18,19,20,21,22],[0,3,4]];
this.g.useDrop=false;
//this.g.initialPos=[[-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2],[0,3,4]];
//this.g.useDrop=true;
this.HuntPostInitGame();
//JocLog("Graph",this.g.Graph);
//JocLog("RC",this.g.RC);
}

View file

@ -0,0 +1,3 @@
<p>TODO: writes rules</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,42 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
View.Game.InitView=function() {
this.HuntInitView();
this.g.AisWhite=true;
$.extend(this.g.huntLayout,{
header: 1,
boardHeight: 7,
footer: 1,
left: 1,
boardWidth: 7,
right: 1,
});
this.HuntBuildLayout();
this.HuntMakeCoord();
this.HuntDrawBoard();
this.HuntMakePieces();
var dockRC=[0.6,7.5];
this.g.DockCoord=[this.g.posSize*dockRC[1],this.g.posSize*dockRC[0]];
this.g.pieceDock=$("<canvas/>").addClass("piece-dock").css({
left: this.g.DockCoord[0],
top: this.g.DockCoord[1],
}).attr("width",this.g.posSize).attr("height",this.g.posSize).appendTo(this.g.area).hide();
this.HuntDrawPiece(this.g.pieceDock,this.g.catcher);
$("<div/>").addClass("piece-count").css({
left: this.g.DockCoord[0],
top: this.g.DockCoord[1]+this.g.posSize,
width: this.g.posSize*1,
height: this.g.posSize*1,
"line-height": this.g.posSize+"px",
"font-size": this.g.posSize/2+"pt",
}).appendTo(this.g.area).hide();
}

View file

@ -0,0 +1,82 @@
/*
*
* 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.
*
*/
View.Game.xdPreInit = function(xdv) {
this.g.AisWhite=false;
this.g.huntLayout={
header: 1,
boardHeight: 6,
footer: 1,
left: 1,
boardWidth: 6,
right: 1,
};
this.g.huntGameData.lightsIntensity=0.55;
this.g.huntGameData.boardRowOffset=0;
this.g.huntGameData.sprites="/res/xd-view/meshes/tiger/tokens-aadupuliattam.png";
this.g.huntGameData.boardJSFile="/res/xd-view/meshes/board.js";
this.g.huntGameData.hunterJSFile="/res/xd-view/meshes/tiger/goat.js";
this.g.huntGameData.preyJSFile="/res/xd-view/meshes/tiger/tiger.js";
this.g.huntGameData.targetJSFile="/res/xd-view/meshes/tiger/target2.js";
this.g.huntGameData.preyScale=0.35;
this.g.huntGameData.hunterScale=0.3;
this.g.huntGameData.boardSize=1.23;
this.g.huntGameData.boardZ=0;
this.g.huntGameData.preyZ0=0;
this.g.huntGameData.hunterZ0=0;
this.g.huntGameData.screenDist=12000;
this.g.huntGameData.screenScale=4.5;
this.g.huntGameData.fieldMap="/res/xd-view/meshes/tiger/aadupuliattam.jpg";
this.g.huntGameData.boardField2D=this.g.huntGameData.fieldMap;
this.g.huntGameData.soundMove="move"; // to center exotic boards
this.g.huntGameData.soundEndJump="jumpend"; // to center exotic boards
this.g.huntGameData.targetColorSelected=0x333333;
this.g.huntGameData.preyMorph=[1,0,0,0,0,0,0];
this.g.huntGameData.hunterMorph=[1,0,0,0,0];
this.g.huntGameData.sequences=[];
this.g.huntGameData.sequences["prey"]=[];
this.g.huntGameData.sequences["prey"]["walk"]=[
[0,0,1,0,0,0,0],
[0,0,0,1,0,0,0],
[0,0,0,0,1,0,0],
[0,0,0,0,0,1,0],
[0,0,0,0,0,0,1],
];
this.g.huntGameData.sequences["prey"]["jump"]=[
[0,1,0,0,0,0,0],
[1,0,0,0,0,0,0]
];
this.g.huntGameData.sequences["hunter"]=[];
this.g.huntGameData.sequences["hunter"]["walk"]=[
[0,1,0,0,0],
[0,0,1,0,0],
[0,0,0,1,0],
[0,0,0,0,1],
[0,1,0,0,0],
[0,0,1,0,0],
[0,0,0,1,0],
[0,0,0,0,1],
];
}
View.Game.xdInitExtra = function(xdv){
}
View.Game.GetOffBoardCoord = function(i,cellSize) {
return [(-this.g.huntLayout.boardWidth/2+this.g.huntLayout.boardWidth/15*i)*cellSize,3.5*cellSize];
}

View file

@ -0,0 +1,3 @@
<p>TODO: credit people, countries, tribes, ...</p>
<p>Jocly development: Michel gutierrez (@<a target="_blank" href="http://twitter.com/_mig_">_mig_</a>).</p>
<p>Graphic design: Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>).</p>

View file

@ -0,0 +1,2 @@
<p>TODO: game description with images, references, ...</p>

View file

@ -0,0 +1,91 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
Model.Move.PosName={
0:"A5",1:"B5",2:"C5",3:"D5",4:"E5",
5:"A4",6:"B4",7:"C4",8:"D4",9:"E4",
10:"A3",11:"B3",12:"C3",13:"D3",14:"E3",
15:"A2",16:"B2",17:"C2",18:"D2",19:"E2",
20:"A1",21:"B1",22:"C1",23:"D1",24:"E1",
}
Model.Board.HuntGameEvaluate = function(aGame,evalData,evalMap) {
/*
this.HuntEvaluateDistToCatcher(aGame,evalData,evalMap);
this.HuntEvaluateCatchable(aGame,evalData,evalMap);
this.HuntEvaluateAntiBack(aGame,evalData,evalMap);
this.HuntEvaluateGroups(aGame,evalData,evalMap);
return {
pieceCount: [12000000,1000000],
dist3: [15,0],
antiBack: [1000,10],
antiBackPiece: [100,1],
catchablePieces: [20,0],
catchableDir: [10,0],
catchDangerFork: [1000,0],
maxEmptyNoCatcherGroup: [0,30],
emptyNoCatcherGroup: [0,100],
catcheeGroups: [10,0],
minEmptyCatcherGroup: [20,0],
};
*/
this.HuntEvaluateDistToCatcher(aGame,evalData,evalMap);
this.HuntEvaluateCatchable(aGame,evalData,evalMap);
this.HuntEvaluateAntiBack(aGame,evalData,evalMap);
this.HuntEvaluateGroups(aGame,evalData,evalMap);
if(evalMap.minEmptyCatcherGroup[0]<=6)
evalMap.minEmptyCatcherGroup[1]=6-evalMap.minEmptyCatcherGroup[0];
var evalFactors={
pieceCount: [12000000,1000000],
dist3: [10,0],
antiBack: [2000,10],
antiBackPiece: [100,1],
catchablePieces: [20,0],
catchableDir: [10,0],
catchDangerFork: [100000,0],
maxEmptyNoCatcherGroup: [0,30],
emptyNoCatcherGroup: [0,100],
catcheeGroups: [100,0],
minEmptyCatcherGroup: [90,200],
};
return evalFactors;
}
Model.Game.InitGame = function() {
var $this=this;
this.HuntInitGame();
Object.assign(this.g.huntOptions,{
compulsaryCatch: true,
catchLongestLine: true,
multipleCatch: true,
});
this.HuntMakeGrid({});
function Connect(pos0,pos1,dir0,dir1) {
$this.g.Graph[pos0][dir0]=pos1;
$this.g.Graph[pos1][dir1]=pos0;
}
Connect(20,16,4,5);
Connect(16,12,4,5);
Connect(12,8,4,5);
Connect(8,4,4,5);
Connect(0,6,6,7);
Connect(6,12,6,7);
Connect(12,18,6,7);
Connect(18,24,6,7);
this.g.catcher=JocGame.PLAYER_A;
this.g.catcherMin=1;
this.g.catcheeMin=10;
this.g.initialPos=[[12],[10,14,17,16,18,22,15,19,21,23,20,24]];
this.HuntPostInitGame();
}

View file

@ -0,0 +1,3 @@
<p>TODO: writes rules</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View file

@ -0,0 +1,8 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/

View file

@ -0,0 +1,67 @@
/*
*
* 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.
*
*/
View.Game.xdPreInit = function(xdv) {
this.g.AisWhite=false;
this.g.huntLayout={
header: 1,
boardHeight: 6,
footer: 1,
left: 1,
boardWidth: 4,
right: 1,
};
this.g.huntGameData.lightsIntensity=0.55;
this.g.huntGameData.boardRowOffset=2;
this.g.huntGameData.sprites="/res/xd-view/meshes/kukuli/tokens.png";
this.g.huntGameData.boardJSFile="/res/xd-view/meshes/board.js";
this.g.huntGameData.hunterJSFile="/res/xd-view/meshes/kukuli/kukuli2.js";
this.g.huntGameData.preyJSFile="/res/xd-view/meshes/kukuli/ukuku2.js";
this.g.huntGameData.targetJSFile="/res/xd-view/meshes/target.js";
this.g.huntGameData.preyScale=0.5;
this.g.huntGameData.hunterScale=0.5;
this.g.huntGameData.boardSize=1.23;
this.g.huntGameData.boardZ=0;
this.g.huntGameData.preyZ0=0;
this.g.huntGameData.hunterZ0=0;
this.g.huntGameData.screenDist=12000;
this.g.huntGameData.screenScale=4.5;
this.g.huntGameData.fieldMap="/res/xd-view/meshes/kukuli/kukuliboard.jpg";
this.g.huntGameData.fieldSpecMap="/res/xd-view/meshes/kukuli/kukuliboard-specular.jpg";
this.g.huntGameData.boardField2D=this.g.huntGameData.fieldMap;
this.g.huntGameData.soundMove="move"; // to center exotic boards
this.g.huntGameData.soundEndJump="jumpend"; // to center exotic boards
this.g.huntGameData.targetColorSelected=0x333333;
this.g.huntGameData.preyMorph=[1];
this.g.huntGameData.hunterMorph=[1];
this.g.huntGameData.sequences=[];
this.g.huntGameData.sequences["prey"]=[];
this.g.huntGameData.sequences["prey"]["walk"]=[
[1],
];
this.g.huntGameData.sequences["prey"]["jump"]=[
[1],
];
this.g.huntGameData.sequences["hunter"]=[];
this.g.huntGameData.sequences["hunter"]["walk"]=[
[1],
];
}
View.Game.xdInitExtra = function(xdv){
}

View file

@ -0,0 +1,2 @@
<p>Développement: Michel gutierrez (@<a target="_blank" href="http://twitter.com/_mig_">_mig_</a>).</p>
<p>Graphisme: Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>).</p>

View file

@ -0,0 +1,2 @@
<p>Jocly development: Michel gutierrez (@<a target="_blank" href="http://twitter.com/_mig_">_mig_</a>).</p>
<p>Graphic design: Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>).</p>

View file

@ -0,0 +1 @@
<p>De cercar la liebre (Attraper le lièvre) est un ancien jeu européen, probablement venu d'Espagne. Il fait partie de la famille des jeux de chasse qui sont des jeux asymétriques où les joueurs n'ont pas le même nombre de pièce. Dans ce cas présent, un lièvre affronte 12 chasseurs.</p>

View file

@ -0,0 +1 @@
<p>De cercar la liebre (Catch the hare) is an old European game, probably from Spain. It is one of the Hunt games family which are asymmetrical games where opponents have different number of pieces. In this case, a single hare faces 12 hunters.</p>

View file

@ -0,0 +1,120 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
Model.Move.PosName={
0:"A5",1:"B5",2:"C5",3:"D5",4:"E5",
5:"A4",6:"B4",7:"C4",8:"D4",9:"E4",
10:"A3",11:"B3",12:"C3",13:"D3",14:"E3",
15:"A2",16:"B2",17:"C2",18:"D2",19:"E2",
20:"A1",21:"B1",22:"C1",23:"D1",24:"E1",
}
Model.Board.HuntGameEvaluate = function(aGame,evalData,evalMap) {
/*
this.HuntEvaluateDistToCatcher(aGame,evalData,evalMap);
this.HuntEvaluateCatchable(aGame,evalData,evalMap);
this.HuntEvaluateAntiBack(aGame,evalData,evalMap);
this.HuntEvaluateGroups(aGame,evalData,evalMap);
return {
pieceCount: [12000000,1000000],
dist3: [15,0],
antiBack: [1000,10],
antiBackPiece: [100,1],
catchablePieces: [20,0],
catchableDir: [10,0],
catchDangerFork: [1000,0],
maxEmptyNoCatcherGroup: [0,30],
emptyNoCatcherGroup: [0,100],
catcheeGroups: [10,0],
minEmptyCatcherGroup: [20,0],
};
*/
this.HuntEvaluateDistToCatcher(aGame,evalData,evalMap);
//this.HuntEvaluateCatchable(aGame,evalData,evalMap);
//this.HuntEvaluateAntiBack(aGame,evalData,evalMap);
//this.HuntEvaluateGroups(aGame,evalData,evalMap);
this.HuntEvaluateCatcheeGroups(aGame,evalData,evalMap);
//this.HuntEvaluateCatcheeConnections(aGame,evalData,evalMap);
this.HuntEvaluateFreeZone(aGame,evalData,evalMap);
//this.HuntEvaluateOppositeDistFromCatcher(aGame,evalData,evalMap);
this.HuntEvaluateRisk(aGame,evalData,evalMap);
/*
if(evalMap.minEmptyCatcherGroup[0]<=6)
evalMap.minEmptyCatcherGroup[1]=6-evalMap.minEmptyCatcherGroup[0];
*/
var opts=aGame.mOptions.levelOptions;
var evalFactors={
/*
pieceCount: [12000000,1000000],
dist3: [15,0],
antiBack: [2000,10],
antiBackPiece: [100,1],
catchablePieces: [20,0],
catchableDir: [10,0],
catchDangerFork: [100000,0],
maxEmptyNoCatcherGroup: [0,30],
emptyNoCatcherGroup: [0,100],
catcheeGroups: [10,0],
minEmptyCatcherGroup: [50,200],
freeZone: [500,0],
*/
};
for(var opt in opts) {
var m=/^(.*)(0|1)$/.exec(opt);
if(!m)
continue;
if(evalFactors[m[1]]===undefined)
evalFactors[m[1]]=[0,0];
evalFactors[m[1]][m[2]]=opts[opt];
}
return evalFactors;
}
Model.Game.InitGame = function() {
var $this=this;
this.HuntInitGame();
Object.assign(this.g.huntOptions,{
compulsaryCatch: false,
catchLongestLine: false,
multipleCatch: true,
});
this.HuntMakeGrid({});
function Connect(pos0,pos1,dir0,dir1) {
$this.g.Graph[pos0][dir0]=pos1;
$this.g.Graph[pos1][dir1]=pos0;
}
Connect(10,6,4,5);
Connect(6,2,4,5);
Connect(20,16,4,5);
Connect(16,12,4,5);
Connect(12,8,4,5);
Connect(8,4,4,5);
Connect(22,18,4,5);
Connect(18,14,4,5);
Connect(0,6,6,7);
Connect(6,12,6,7);
Connect(12,18,6,7);
Connect(18,24,6,7);
Connect(10,16,6,7);
Connect(16,22,6,7);
Connect(2,8,6,7);
Connect(8,14,6,7);
this.g.catcher=JocGame.PLAYER_B;
this.g.evaluate0=-2500000;
this.g.catcherMin=1;
this.g.catcheeMin=10;
this.g.initialPos=[[0,1,2,3,4,5,6,7,8,9,10,14],[12]];
this.HuntPostInitGame();
}

View file

@ -0,0 +1,17 @@
<p class="rules-titles">Essentiel</p>
<p>De cercar la liebre (Attraper le lièvre) est un jeu de chasse: un joueur est la proie, son adversaire possède 12 chasseurs.</p>
<p>Position de départ:</p>
<img src="{GAME}/res/rules/liebre/start.jpg" class="rules-illustration">
<h2>Pour gagner</h2>
<img src="{GAME}/res/rules/liebre/hunter-wins.jpg" class="rules-illustration">
<p>Les chasseurs doivent cerner le lièvre de sorte quil ne puisse plus s'échaper même en éliminant un chasseur.</p>
<p>Le lièvre gagne s'il élimine assez de chasseurs pour qu'ils ne puissent plus le cerner.</p>
<h2>Votre tour</h2>
<img src="{GAME}/res/rules/liebre/hare-plays.jpg" class="rules-illustration">
<p>Déplacer une pièce vers une place adjacente libre.</p>
<p>Si vous êtes le lièvre, vous pouvez sauter par dessus un chasseur pour l'éliminer du jeu. Vous pouvez ainsi capturer plusieurs chasseurs à la suite lors du même coup. La capture n'est pas obligatoire.</p>

View file

@ -0,0 +1,17 @@
<p class="rules-titles">Essentials</p>
<p>De cercar la liebre (Catch the hare) is a hunt game: one player is the prey, his opponent has 12 hunters.</p>
<p>Start position:</p>
<img src="{GAME}/res/rules/liebre/start.jpg" class="rules-illustration">
<h2>To win</h2>
<img src="{GAME}/res/rules/liebre/hunter-wins.jpg" class="rules-illustration">
<p>Hunters must surround the hare with no possibilty for it to escape by capture.</p>
<p>The hare wins if it eliminates enough hunters so that they can not surround it.</p>
<h2>Your turn</h2>
<img src="{GAME}/res/rules/liebre/hare-plays.jpg" class="rules-illustration">
<p>Move one piece to an adjacent free position.</p>
<p>If you are the hare, you can eliminate a hunter by jumping over him. You can eliminate several hunters with consecutive jumps. Capture is not compulsory.</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

View file

@ -0,0 +1,19 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
View.Game.GameSpecificInit=function(){
if (this.mSkin=='medieval'){
$(".area-canvas,.highlight,.notation").addClass("medieval");
}
}
View.Game.SpecificSkinHuntDrawPiece=function(canvas,who){
if (this.mSkin=='medieval'){
// we do not draw, we css :)
canvas.addClass(who==JocGame.PLAYER_B?"medieval-hunter":"medieval-liebre");
}
}

View file

@ -0,0 +1,80 @@
/*
*
* 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.
*
*/
View.Game.xdPreInit = function(xdv) {
this.g.huntLayout={
header: 1,
boardHeight: 4,
footer: 1,
left: 1,
boardWidth: 4,
right: 1,
};
this.g.huntGameData.sprites="/res/images/liebre/tokens.png";
this.g.huntGameData.boardJSFile="/res/xd-view/meshes/board.js";
this.g.huntGameData.hunterJSFile="/res/xd-view/meshes/liebre/hunter2.js";
this.g.huntGameData.hunterMaterialsPreload={
matName:"mat.short",
matMap:"/res/xd-view/meshes/liebre/hunter.jpg"
};
this.g.huntGameData.preyJSFile="/res/xd-view/meshes/liebre/liebre6.js";
this.g.huntGameData.preyMaterialsPreload={
matName:"Material",
matMap:"/res/xd-view/meshes/liebre/rabbitskin4.jpg"
};
this.g.huntGameData.targetJSFile="/res/xd-view/meshes/target.js";
this.g.huntGameData.preyScale=0.1;
this.g.huntGameData.hunterScale=0.25;
this.g.huntGameData.boardSize=1.25;
this.g.huntGameData.boardZ=0;
this.g.huntGameData.preyZ0=300;
this.g.huntGameData.hunterZ0=0;
this.g.huntGameData.screenDist=12000;
this.g.huntGameData.screenScale=4.5;
this.g.huntGameData.fieldMap="/res/xd-view/meshes/liebre/liebreboardsimple.jpg";
this.g.huntGameData.boardField2D="/res/images/liebre/liebreboard.jpg";
this.g.huntGameData.preyMorph=[1,0,0,0,0];
this.g.huntGameData.hunterMorph=[1,0,0,0,0,0,0,0,0,0,0,0];
//// default override ///
this.g.huntGameData.killPieceZTempo=-0.5; // unit = cell size
this.g.huntGameData.jumpEatScale=1.5;
this.g.huntGameData.preyJumpsAtWalk=true;
/////////////////////////
this.g.huntGameData.sequences=[];
this.g.huntGameData.sequences["prey"]=[];
this.g.huntGameData.sequences["prey"]["walk"]=[
[0,1,0,0,0],
[0,0,1,0,0],
[0,0,0,1,0],
[0,0,0,0,1],
];
this.g.huntGameData.sequences["prey"]["jump"]=this.g.huntGameData.sequences["prey"]["walk"];
this.g.huntGameData.sequences["hunter"]=[];
this.g.huntGameData.sequences["hunter"]["walk"]=[
[0,0,0,1,0,0,0,0,0,0,0,0],
[0,0,0,0,1,0,0,0,0,0,0,0],
[0,0,0,0,0,1,0,0,0,0,0,0],
[0,0,0,0,0,0,1,0,0,0,0,0],
[0,0,0,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,1,0,0,0],
[0,0,0,0,0,0,0,0,0,1,0,0],
[0,0,0,0,0,0,0,0,0,0,1,0],
[1,0,0,0,0,0,0,0,0,0,0,0],
];
}
View.Game.xdInitExtra = function(xdv){
}

View file

@ -0,0 +1,32 @@
.area-canvas.medieval{
background-image: url(res/images/liebre/liebreboard.jpg);
background-size: contain;
background-repeat: none;
}
.piece.medieval-hunter{
background-image: url(res/images/liebre/token_hunter.png);
background-size: contain;
background-repeat: none;
}
.piece.medieval-liebre{
background-image: url(res/images/liebre/token_liebre.png);
background-size: contain;
background-repeat: none;
}
.highlight.medieval{
z-index: 15;
background: none;
background-image: url(res/images/liebre/circle_blue.png);
background-size: contain;
background-repeat: none;
}
.medieval.back{
background-image: url(res/images/liebre/circle_red.png);
}
.notation.medieval {
color: #ffffff;
overflow: hidden;
}

View file

@ -0,0 +1,3 @@
<p>TODO: credit people, countries, tribes, ...</p>
<p>Jocly development: Michel gutierrez (@<a target="_blank" href="http://twitter.com/_mig_">_mig_</a>).</p>
<p>Graphic design: Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>).</p>

View file

@ -0,0 +1,2 @@
<p>TODO: game description with images, references, ...</p>

View file

@ -0,0 +1,121 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
/*
Model.Move.PosName={
0:"C7",1:"D7",2:"E7",
3:"C6",4:"D6",5:"E6",
6:"A5",7:"B5",8:"C5",9:"D5",10:"E5",11:"F5",12:"G5",
13:"A4",14:"B4",15:"C4",16:"D4",17:"E4",18:"F4",19:"G4",
20:"A3",21:"B3",22:"C3",23:"D3",24:"E3",25:"F3",26:"G3",
27:"C2",28:"D2",29:"E2",
30:"C1",31:"D1",32:"E1",
}
*/
Model.Board.HuntGameEvaluate = function(aGame,evalData,evalMap) {
this.HuntEvaluateDistToCatcher(aGame,evalData,evalMap);
this.HuntEvaluateCatchable(aGame,evalData,evalMap);
this.HuntEvaluateAntiBack(aGame,evalData,evalMap);
this.HuntEvaluateGroups(aGame,evalData,evalMap);
if(evalMap.minEmptyCatcherGroup[0]<=6)
evalMap.minEmptyCatcherGroup[1]=6-evalMap.minEmptyCatcherGroup[0];
var evalFactors={
pieceCount: [12000000,1000000],
dist3: [5,0],
antiBack: [2000,10],
antiBackPiece: [100,1],
catchablePieces: [20,0],
catchableDir: [10,0],
catchDangerFork: [100000,0],
maxEmptyNoCatcherGroup: [0,30],
emptyNoCatcherGroup: [0,100],
catcheeGroups: [10,0],
minEmptyCatcherGroup: [90,200],
};
return evalFactors;
/*
this.HuntEvaluateDistToCatcher(aGame,evalData,evalMap);
this.HuntEvaluateCatchable(aGame,evalData,evalMap);
this.HuntEvaluateAntiBack(aGame,evalData,evalMap);
this.HuntEvaluateGroups(aGame,evalData,evalMap);
if(evalMap.minEmptyCatcherGroup[0]<=6)
evalMap.minEmptyCatcherGroup[1]=6-evalMap.minEmptyCatcherGroup[0];
var evalFactors={
pieceCount: [12000000,1000000],
dist3: [10,0],
//antiBack: [2000,10],
antiBackPiece: [100,1],
catchablePieces: [20,0],
catchableDir: [10,0],
catchDangerFork: [100000,0],
maxEmptyNoCatcherGroup: [0,30],
emptyNoCatcherGroup: [0,100],
catcheeGroups: [100,0],
minEmptyCatcherGroup: [90,200],
};
return evalFactors;
*/
}
Model.Game.InitGame = function() {
var $this=this;
this.HuntInitGame();
Object.assign(this.g.huntOptions,{
compulsaryCatch: true,
catchLongestLine: false,
multipleCatch: true,
});
Object.assign(this.g.huntEval,{
});
this.HuntMakeGrid({
rows: 7,
cols: 7,
});
this.HuntRemovePositions([0,1,7,8,5,6,12,13,35,36,42,43,40,41,47,48]);
function Connect(pos0,pos1,dir0,dir1) {
$this.g.Graph[pos0][dir0]=pos1;
$this.g.Graph[pos1][dir1]=pos0;
}
Connect(0,4,6,7);
Connect(4,10,6,7);
Connect(6,14,6,7);
Connect(14,22,6,7);
Connect(8,16,6,7);
Connect(16,24,6,7);
Connect(10,18,6,7);
Connect(18,26,6,7);
Connect(22,28,6,7);
Connect(28,32,6,7);
Connect(8,4,4,5);
Connect(4,2,4,5);
Connect(20,14,4,5);
Connect(14,8,4,5);
Connect(22,16,4,5);
Connect(16,10,4,5);
Connect(24,18,4,5);
Connect(18,12,4,5);
Connect(30,28,4,5);
Connect(28,24,4,5);
this.g.catcher=JocGame.PLAYER_A;
this.g.catcherMin=1;
this.g.catcheeMin=10;
this.g.initialPos=[[16],[9,8,10,7,11,4,3,5,6,12,1,0,2]];
this.HuntPostInitGame();
}

View file

@ -0,0 +1,3 @@
<p>TODO: writes rules</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,23 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
View.Game.InitView=function() {
this.HuntInitView();
$.extend(this.g.huntLayout,{
header: 1,
boardHeight: 7,
footer: 1,
left: 1,
boardWidth: 7,
right: 1,
});
this.HuntBuildLayout();
this.HuntMakeCoord();
this.HuntDrawBoard();
this.HuntMakePieces();
}

View file

@ -0,0 +1,76 @@
/*
*
* 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.
*
*/
View.Game.xdPreInit = function(xdv) {
this.g.AisWhite=false;
this.g.huntLayout={
header: 1,
boardHeight: 6,
footer: 1,
left: 1,
boardWidth: 6,
right: 1,
};
this.g.huntGameData.sprites="/res/xd-view/meshes/fox/tokens.png";
this.g.huntGameData.boardJSFile="/res/xd-view/meshes/board.js";
this.g.huntGameData.hunterJSFile="/res/xd-view/meshes/fox/goose.js";
this.g.huntGameData.preyJSFile="/res/xd-view/meshes/fox/fox1.js";
this.g.huntGameData.targetJSFile="/res/xd-view/meshes/target.js";
this.g.huntGameData.preyScale=0.4;
this.g.huntGameData.hunterScale=0.20;
this.g.huntGameData.boardSize=1.23;
this.g.huntGameData.boardZ=0;
this.g.huntGameData.preyZ0=0;
this.g.huntGameData.hunterZ0=0;
this.g.huntGameData.screenDist=12000;
this.g.huntGameData.screenScale=4.5;
this.g.huntGameData.fieldMap="/res/xd-view/meshes/fox/foxngeesefield.jpg";
this.g.huntGameData.boardField2D=this.g.huntGameData.fieldMap;
this.g.huntGameData.preyMorph=[1,0,0,0,0,0];
this.g.huntGameData.hunterMorph=[1,0,0,0,0];
this.g.huntGameData.sequences=[];
this.g.huntGameData.sequences["prey"]=[];
this.g.huntGameData.sequences["prey"]["walk"]=[
[0,0,1,0,0,0],
[0,0,0,1,0,0],
[0,0,0,0,1,0],
[0,0,0,0,0,1],
[0,0,1,0,0,0],
[0,0,0,1,0,0],
[0,0,0,0,1,0],
[0,0,0,0,0,1],
];
this.g.huntGameData.sequences["prey"]["jump"]=[
[1,0,0,0,0,0],
[0,1,0,0,0,0],
[0,1,0,0,0,0],
[0,1,0,0,0,0],
[1,0,0,0,0,0]
];
this.g.huntGameData.sequences["hunter"]=[];
this.g.huntGameData.sequences["hunter"]["walk"]=[
[0,1,0,0,0],
[0,0,1,0,0],
[0,0,0,1,0],
[0,0,0,0,1],
[0,1,0,0,0],
[0,0,1,0,0],
[0,0,0,1,0],
[0,0,0,0,1],
];
}
View.Game.xdInitExtra = function(xdv){
}

View file

@ -0,0 +1,57 @@
.area-canvas.foxngeese{
background-image: url(res/images/foxngeese/foxngeese.jpg);
background-size: contain;
background-repeat: none;
}
.piece.foxngeese-black{
background-image: url(res/images/foxngeese/goose2.png);
background-size: contain;
background-repeat: none;
}
.piece.foxngeese-white{
background-image: url(res/images/foxngeese/fox2.png);
background-size: contain;
background-repeat: none;
}
.highlight.foxngeese{
z-index: 15;
background: none;
background-image: url(res/images/foxngeese/ringwhite.png);
background-size: contain;
background-repeat: none;
}
.foxngeese.back{
background-image: url(res/images/foxngeese/ringorange.png);
}
.area-canvas.iefox{
background-image: url(res/images/foxngeese/foxngeeseiefox.jpg);
background-size: contain;
background-repeat: none;
}
.piece.iefox-black{
background-image: url(res/images/foxngeese/chrome.png);
background-size: contain;
background-repeat: none;
}
.piece.iefox-white{
background-image: url(res/images/foxngeese/firefox.png);
background-size: contain;
background-repeat: none;
}
.highlight.iefox{
z-index: 40;
background: none;
background-image: url(res/images/foxngeese/pointer.png);
background-size: contain;
background-repeat: none;
}
.iefox.back{
background-image: url(res/images/foxngeese/undo.png);
}

1018
src/games/hunt/hunt-model.js Normal file

File diff suppressed because it is too large Load diff

508
src/games/hunt/hunt-view.js Normal file
View file

@ -0,0 +1,508 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
View.Game.GameSpecificInit=function(){
}
View.Game.InitView=function() {
this.HuntInitView();
this.HuntBuildLayout();
this.HuntMakeCoord();
this.HuntDrawBoard();
this.HuntMakePieces();
this.GameSpecificInit();
}
View.Game.HuntInitView=function() {
this.g.backgroundColor="#FFCC66";
this.g.color="#990000";
this.g.huntLayout={
header: 1,
boardHeight: 4,
footer: 1,
left: 1,
boardWidth: 4,
right: 1,
};
this.g.AisWhite=false;
}
View.Game.HuntBuildLayout=function() {
this.g.background=$("<div/>").addClass("background").css({
left: 0,
top: 0,
width: this.mGeometry.width,
height: this.mGeometry.height,
"background-color": this.g.backgroundColor,
}).appendTo(this.mWidget);
this.g.areaWidth=Math.min(this.mGeometry.width, this.mGeometry.height*this.mViewOptions.preferredRatio);
this.g.areaHeight=Math.min(this.mGeometry.width/this.mViewOptions.preferredRatio,this.mGeometry.height);
this.g.left=(this.mGeometry.width-this.g.areaWidth)/2;
this.g.top=(this.mGeometry.height-this.g.areaHeight)/2;
this.g.area=$("<div/>").addClass("area").css({
left: this.g.left,
top: this.g.top,
width: this.g.areaWidth,
height: this.g.areaHeight,
}).appendTo(this.mWidget);
this.g.areaCanvas=$("<canvas/>").addClass("area-canvas").css({
left: 0,
top: 0,
}).attr("width",this.g.areaWidth).attr("height",this.g.areaHeight).appendTo(this.g.area);
this.g.areaCtx=this.g.areaCanvas[0].getContext("2d");
this.g.layout={
header: null,
footer: null,
left: null,
right: null,
board: null,
}
var layout=this.g.huntLayout;
var vWeight=layout.boardHeight || 1;
vWeight += layout.header || 0;
vWeight += layout.footer || 0;
var hWeight=layout.boardWidth || 1;
hWeight += layout.left || 0;
hWeight += layout.left || 0;
this.g.boardLeft=0;
this.g.boardTop=0;
this.g.boardHeight=layout.boardHeight?this.g.areaHeight*layout.boardHeight/vWeight:this.g.areaHeight;
this.g.boardWidth=layout.boardWidth?this.g.areaWidth*layout.boardWidth/hWeight:this.g.areaWidth;
if(layout.header) {
this.g.boardTop=this.g.areaHeight*(layout.header/vWeight);
this.g.layout.header=$("<div/>").addClass("layout layout-header").css({
left: 0,
top: 0,
width: this.g.areaWidth,
height: this.g.boardTop,
}).appendTo(this.g.area);
}
if(layout.footer) {
this.g.layout.header=$("<div/>").addClass("layout layout-footer").css({
left: 0,
top: this.g.boardTop+this.g.boardHeight,
width: this.g.areaWidth,
height: this.g.areaHeight*(layout.footer/vWeight),
}).appendTo(this.g.area);
}
if(layout.left) {
this.g.boardLeft=this.g.areaWidth*(layout.left/hWeight);
this.g.layout.left=$("<div/>").addClass("layout layout-left").css({
left: 0,
top: this.g.boardTop,
width: this.g.boardLeft,
height: this.g.boardHeight,
}).appendTo(this.g.area);
}
if(layout.right) {
this.g.layout.right=$("<div/>").addClass("layout layout-right").css({
left: this.g.boardLeft+this.g.boardWidth,
top: this.g.boardTop,
width: this.g.areaWidth*(layout.left/hWeight),
height: this.g.boardHeight,
}).appendTo(this.g.area);
}
this.g.board=$("<div/>").addClass("layout layout-board").css({
left: this.g.boardLeft,
top: this.g.boardTop,
width: this.g.boardWidth,
height: this.g.boardHeight,
}).appendTo(this.g.area);
}
View.Game.HuntMakeCoord=function() {
var row0=null, col0=null, row1=null, col1=null;
for(var i=0;i<this.g.RC.length;i++) {
var rc=this.g.RC[i];
var row=rc[0];
var col=rc[1];
if(row0==null || row<row0)
row0=row;
if(row1==null || row>row1)
row1=row;
if(col0==null || col<col0)
col0=col;
if(col1==null || col>col1)
col1=col;
}
this.g.Coord=[];
for(var i=0;i<this.g.RC.length;i++) {
var rc=this.g.RC[i];
var row=rc[0];
var col=rc[1];
var coord;
if(this.mViewAs==JocGame.PLAYER_A)
coord=[
this.g.boardLeft+(col-col0)/(col1-col0)*this.g.boardWidth,
this.g.boardTop+(row-row0)/(row1-row0)*this.g.boardHeight,
];
else
coord=[
this.g.boardLeft+(col1-col)/(col1-col0)*this.g.boardWidth,
this.g.boardTop+(row1-row)/(row1-row0)*this.g.boardHeight,
];
this.g.Coord.push(coord);
}
var distMin=-1;
for(var pos=0;pos<this.g.Graph.length;pos++) {
var graph=this.g.Graph[pos];
for(var d=0;d<graph.length;d++) {
var pos1=graph[d];
if(pos1!=null) {
var dr=Math.abs(this.g.RC[pos][0]-this.g.RC[pos1][0]);
var dc=Math.abs(this.g.RC[pos][1]-this.g.RC[pos1][1]);
var dist=Math.sqrt(dr*dr+dc*dc);
if(distMin<0 || dist<distMin) {
//JocLog("Dist min",pos,pos1);
distMin=dist;
}
}
}
}
this.g.posSize=Math.min(this.g.boardWidth/(col1-col0)*distMin,this.g.boardHeight/(row1-row0)*distMin);
if(this.g.posSize<=0) {
this.g.posSize=this.g.boardWidth/10;
JocLog("Adjusting posSize",this.g.posSize);
}
//JocLog("posSize",this.g.posSize);
this.g.lineWidth=this.g.posSize*0.05;
this.g.posRadius=this.g.posSize*0.2;
}
View.Game.HuntDrawLine=function(ctx,pos1,pos2) {
var x0=this.g.Coord[pos1][0];
var x1=this.g.Coord[pos2][0];
var y0=this.g.Coord[pos1][1];
var y1=this.g.Coord[pos2][1];
ctx.beginPath();
ctx.moveTo(x0,y0);
ctx.lineTo(x1,y1);
ctx.closePath();
ctx.stroke();
}
View.Game.HuntPreDrawPositions=function(ctx) {
}
View.Game.HuntDrawBoard=function() {
var ctx=this.g.areaCtx;
ctx.lineWidth=this.g.lineWidth;
ctx.strokeStyle=this.g.color;
ctx.fillStyle=this.g.color;
if (this.mSkin=='official'){
for(var pos=0;pos<this.g.Graph.length;pos++) {
var graph=this.g.Graph[pos];
for(var i=0;i<graph.length;i++) {
var pos1=graph[i];
if(pos1!=null) {
this.HuntDrawLine(ctx,pos,pos1);
}
}
}
}
this.HuntPreDrawPositions(ctx);
for(var pos=0;pos<this.g.Coord.length;pos++) {
var coord=this.g.Coord[pos];
var x=coord[0];
var y=coord[1];
if (this.mSkin=='official'){
ctx.beginPath();
ctx.arc(x,y,this.g.posRadius,0,Math.PI*2,true);
ctx.closePath();
ctx.fill();
ctx.save();
ctx.globalCompositeOperation="destination-out";
ctx.beginPath();
ctx.arc(x,y,this.g.posRadius-this.g.lineWidth,0,Math.PI*2,true);
ctx.closePath();
ctx.fill();
ctx.restore();
}
if(this.mNotation) {
var PosNameMap=this.GetMoveClass().prototype.PosName;
var posName=pos;
if(typeof PosNameMap[pos]!="undefined")
posName=PosNameMap[pos];
$("<div/>").addClass("notation").css({
left: x-this.g.posSize*0.2,
top: y-this.g.posSize*0.15,
width: this.g.posSize*0.4,
height: this.g.posSize*0.3,
"line-height": this.g.posSize*0.3+"px",
"font-size": this.g.posSize*0.2+"px",
}).appendTo(this.g.area).text(posName);
}
$("<div/>").addClass("highlight").css({
left: x-this.g.posSize*0.5,
top: y-this.g.posSize*0.5,
width: this.g.posSize*1,
height: this.g.posSize*1,
"border-radius": this.g.posSize/2,
}).appendTo(this.g.area).attr("joc-pos",pos).hide();
$("<div/>").addClass("front").css({
left: x-this.g.posSize*0.5,
top: y-this.g.posSize*0.5,
width: this.g.posSize*1,
height: this.g.posSize*1,
"border-radius": this.g.posSize/2,
}).appendTo(this.g.area).attr("joc-pos",pos).hide();
}
}
View.Game.HuntMakePieces=function() {
this.g.pieces=[];
for(var who=0;who<2;who++) {
for(var i=0;i<this.g.initialPos[who].length;i++) {
var pos=this.g.initialPos[who][i];
var piece=$("<canvas/>").addClass("piece").css({
}).attr("width",this.g.posSize).attr("height",this.g.posSize).appendTo(this.g.area).hide();
this.HuntDrawPiece(piece,this.g.AisWhite?2*who-1:1-2*who);
this.g.pieces.push(piece);
}
}
}
View.Game.DestroyView=function() {
this.mWidget.empty();
}
View.Board.Display=function(aGame) {
var evalData=this.HuntMakeEvalData(aGame);
if(evalData.catcheePiecesDock.length>0) {
$(".piece-dock").show();
$(".piece-count").show().text(evalData.catcheePiecesDock.length);
} else {
$(".piece-dock").hide();
$(".piece-count").hide();
}
for(var i=0;i<this.pieces.length;i++) {
var piece=this.pieces[i];
var vPiece=aGame.g.pieces[i];
if(piece.p<0)
vPiece.hide();
else {
vPiece.css({
left: aGame.g.Coord[piece.p][0]-aGame.g.posSize/2,
top: aGame.g.Coord[piece.p][1]-aGame.g.posSize/2,
opacity: 1,
}).show();
}
}
}
View.Board.HuntClearInput=function(aGame) {
aGame.mWidget.find(".highlight").removeClass("back").hide();
aGame.mWidget.find(".front").hide().unbind(JocGame.CLICK);
}
View.Board.HumanTurn=function(aGame) {
var $this=this;
var move={p:[]};
var moves=[];
if(aGame.g.useDrop)
moves=this.HuntGetAllDropMoves(aGame);
if(moves.length==0)
moves=this.HuntGetAllMoves(aGame);
function Input() {
$this.HuntClearInput(aGame);
var posMap={};
var moveCount=0;
var move0;
for(var i=0;i<moves.length;i++) {
var match=true;
for(var j=0;j<move.p.length;j++) {
if(move.p[j]!=moves[i].p[j]) {
match=false;
break;
}
}
if(match) {
posMap[moves[i].p[move.p.length]]=moves[i].p[move.p.length];
moveCount++;
move0=moves[i];
}
}
if(moveCount==1 && move.p.length==move0.p.length) {
if(move0.p.length==1)
$this.HuntAnimateDrop(aGame,-1,move0.p[0],function() {
aGame.MakeMove(move0);
});
else
aGame.MakeMove(move0);
return;
}
for(var i in posMap) {
var pos=posMap[i];
aGame.mWidget.find(".highlight[joc-pos="+pos+"]").show();
aGame.mWidget.find(".front[joc-pos="+pos+"]").show().bind(JocGame.CLICK,function() {
move.p.push(parseInt($(this).attr("joc-pos")));
if(move.p.length>1) {
$this.HuntClearInput(aGame);
$this.HuntAnimatePiece(aGame,$this.board[move.p[0]].i,move.p[move.p.length-1],function() {
Input();
});
} else
Input();
});
}
if(move.p.length>0) {
var pos=move.p[move.p.length-1];
aGame.mWidget.find(".highlight[joc-pos="+pos+"]").show().addClass("back");
aGame.mWidget.find(".front[joc-pos="+pos+"]").show().bind(JocGame.CLICK,function() {
if(move.p.length>1) {
var pieceIndex=$this.board[move.p[0]].i;
var coord=aGame.g.Coord[move.p[move.p.length-2]];
aGame.g.pieces[pieceIndex].css({
left: coord[0]-aGame.g.posSize/2,
top: coord[1]-aGame.g.posSize/2,
});
}
move.p.pop();
Input();
});
}
}
Input();
}
View.Board.HuntAnimatePiece=function(aGame,pieceIndex,to,fnt) {
var coord=aGame.g.Coord[to];
var x=coord[0];
var y=coord[1];
aGame.g.pieces[pieceIndex].animate({
left: x-aGame.g.posSize/2,
top: y-aGame.g.posSize/2,
},500,function() {
fnt();
});
}
View.Board.HuntAnimateDrop=function(aGame,pieceIndex,to,fnt) {
//JocLog("AnimateDrop",arguments);
if(pieceIndex<0)
for(pieceIndex=0;this.pieces[pieceIndex].s!=this.mWho || this.pieces[pieceIndex].p!=-2;pieceIndex++);
aGame.g.pieces[pieceIndex].css({
left: aGame.g.DockCoord[0],
top: aGame.g.DockCoord[1],
opacity: 1,
}).show();
this.HuntAnimatePiece(aGame,pieceIndex,to,function() {
fnt();
});
}
View.Board.HumanTurnEnd=function(aGame) {
this.HuntClearInput(aGame);
}
View.Board.PlayedMove=function(aGame,aMove) {
var $this=this;
var pieceIndex;
if(aMove.p.length==1) {
pieceIndex=this.board[aMove.p[0]].i;
this.HuntAnimateDrop(aGame,pieceIndex,aMove.p[0],function() {
aGame.MoveShown();
});
} else {
pieceIndex=aGame.mOldBoard.board[aMove.p[0]].i;
function AnimatePiece(posIndex) {
$this.HuntAnimatePiece(aGame,pieceIndex,aMove.p[posIndex],function() {
if(posIndex==aMove.p.length-1) {
if(typeof aMove.c!="undefined" && aMove.c.length>0) {
var vPieces=[];
for(var i in aMove.c)
vPieces.push(aGame.g.pieces[aGame.mOldBoard.board[aMove.c[i]].i]);
for(var i in vPieces)
vPieces[i].animate({opacity:0});
setTimeout(function() {
for(var i in vPieces)
vPieces[i].hide().css("opacity",0);
aGame.MoveShown();
},600);
} else
aGame.MoveShown();
} else
AnimatePiece(posIndex+1);
});
}
AnimatePiece(1);
}
return false;
}
View.Board.ShowEnd=function(aGame) {
return true;
}
View.Game.SpecificSkinHuntDrawPiece=function(canvas,who){
// to be overloaded
}
View.Game.HuntDrawPiece=function(canvas,who) {
if (this.mSkin!='official'){
this.SpecificSkinHuntDrawPiece(canvas,who);
}else{
var ctx=canvas[0].getContext("2d");
var l=canvas[0].width;
var m=l*0.2;
ctx.save();
ctx.beginPath();
ctx.fillStyle="rgba(0,0,0,0.2)";
ctx.arc(l/2,l/2+m/2,(l-m)/2,0,Math.PI*2,true);
ctx.fill();
var color=who==JocGame.PLAYER_B?"rgba(255,255,255,1)":"rgba(0,0,0,1)";
var invcol=who==JocGame.PLAYER_A?"rgba(0,0,0,1)":"rgba(255,255,255,1)";
var grad=ctx.createLinearGradient(0,0,0,l);
if (who==JocGame.PLAYER_B) {
grad.addColorStop(1, 'rgb(204,204,204)');
grad.addColorStop(0, 'rgb(255,255,255)');
} else {
grad.addColorStop(0, 'rgb(102,102,102)');
grad.addColorStop(1, 'rgb(0,0,0)');
}
ctx.fillStyle=grad;
ctx.lineWidth=1;
ctx.beginPath();
ctx.strokeStyle="rgba(128,128,128,0.8)";
ctx.arc(l/2,l/2,(l-m)/2,0,Math.PI*2,true);
ctx.closePath();
ctx.fill();
ctx.stroke();
ctx.beginPath();
ctx.strokeStyle="rgba(128,128,128,0.8)";
ctx.arc(l/2,l/2,(l-m)/2.2,0,Math.PI*2,true);
ctx.closePath();
ctx.stroke();
ctx.beginPath();
ctx.strokeStyle="rgba(128,128,128,0.8)";
ctx.arc(l/2,l/2,(l-m)/2.4,0,Math.PI*2,true);
ctx.closePath();
ctx.stroke();
ctx.restore();
}
}

View file

@ -0,0 +1,944 @@
/*
*
* 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 fullPath;
var WIDTH, HEIGHT, SSIZE;
var nbBoardLights=4;
View.Game.xdInitExtra = function(xdv) {
}
View.Game.xdPreInit = function(xdv) {
}
View.Game.xdInit = function(xdv) {
this.g.huntGameData={};
// init defaults
this.g.huntGameData.sceneXtras=[];
this.g.huntGameData.preyJumpsAtWalk=false;
this.g.huntGameData.clipwidth=155;
this.g.huntGameData.clipheight=155;
this.g.huntGameData.lightsIntensity=0.55;
this.g.huntGameData.jumpEatScale=1.0; // unit = cell size
this.g.huntGameData.jumpMoveScale=0.5; // unit = cell size
this.g.huntGameData.killPieceZTempo=-0.3; // unit = cell size
this.g.huntGameData.killPieceZFinal=-1; // unit = cell size
this.g.huntGameData.boardColOffset=0; // to center exotic boards
this.g.huntGameData.boardRowOffset=0; // to center exotic boards
this.g.huntGameData.targetColorSelected=0xddffdd; // to center exotic boards
this.g.huntGameData.soundMove=null; // to center exotic boards
this.g.huntGameData.soundJump=null; // to center exotic boards
this.g.huntGameData.soundEndJump=null; // to center exotic boards
this.g.huntGameData.boardSize=1;
this.g.huntGameData.boardStretch=true;
this.xdPreInit();
var huntGameData=this.g.huntGameData;
var hl=this.g.huntLayout;
var width0=hl.left+hl.boardWidth+hl.right;
var height0=hl.header+hl.boardHeight+hl.footer;
SSIZE=Math.floor(Math.min(
12000/width0,
12000/height0
));
WIDTH=width0*SSIZE;
HEIGHT=height0*SSIZE;
this.HuntMakeCoord();
for (var l=0;l<nbBoardLights;l++){
var r=8000;
var angle=Math.PI/4+(2*Math.PI/nbBoardLights)*l;
xdv.createGadget("blight#"+l, {
"3d": {
type: "custom3d",
create: function() {
var light = new THREE.SpotLight( 0xffffff, huntGameData.lightsIntensity );
light.castShadow = false;
light.shadow.camera.near = 3;
light.shadow.camera.far = 20;
light.shadow.camera.fov = 90;
light.shadow.mapSize.width = 1024;
light.shadow.mapSize.height = 1024;
/*light.shadowCascade = true;
light.shadowCascadeCount = 3;
light.shadowCascadeNearZ = [ -1.000, 0.995, 0.998 ];
light.shadowCascadeFarZ = [ 0.995, 0.998, 1.000 ];
light.shadowCascadeWidth = [ 1024, 1024, 1024 ];
light.shadowCascadeHeight = [ 1024, 1024, 1024 ];*/
var object3d = new THREE.Object3D();
var target = new THREE.Object3D();
object3d.add(target);
light.target = target;
object3d.add(light);
return object3d;
},
y: r*Math.sin(angle),
x: r*Math.cos(angle),
z: 6000,
}
});
}
for (var i=0;i<huntGameData.sceneXtras.length;i++){
xdv.createGadget(
huntGameData.sceneXtras[i].id,
huntGameData.sceneXtras[i].gadgetData
);
}
var ratio=(hl.header+hl.boardHeight+hl.footer)/(hl.left+hl.boardWidth+hl.right);
fullPath=this.mViewOptions.fullPath;
xdv.createGadget("board", {
"2d" : {
type : "image",
},
"3d": {
type : "custommesh3d",
rotateX: -90,
create: function() {
if (huntGameData.fieldMap!==undefined){
var $this = this ;
var nbToBeLoaded = 1;
if (huntGameData.fieldSpecMap!==undefined) nbToBeLoaded++;
var nbLoaded = 0;
var gg=new THREE.PlaneGeometry(12/((ratio>1)?ratio:1),12*((ratio<1)?ratio:1),1,1);
var diffuseMap=null;
var specMap=null;
var specColor=0x000000;
var shininess=0;
function checkAllLoaded(){
nbLoaded++;
if (nbLoaded==nbToBeLoaded){
var gm=new THREE.MeshPhongMaterial( {
color: 0xffffff,
map: diffuseMap,
specularMap: specMap,
specular: specColor,
shininess: shininess,
} );
var mesh=new THREE.Mesh(gg,gm);
mesh.rotation.z=Math.PI/2;
mesh.receiveShadow=true;
$this.objectReady(mesh);
}
}
var textureLoaderDiff = new THREE.TextureLoader();
//textureLoaderDiff.setCrossOrigin("anonymous");
textureLoaderDiff.load(
fullPath+huntGameData.fieldMap,
function(texture){
diffuseMap = texture ;
diffuseMap.wrapS = diffuseMap.wrapT = THREE.RepeatWrapping;
diffuseMap.format = THREE.RGBFormat;
checkAllLoaded();
}
);
if (huntGameData.fieldSpecMap!==undefined){
var textureLoaderSpec = new THREE.TextureLoader();
//textureLoaderSpec.setCrossOrigin("anonymous");
textureLoaderSpec.loadTexture(
fullPath+huntGameData.fieldSpecMap ,
function(texture){
specMap = texture ;
specMap.wrapS = specMap.wrapT = THREE.RepeatWrapping;
specMap.format = THREE.RGBFormat;
shininess=170;
specColor=0xffffff;
checkAllLoaded();
}
);
}
return null;
}else{
return null;
}
}
},
});
xdv.createGadget("boardframe",{
"3d": {
type: "meshfile",
file : fullPath+huntGameData.boardJSFile,
flatShading: true,
z : huntGameData.boardZ,
receiveShadow : true,
scale : [
huntGameData.boardSize/((ratio>1 && huntGameData.boardStretch)?ratio:1),
huntGameData.boardSize*((ratio<1 && huntGameData.boardStretch)?ratio:1),
huntGameData.boardSize],
},
});
var pieceIndex=0;
for(var who=0;who<2;who++) {
for(var i=0;i<this.g.initialPos[who].length;i++) {
var pos=this.g.initialPos[who][i];
var hunter= (this.g.catcher==1 && who==1) || (this.g.catcher==-1 && who==0);
var jsFile= hunter?(this.mViewOptions.fullPath + huntGameData.hunterJSFile):(this.mViewOptions.fullPath + huntGameData.preyJSFile);
var pieceScale= hunter?huntGameData.hunterScale:huntGameData.preyScale;
var pieceMorph= hunter?huntGameData.hunterMorph:huntGameData.preyMorph;
var z0=hunter?huntGameData.hunterZ0:huntGameData.preyZ0;
var preloadMat=hunter?huntGameData.hunterMaterialsPreload:huntGameData.preyMaterialsPreload;
var $this=this;
(function(jsf,preloadMat) {
xdv.createGadget("piece#"+(pieceIndex++), {
"2d": {
type : "sprite",
clipx : hunter?155:0,
clipy : 0,
clipwidth : huntGameData.clipwidth,
clipheight : huntGameData.clipheight,
width: SSIZE*.8,
height: SSIZE*.8,
file : $this.mViewOptions.fullPath + huntGameData.sprites,
z : hunter?3:4, // to let preys jump over hunters
},
"3d": {
type:"custommesh3d",
scale:[pieceScale,pieceScale,pieceScale],
morphing: pieceMorph,
z: z0,
create: function(cb){
var smooth=0;
var url="smoothedfilegeo|"+smooth+"|"+jsf;
var $this=this;
this.getResource(url,function(geometry0 , materials0){
//geometry.computeVertexNormals(); // needed in normals not exported in js file!
var materials1=[];
function Done() {
if(--tasks==0) {
var mesh = new THREE.Mesh( geometry0 , new THREE.MultiMaterial(materials1) ) ;
cb(mesh);
}
}
var tasks = 1;
for(var m=0;m<materials0.length;m++) {
(function(m) {
tasks++;
var newmat=materials0[m].clone();
if (newmat.name===preloadMat.matName){
$this.getMaterialMap(fullPath + preloadMat.matMap,function(matMap) {
newmat.map = matMap;
materials1[m] = newmat;
Done();
});
} else {
materials1[m] = newmat;
Done();
}
})(m);
}
Done();
});
return null;
}
},
});
})(jsFile,preloadMat);
}
}
for(var pos=0;pos<this.g.Graph.length;pos++) {
var coord=this.getCCoord(pos);
xdv.createGadget("cell#"+pos, {
"base":{
x : coord[0],
y : coord[1],
},
"2d": {
type : "element",
x : coord[0],
y : coord[1],
z : 2,
width : SSIZE*.9,
height : SSIZE*.9,
classes : "",
},
"3d" : {
type: "meshfile",
file : fullPath+huntGameData.targetJSFile,
flatShading: true,
smooth : 0,
z : -50,
castShadow: false,
scale: [0.8,0.8,0.8],
materials: {
"square" : {
transparent: true,
opacity: 0,
},
"ring" : {
color : 0xffffff,
//specular : 0x050505,
opacity: 0,
transparent: true,
}
},
},
});
(function(pos) {
xdv.createGadget("text#"+pos, {
"2d" : {
type : "element",
initialClasses: "xd-notation",
display : function(element, width, height) {
element.css({
"font-size" : (height * .6) + "pt",
"line-height" : (height * 1) + "px",
}).text(pos+1);
},
x : coord[0]-SSIZE*.3,
y : coord[1]-SSIZE*.3,
z : 1,
width : SSIZE*.2,
height : SSIZE*.2,
},
"3d": {
type: "custommesh3d",
//z: -cellSide*.05,
rotateX: -90,
create: function() {
var $this = this;
this.getResource('font|'+fullPath+
'/res/xd-view/fonts/helvetiker_regular.typeface.json',
function(font) {
var gg=new THREE.TextGeometry(""+(pos+1),{
size: 0.2,
height: 0.05,
curveSegments: 6,
font: font,
});
var gm=new THREE.MeshPhongMaterial();
var mesh= new THREE.Mesh( gg , gm );
$this.objectReady(mesh);
});
return null;
},
color: 0x888888,
x : coord[0]-SSIZE*.2,
y : coord[1]-SSIZE*.2,
z : 100,
},
});
})(pos);
}
function createScreen(videoTexture) {
var $this=this;
this.getResource("smoothedfilegeo|0|"+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.side = THREE.DoubleSide;
materials0.push(mat);
                   }else{
materials0.push(materials[i]);
}
}
var mesh = new THREE.Mesh( geometry , new THREE.MultiMaterial( materials0 ) );
var light = new THREE.SpotLight( 0xffffff, 5 );
//light.castShadow = true;
//light.shadowCameraVisible=true;
/*light.shadowDarkness = 1;
light.shadowCameraNear = 3;
light.shadowCameraFar = 20;
light.shadowCameraFov = 90;
light.shadowMapWidth = 1024;
light.shadowMapHeight = 1024;
light.shadowCascade = true;
light.shadowCascadeCount = 3;
light.shadowCascadeNearZ = [ -1.000, 0.995, 0.998 ];
light.shadowCascadeFarZ = [ 0.995, 0.998, 1.000 ];
light.shadowCascadeWidth = [ 1024, 1024, 1024 ];
light.shadowCascadeHeight = [ 1024, 1024, 1024 ];*/
light.position.set(0,0,2);
light.target=mesh;
mesh.add(light);
mesh.visible = false;
$this.objectReady(mesh);
});
return null;
};
xdv.createGadget("videoa",{
"3d": {
type : "video3d",
makeMesh: function(videoTexture){
createScreen.call(this,videoTexture);
},
},
});
xdv.createGadget("videob",{
"3d": {
type : "video3d",
makeMesh: function(videoTexture){
createScreen.call(this,videoTexture);
},
},
});
this.xdInitExtra(xdv);
}
View.Game.HuntMakeCoord=function() {
var hl=this.g.huntLayout;
var width0=hl.left+hl.boardWidth+hl.right;
var height0=hl.header+hl.boardHeight+hl.footer;
this.g.Coord=[];
for(var i=0;i<this.g.RC.length;i++) {
var rc=this.g.RC[i];
var row=rc[0];
var col=rc[1];
row+=this.g.huntGameData.boardRowOffset;
col+=this.g.huntGameData.boardColOffset;
var coord;
if(this.mViewAs==JocGame.PLAYER_A)
coord=[
(col+1)*SSIZE-width0*SSIZE*.5,
(row+1)*SSIZE-height0*SSIZE*.5,
];
else
coord=[
width0*SSIZE*.5-(col+1)*SSIZE,
height0*SSIZE*.5-(row+1)*SSIZE,
];
this.g.Coord.push(coord);
}
}
View.Game.xdBuildScene = function(xdv) {
var $this=this;
var huntGameData=this.g.huntGameData;
for (var l=0;l<nbBoardLights;l++){
xdv.updateGadget("blight#"+l, {
"3d" : {
visible: true,
}
});
}
for (var i=0;i<huntGameData.sceneXtras.length;i++){
xdv.updateGadget(
huntGameData.sceneXtras[i].id,
huntGameData.sceneXtras[i].gadgetUpdateData
);
}
xdv.updateGadget("boardframe",{
"3d":{
visible: true,
}
});
xdv.updateGadget("board",{
"base":{
visible: true,
},
"2d": {
rotate: this.mViewAs==JocGame.PLAYER_A?0:180,
x: 0,
y: 0,
width: WIDTH,
height: HEIGHT,
file : this.mViewOptions.fullPath + huntGameData.boardField2D,
},
"3d":{
receiveShadow: true,
visible: !(huntGameData.fieldMap===undefined),
}
});
for(var pos=0;pos<this.g.Graph.length;pos++) {
xdv.updateGadget("text#"+pos, {
"base" : {
visible: this.mNotation,
},
});
}
var screenZoom=huntGameData.screenScale;
xdv.updateGadget("videoa",{
"3d": {
visible: true,
scale:[screenZoom,screenZoom,screenZoom],
rotate: this.mViewAs==1?180:0,
rotateX: this.mViewAs==1?30:-30,
z: 3000,
y: this.mViewAs==1?huntGameData.screenDist:-huntGameData.screenDist,
playerSide: 1,
},
});
xdv.updateGadget("videob",{
"3d": {
visible: true,
scale:[screenZoom,screenZoom,screenZoom],
rotate: this.mViewAs==1?0:180,
rotateX: this.mViewAs==1?-30:30,
z: 3000,
y: this.mViewAs==1?-huntGameData.screenDist:huntGameData.screenDist,
playerSide: -1,
},
});
}
View.Game.getCCoord=function(pos) {
return this.g.Coord[pos];
}
View.Board.xdDisplay = function(xdv, aGame) {
for(var i=0;i<this.pieces.length;i++) {
var piece=this.pieces[i];
switch(piece.p) {
case -2:
var coord=aGame.GetOffBoardCoord(i,SSIZE);
xdv.updateGadget("piece#"+i, {
"base": {
visible: true,
x: coord[0],
y: coord[1],
rotate:180,
},
});
break;
case -1:
xdv.updateGadget("piece#"+i, {
"base": {
visible: false,
},
});
break;
default:
var hunter= aGame.g.catcher!=piece.s;
var z0=hunter?aGame.g.huntGameData.hunterZ0:aGame.g.huntGameData.preyZ0;
var coord=aGame.getCCoord(piece.p);
xdv.updateGadget("piece#"+i, {
"base": {
visible: true,
x: coord[0],
y: coord[1],
},
"2d": {
opacity: 1,
},
"3d":{
rotate: piece.a,
z: z0,
}
});
break;
}
}
}
View.Board.xdBuildHTStateMachine = function(xdv, htsm, aGame) {
var $this=this;
var move={p:[]};
var moves=[];
if(aGame.g.useDrop)
moves=this.HuntGetAllDropMoves(aGame);
if(moves.length==0)
moves=this.HuntGetAllMoves(aGame);
var pieceIndex=-1;
var killPieceIndex=-1;
function Highlight(pos,capt,type) {
var piece=null;
var pieceIndex1=-1;
if(pieceIndex>=0 && pos==move.p[move.p.length-1])
pieceIndex1=pieceIndex;
else if($this.board[pos])
pieceIndex1=$this.board[pos].i;
if(pieceIndex1>=0)
piece=$this.pieces[pieceIndex1];
var color;
var event;
var classes;
switch(type) {
case "normal":
event="E_CLICKED";
color=aGame.g.huntGameData.targetColorSelected
classes="highlight";
break;
case "cancel":
event="E_CANCEL";
color=0xff4400;
classes="back";
break;
case "confirm":
event="E_CONFIRM";
color=0x00ff00;
classes="confirm";
break;
}
function SendEvent() {
htsm.smQueueEvent(event, {pos:pos,capt:capt,type:type});
}
var showTarget=(aGame.mShowMoves||(type=="cancel")||(type=="confirm"));
xdv.updateGadget("cell#"+pos,{
"base": {
visible: true,
click : SendEvent,
},
"2d": {
classes: classes,
opacity: (aGame.mShowMoves || type=="cancel" || type=="confirm")?.5:0,
},
"3d" : {
castShadow: false, //aGame.mShowMoves,
receiveShadow: true,
materials: {
"square" : {
},
"ring" : {
//shininess : 0,
//reflectivity: 0,
color : color, //type=="cancel"?0xff4400:0x000000,
opacity: (showTarget)?1:0,
transparent: !showTarget,
}
},
}
});
if(piece)
xdv.updateGadget("piece#"+pieceIndex1,{
"base": {
visible: true,
click : function() {
SendEvent();
}
},
"2d": {
},
});
}
function Init(args) {
}
function Clean(args) {
for ( var pos = 0; pos < aGame.g.Coord.length; pos++) {
xdv.updateGadget("cell#" + pos, {
"base" : {
visible : false,
click : null,
},
"2d" : {
classes: "",
},
"3d":{
materials: {
"ring" : {
opacity: 0,
transparent: true,
}
}
}
});
}
for( var i in $this.pieces) {
var piece=$this.pieces[i];
xdv.updateGadget("piece#"+i, {
"base" : {
click : null,
},
});
}
}
function Select(args) {
var matchingMoves=[];
for(var i=0;i<moves.length;i++) {
var m=moves[i];
var keep=true;
for(var j=0;j<move.p.length;j++) {
if(m.p[j]!=move.p[j]) {
keep=false;
break;
}
}
if(keep)
matchingMoves.push(m);
}
if(matchingMoves.length==1 && move.p.length==matchingMoves[0].p.length) {
htsm.smQueueEvent("E_DONE",{move:matchingMoves[0]});
return;
}
if(move.p.length>1){
Highlight(move.p[move.p.length-2],null,"cancel");
Highlight(move.p[move.p.length-1],null,"confirm");
}
else if(move.p.length>0)
Highlight(move.p[move.p.length-1],null,"cancel");
nextPoss={};
for(var i=0;i<matchingMoves.length;i++) {
var m=matchingMoves[i];
nextPoss[m.p[move.p.length]]=move.p.length<1?null:(m.c!==undefined?m.c[move.p.length-1]:null);
}
for(var pos in nextPoss) {
Highlight(pos,nextPoss[pos],"normal");
}
}
function Animate(args) {
if(move.p.length<=1)
htsm.smQueueEvent("E_ANIM_DONE",{});
else {
var angle=$this.HuntAngle(aGame,move.p[move.p.length-2],move.p[move.p.length-1]);
$this.HuntAnimatePiece(xdv,aGame,pieceIndex,move.p[move.p.length-2],move.p[move.p.length-1],angle,killPieceIndex,function() {
htsm.smQueueEvent("E_ANIM_DONE",{});
});
}
}
function SaveSegment(args) {
if(pieceIndex<0)
pieceIndex=$this.board[args.pos].i;
xdv.saveGadgetProps("piece#"+pieceIndex,["x","y","z","rotate","opacity"],"piece-"+move.p.length);
move.p.push(args.pos);
if(args.capt!==null) {
if(move.c===undefined)
move.c=[];
killPieceIndex=$this.board[args.capt].i;
xdv.saveGadgetProps("piece#"+killPieceIndex,["z"],"alive");
move.c.push(args.capt);
}
}
function SendMove(args) {
aGame.MakeMove(move);
}
function CancelLastClick(args) {
move.p.splice(move.p.length-1);
xdv.restoreGadgetProps("piece#"+pieceIndex,"piece-"+move.p.length);
if(move.p.length==0)
pieceIndex=-1;
if(move.c!==undefined) {
if(killPieceIndex>=0)
xdv.restoreGadgetProps("piece#"+killPieceIndex,"alive");
move.c.splice(move.c.length-1);
if(move.c.length==0) {
killPieceIndex=-1;
delete move.c;
} else
killPieceIndex=$this.board[move.c[move.c.length-1]].i;
}
}
function AnimateVanish(args) {
$this.HuntAnimateVanish(xdv,aGame,move.c,function() {
htsm.smQueueEvent("E_ANIM_DONE",{});
});
}
htsm.smTransition("S_INIT", "E_INIT", "S_SELECT", [ Init ]);
htsm.smEntering("S_SELECT", [ Select ]);
htsm.smTransition("S_SELECT", "E_CONFIRM","S_ANIMATING_VANISH", [ AnimateVanish ]);
htsm.smTransition("S_SELECT", "E_ENTER","S_ANIMATING", [ Animate ]);
htsm.smTransition("S_SELECT", "E_CLICKED","S_ANIMATING", [ SaveSegment,Animate ]);
htsm.smTransition("S_SELECT", "E_CANCEL",null, [ Clean,CancelLastClick,Select ]);
htsm.smTransition("S_SELECT", "E_DONE", "S_ANIMATING_VANISH", [ AnimateVanish ]);
htsm.smLeaving("S_SELECT", [ Clean ]);
htsm.smTransition("S_ANIMATING","E_ANIM_DONE","S_SELECT",[]);
htsm.smTransition("S_ANIMATING_VANISH","E_ANIM_DONE",null,[SendMove]);
htsm.smTransition(["S_SELECT","S_ANIMATING","S_ANIMATING_VANISH"],"E_END","S_DONE",[]);
htsm.smEntering("S_DONE",[Clean]);
}
View.Board.xdPlayedMove = function(xdv, aGame, aMove) {
var $this=this;
var pieceIndex0=aGame.mOldBoard.board[aMove.p[0]].i;
if(aMove.p.length==0)
this.HuntAnimateDrop(xdv,aGame,pieceIndex0,aMove.p[0],function() {
aGame.mOldBoard.HuntAnimateVanish(xdv,aGame,aMove.c,function() {
aGame.MoveShown();
});
});
else {
var index=0;
function AnimateSegment() {
if(++index==aMove.p.length)
aGame.mOldBoard.HuntAnimateVanish(xdv,aGame,aMove.c,function() {
aGame.MoveShown();
});
else {
var angle=$this.HuntAngle(aGame,aMove.p[index-1],aMove.p[index]);
var killPieceIndex=-1;
if(aMove.c!==undefined && aMove.c.length>index-1)
killPieceIndex=aGame.mOldBoard.board[aMove.c[index-1]].i;
$this.HuntAnimatePiece(xdv,aGame,pieceIndex0,aMove.p[index-1],aMove.p[index],angle,killPieceIndex,AnimateSegment);
}
}
AnimateSegment();
}
return false;
}
View.Board.HuntAnimatePiece=function(xdv,aGame,pieceIndex,from,to,angle,killPieceIndex,fnt) {
var coord=aGame.getCCoord(to);
var seqIndex=0;
var hunter= aGame.g.catcher!=this.mWho;
var huntGameData=aGame.g.huntGameData;
var sequence=huntGameData.sequences[hunter?"hunter":"prey"][((!hunter)&&(killPieceIndex>=0))?"jump":"walk"];
var endMorph=hunter?huntGameData.hunterMorph:huntGameData.preyMorph;
var nbSteps=sequence.length;
var z0=hunter?aGame.g.huntGameData.hunterZ0:aGame.g.huntGameData.preyZ0;
var z1=z0;
var jump=(killPieceIndex>=0);
if(!hunter) {
if(jump)
z1+=SSIZE*huntGameData.jumpEatScale;
else
if (huntGameData.preyJumpsAtWalk)
z1+=SSIZE*huntGameData.jumpMoveScale;
}
var z2=z0;
var c=z0;
var S1=c-z1;
var S2=c-z2;
var A=-1;
var B=4*S1-2*S2;
var C=-S2*S2;
var D=B*B-4*A*C;
var a1=(-B-Math.sqrt(D))/(2*A);
var a2=(-B+Math.sqrt(D))/(2*A);
var a=a1;
var b=-a-S2;
if(a==0 || -b/(2*a)<0 || -b/(2*a)>1) {
a=a2;
b=-a-S2;
}
var coord0=aGame.getCCoord(from);
var morphTime=550/nbSteps;
function Move() {
var morphStep=sequence[seqIndex++];
if(seqIndex<=nbSteps) {
xdv.updateGadget("piece#"+pieceIndex, {
"base": {
x : coord0[0]+(coord[0]-coord0[0])*(seqIndex/sequence.length),
y : coord0[1]+(coord[1]-coord0[1])*(seqIndex/sequence.length),
},
"3d":{
positionEasing: (typeof(TWEEN)=="undefined")?null:TWEEN.Easing.Linear.EaseNone,
morphingEasing: (typeof(TWEEN)=="undefined")?null:TWEEN.Easing.Linear.EaseNone,
morphing: morphStep,
positionEasingUpdate: function(ratio) {
var ratio0=(seqIndex-1)/nbSteps+ratio*1/nbSteps;
var y=(a*ratio0*ratio0+b*ratio0+c)*this.SCALE3D;
this.object3d.position.y=y;
},
}
},morphTime,Move);
} else {
if (jump) aGame.PlaySound(huntGameData.soundEndJump);
xdv.updateGadget("piece#"+pieceIndex, {
"base": {
x: coord[0],
y: coord[1],
},
"3d":{
morphing: endMorph,
z: z2,
}
},morphTime,fnt);
}
}
xdv.updateGadget("piece#"+pieceIndex, {
"3d":{
rotate: angle,
}
},250,function() {
if(killPieceIndex>=0) {
xdv.updateGadget("piece#"+killPieceIndex, {
"3d":{
"z": huntGameData.killPieceZTempo*SSIZE,
positionEasingUpdate: null,
}
},400);
}
if (!jump) aGame.PlaySound(huntGameData.soundMove);
Move();
});
}
View.Board.HuntAnimateDrop=function(xdv,aGame,pieceIndex,to,fnt) {
var coord=aGame.getCCoord(to);
xdv.updateGadget("piece#"+pieceIndex, {
"base": {
x: coord[0],
y: coord[1],
},
},500,fnt);
}
View.Board.HuntAnimateVanish=function(xdv,aGame,capts0,fnt) {
if(capts0===undefined || capts0.length==0)
fnt();
else {
var animCount=0;
var capts={};
for(var i=0;i<capts0.length;i++)
capts[capts0[i]]=true;
function AnimEnd() {
if(--animCount==0)
fnt();
}
for(var pos in capts) {
animCount++;
xdv.updateGadget("piece#"+this.board[pos].i,{
"base": {
opacity: 0,
},
"3d": {
z: aGame.g.huntGameData.killPieceZFinal*SSIZE,
}
},500,AnimEnd);
}
}
}
})();

95
src/games/hunt/hunt.css Normal file
View file

@ -0,0 +1,95 @@
.background {
position: absolute;
z-index: 0;
overflow: hidden;
}
.area {
position: absolute;
z-index: 10;
}
.area-canvas {
position: absolute;
z-index: 11;
}
.layout {
position: absolute;
z-index: 20;
}
.layout {
position: absolute;
z-index: 20;
}
.notation {
position: absolute;
z-index: 40;
text-align: center;
color: #990000;
font-weight: bold;
}
.piece, .piece-dock {
position: absolute;
z-index: 30;
}
.piece-count {
position: absolute;
z-index: 29;
text-align: center;
font-weight: bold;
font-family: Times New Roman, cursive;
}
.highlight {
background-color: rgba(0,255,0,0.5);
border-radius: 50%;
}
.back {
background-color: rgba(255,100,0,0.8);
border-radius: 50%;
}
.confirm {
background-color: rgba(0,255,0,0.9);
border-radius: 50%;
}
.front {
position: absolute;
z-index: 50;
cursor: pointer;
background-color: rgba(0,0,0,0);
}
.xd-notation {
color: White;
text-shadow: 2px 2px #333333;
}
/*
.layout-board {
background-color: rgba(0,255,0,0.2);
}
.layout-header {
background-color: rgba(255,0,0,0.2);
}
.layout-footer {
background-color: rgba(0,0,255,0.2);
}
.layout-left {
background-color: rgba(255,255,0,0.2);
}
.layout-right {
background-color: rgba(255,0,255,0.2);
}
*/

185
src/games/hunt/index.js Normal file
View file

@ -0,0 +1,185 @@
var mvs = {
"models": {
"decercarlaliebre": {
"plazza": "true",
"title-en": "De cercar la liebre",
"module": "hunt",
"js": [
"hunt-model.js",
"decercarlaliebre-model.js"
],
"defaultHuman": 1,
"gameOptions": {
"preventRepeat": true,
"uctTransposition": "state",
"uctIgnoreLoop": false,
"levelOptions": {
"pieceCount0": 12000000,
"pieceCount1": 1000000,
"dist20": 15,
"freeZone0": 400,
"openRisk0": 200,
"forkRisk0": 400,
"catcheeGroups0": 300
}
},
"levels": [
{
"ai": "uct",
"c": 0.4,
"playoutDepth": 0,
"minVisitsExpand": 1,
"ignoreLeaf": false,
"uncertaintyFactor": 5,
"propagateMultiVisits": false,
"playoutCeil": 1,
"log": true,
"label": "Easy",
"isDefault": true,
"maxDuration": 1,
"maxNodes": 1500,
"maxLoops": 250
},
{
"ai": "uct",
"c": 0.4,
"playoutDepth": 0,
"minVisitsExpand": 1,
"ignoreLeaf": false,
"uncertaintyFactor": 5,
"propagateMultiVisits": false,
"playoutCeil": 1,
"log": true,
"label": "Medium",
"maxDuration": 2,
"maxNodes": 2500,
"maxLoops": 500
},
{
"ai": "uct",
"c": 0.4,
"playoutDepth": 0,
"minVisitsExpand": 1,
"ignoreLeaf": false,
"uncertaintyFactor": 5,
"propagateMultiVisits": false,
"playoutCeil": 1,
"log": true,
"label": "Strong",
"maxDuration": 5
}
],
"defaultLevel": 2,
"summary": "Middle age hunt game",
"rules": {
"en": "decercarlaliebre-rules.html",
"fr": "decercarlaliebre-rules-fr.html"
},
"credits": {
"en": "decercarlaliebre-credits.html",
"fr": "decercarlaliebre-credits-fr.html"
},
"description": {
"en": "decercarlaliebre-description.html",
"fr": "decercarlaliebre-description-fr.html"
},
"thumbnail": "decercarlaliebre-thumbnail.png",
"strings": []
}
},
"views": {
"decercarlaliebre": {
"title-en": "De cercar la liebre View",
"module": "hunt",
"js": [
"hunt-xd-view.js",
"decercarlaliebre-xd-view.js"
],
"visuals": {
"600x600": [
"res/visuals/decercar-600x600-3d.jpg",
"res/visuals/decercar-600x600-2d.jpg"
]
},
"xdView": true,
"css": [
"hunt.css",
"decercarlaliebre.css"
],
"preferredRatio": 1,
"switchable": false,
"useShowMoves": true,
"useNotation": true,
"animateSelfMoves": false,
"skins": [
{
"name": "decercarlaliebre3d",
"title": "3D Classic",
"3d": true,
"camera": {
"radius": 14,
"elevationAngle": 45,
"limitCamMoves": true
},
"world": {
"lightIntensity": 0,
"skyLightIntensity": 0,
"color": 3355443,
"fog": false,
"lightPosition": {
"x": -5,
"y": 18,
"z": 5
},
"lightShadowDarkness": 0.25,
"ambientLightColor": 1118481
},
"preload": [
"image|/res/xd-view/meshes/liebre/hunter.jpg",
"image|/res/xd-view/meshes/liebre/rabbitskin4.jpg",
"image|/res/xd-view/meshes/liebre/liebreboardsimple.jpg",
"image|/res/xd-view/meshes/liebre/liebreboard.jpg",
"smoothedfilegeo|0|/res/xd-view/meshes/board.js",
"smoothedfilegeo|0|/res/xd-view/meshes/liebre/hunter2.js",
"smoothedfilegeo|0|/res/xd-view/meshes/liebre/liebre6.js",
"smoothedfilegeo|0|/res/xd-view/meshes/target.js"
]
},
{
"name": "medieval",
"title": "Medieval"
}
],
"defaultOptions": {
"sounds": true,
"notation": false,
"moves": true
}
}
}
};
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];
});

View file

@ -0,0 +1,3 @@
<p>TODO: credit people, countries, tribes, ...</p>
<p>Jocly development: Michel gutierrez (@<a target="_blank" href="http://twitter.com/_mig_">_mig_</a>).</p>
<p>Graphic design: Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>).</p>

View file

@ -0,0 +1,2 @@
<p>TODO: game description with images, references, ...</p>

View file

@ -0,0 +1,27 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
Model.Game.InitGame = function() {
var $this=this;
this.HuntInitGame();
Object.assign(this.g.huntOptions,{
compulsaryCatch: true,
catchLongestLine: true,
multipleCatch: true,
});
this.HuntMakeGrid({});
this.g.catcher=JocGame.PLAYER_A;
this.g.catcherMin=1;
this.g.catcheeMin=10;
this.g.initialPos=[[12],[10,14,17,16,18,22,15,19,21,23,20,24]];
this.HuntPostInitGame();
}

View file

@ -0,0 +1,3 @@
<p>TODO: writes rules</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View file

@ -0,0 +1,19 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
View.Game.GameSpecificInit=function(){
if (this.mSkin=='indian'){
$(".area-canvas,.highlight").addClass("indian");
}
}
View.Game.SpecificSkinHuntDrawPiece=function(canvas,who){
if (this.mSkin=='indian'){
// we do not draw, we css :)
canvas.addClass(who==JocGame.PLAYER_B?"indian-black":"indian-white");
}
}

View file

@ -0,0 +1,27 @@
.area-canvas.indian{
background-image: url(res/images/koapppawna/koapppawna.jpg);
background-size: contain;
background-repeat: none;
}
.piece.indian-black{
background-image: url(res/images/koapppawna/rabbit.png);
background-size: contain;
background-repeat: none;
}
.piece.indian-white{
background-image: url(res/images/koapppawna/sqaw.png);
background-size: contain;
background-repeat: none;
}
.highlight.indian{
z-index: 40;
background: none;
background-image: url(res/images/koapppawna/ring.png);
background-size: contain;
background-repeat: none;
}
.indian.back{
background-image: url(res/images/koapppawna/undo.png);
}

View file

@ -0,0 +1,3 @@
<p>TODO: credit people, countries, tribes, ...</p>
<p>Jocly development: Michel gutierrez (@<a target="_blank" href="http://twitter.com/_mig_">_mig_</a>).</p>
<p>Graphic design: Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>).</p>

View file

@ -0,0 +1,2 @@
<p>TODO: game description with images, references, ...</p>

View file

@ -0,0 +1,125 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
Model.Game.InitGame = function() {
var $this=this;
this.HuntInitGame();
Object.assign(this.g.huntOptions,{
compulsaryCatch: true,
catchLongestLine: true,
multipleCatch: true,
});
Object.assign(this.g.huntEval,{
pieceCount: 1000000,
distHome: 100,
catcheeAtHome: 100,
});
this.HuntMakeGrid({});
function Connect(pos0,pos1,dir0,dir1) {
$this.g.Graph[pos0][dir0]=pos1;
$this.g.Graph[pos1][dir1]=pos0;
}
Connect(10,6,4,5);
Connect(6,2,4,5);
Connect(20,16,4,5);
Connect(16,12,4,5);
Connect(12,8,4,5);
Connect(8,4,4,5);
Connect(22,18,4,5);
Connect(18,14,4,5);
Connect(0,6,6,7);
Connect(6,12,6,7);
Connect(12,18,6,7);
Connect(18,24,6,7);
Connect(10,16,6,7);
Connect(16,22,6,7);
Connect(2,8,6,7);
Connect(8,14,6,7);
this.g.RC.push([-0.9,1.1]); // 25
this.g.RC.push([-0.9,2]); // 26
this.g.RC.push([-0.9,2.9]); // 27
this.g.RC.push([-1.6,0.4]); // 28
this.g.RC.push([-1.6,2]); // 29
this.g.RC.push([-1.6,3.6]); // 30
for(var i=25;i<=30;i++)
this.g.Graph[i]=[null,null,null,null,null,null,null,null];
Connect(2,25,7,6);
Connect(25,28,7,6);
Connect(2,27,4,5);
Connect(27,30,4,5);
Connect(25,26,3,2);
Connect(26,27,3,2);
Connect(28,29,3,2);
Connect(29,30,3,2);
Connect(2,26,0,1);
Connect(26,29,0,1);
this.g.catcher=JocGame.PLAYER_A;
this.g.catcherMin=1;
this.g.catcheeMin=10;
this.g.initialPos=[[26],[10,14,15,16,17,18,19,20,21,22,23,24]];
this.HuntPostInitGame();
}
Model.Board.Evaluate = function(aGame,aFinishOnly,aTopLevel) {
var evalData=this.HuntMakeEvalData(aGame);
this.mEvaluation=0;
/*this.mEvaluation+=this.HuntEvaluatePieceCount(aGame,evalData)*aGame.g.huntEval.pieceCount;
var freeZoneCount=this.HuntEvaluateFreeZone(aGame,evalData);
this.mEvaluation+=freeZoneCount*evalData.catcher*aGame.g.huntEval.freeZone;
this.mEvaluation+=this.HuntEvaluateDistToCatcher(aGame,evalData)*evalData.catcher*aGame.g.huntEval.distToCatcher;
var distCatcherHome=aGame.HuntDist(evalData.catcherPieces[0].p,29);
var catcheeCloserCount=0;
var catchees=[];
for(var i in evalData.catcheePieces) {
var piece=evalData.catcheePieces[i];
var dist=aGame.HuntDist(piece.p,29);
catchees.push(dist);
if(dist<=distCatcherHome)
catcheeCloserCount++;
}
if(catcheeCloserCount>=7) {
catchees.sort(function(a,b) {
return a-b;
});
var dist=0;
for(var i=0;i<5;i++)
dist+=catchees[i];
this.mEvaluation+=(50-dist)*evalData.catchee*aGame.g.huntEval.distHome;
}
var homeCount=0;
var catcherAtHome=false;
var homePoss=[25,26,27,28,29,30,2];
for(var i in homePoss) {
var pos=homePoss[i];
var piece=this.board[pos];
if(piece!=null) {
if(piece.s==evalData.catcher)
catcherAtHome=true;
else
homeCount++;
}
}
if(homeCount==7) {
this.mFinished=true;
this.mWinner=evalData.catchee;
}
this.mEvaluation+=homeCount*evalData.catchee*aGame.g.huntEval.catcheeAtHome;*/
}

View file

@ -0,0 +1,3 @@
<p>TODO: writes rules</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1,30 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
View.Game.InitView=function() {
this.HuntInitView();
$.extend(this.g.huntLayout,{
header: 1,
boardHeight: 6.6,
footer: 1,
});
this.HuntBuildLayout();
this.HuntMakeCoord();
this.HuntDrawBoard();
this.HuntMakePieces();
if (this.mSkin=='peruvian') {
$(".area-canvas,.highlight").addClass("peruvian");
}
}
View.Game.SpecificSkinHuntDrawPiece=function(canvas,who){
if (this.mSkin=='peruvian'){
// we do not draw, we css :)
canvas.addClass(who==JocGame.PLAYER_B?"peruvian-black":"peruvian-white");
}
}

View file

@ -0,0 +1,67 @@
/*
*
* 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.
*
*/
View.Game.xdPreInit = function(xdv) {
this.g.AisWhite=false;
this.g.huntLayout={
header: 1,
boardHeight: 6,
footer: 1,
left: 1,
boardWidth: 4,
right: 1,
};
this.g.huntGameData.lightsIntensity=0.55;
this.g.huntGameData.boardRowOffset=2;
this.g.huntGameData.sprites="/res/xd-view/meshes/kukuli/tokens.png";
this.g.huntGameData.boardJSFile="/res/xd-view/meshes/board.js";
this.g.huntGameData.hunterJSFile="/res/xd-view/meshes/kukuli/kukuli2.js";
this.g.huntGameData.preyJSFile="/res/xd-view/meshes/kukuli/ukuku2.js";
this.g.huntGameData.targetJSFile="/res/xd-view/meshes/target.js";
this.g.huntGameData.preyScale=0.5;
this.g.huntGameData.hunterScale=0.5;
this.g.huntGameData.boardSize=1.23;
this.g.huntGameData.boardZ=0;
this.g.huntGameData.preyZ0=0;
this.g.huntGameData.hunterZ0=0;
this.g.huntGameData.screenDist=12000;
this.g.huntGameData.screenScale=4.5;
this.g.huntGameData.fieldMap="/res/xd-view/meshes/kukuli/kukuliboard.jpg";
this.g.huntGameData.fieldSpecMap="/res/xd-view/meshes/kukuli/kukuliboard-specular.jpg";
this.g.huntGameData.boardField2D=this.g.huntGameData.fieldMap;
this.g.huntGameData.soundMove="move"; // to center exotic boards
this.g.huntGameData.soundEndJump="jumpend"; // to center exotic boards
this.g.huntGameData.targetColorSelected=0x333333;
this.g.huntGameData.preyMorph=[1];
this.g.huntGameData.hunterMorph=[1];
this.g.huntGameData.sequences=[];
this.g.huntGameData.sequences["prey"]=[];
this.g.huntGameData.sequences["prey"]["walk"]=[
[1],
];
this.g.huntGameData.sequences["prey"]["jump"]=[
[1],
];
this.g.huntGameData.sequences["hunter"]=[];
this.g.huntGameData.sequences["hunter"]["walk"]=[
[1],
];
}
View.Game.xdInitExtra = function(xdv){
}

27
src/games/hunt/kukuli.css Normal file
View file

@ -0,0 +1,27 @@
.area-canvas.peruvian{
background-image: url(res/images/kukuli/kukuli.jpg);
background-size: contain;
background-repeat: none;
}
.piece.peruvian-black{
background-image: url(res/images/kukuli/bear.png);
background-size: contain;
background-repeat: none;
}
.piece.peruvian-white{
background-image: url(res/images/kukuli/girl.png);
background-size: contain;
background-repeat: none;
}
.highlight.peruvian{
z-index: 40;
background: none;
background-image: url(res/images/kukuli/ring.png);
background-size: contain;
background-repeat: none;
}
.peruvian.back{
background-image: url(res/images/kukuli/undo.png);
}

View file

@ -0,0 +1,3 @@
<p>TODO: credit people, countries, tribes, ...</p>
<p>Jocly development: Michel gutierrez (@<a target="_blank" href="http://twitter.com/_mig_">_mig_</a>).</p>
<p>Graphic design: Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>).</p>

View file

@ -0,0 +1,2 @@
<p>TODO: game description with images, references, ...</p>

View file

@ -0,0 +1,198 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
Model.Game.InitGame = function() {
var $this=this;
this.HuntInitGame();
Object.assign(this.g.huntOptions,{
compulsaryCatch: true,
catchLongestLine: false,
multipleCatch: false,
});
$.extend(this.g.huntEval,{
});
function Connect(pos0,pos1,dir0,dir1) {
$this.g.Graph[pos0][dir0]=pos1;
$this.g.Graph[pos1][dir1]=pos0;
}
var c0=3,r0=3,d0=2.5,d=1,s=0.25,h=0.4;
var alpha=Math.PI/5;
var pointsRef=[ // from drawing with 100pix for 1 col/line (margin included)
[400,532],
[236,437],
[287,378],
[359,346],
[437,346],
[513,379],
[560,437],
[168,397],
[240,313],
[342,267],
[456,268],
[557,313],
[629,398],
[100,358],
[194,250],
[326,190],
[471,191],
[604,250],
[698,359],
[146,186],
[310,113],
[487,113],
[650,186],
];
for(var i in pointsRef) {
var point=pointsRef[i];
var pointCR=[(point[1]-100)/100,(point[0]-100)/100];
//var pointCR=[point[1],point[0]];
this.g.Graph.push([]);
this.g.RC.push(pointCR);
}
Connect(0,2,7,6);
Connect(2,8,7,6);
Connect(8,14,7,6);
Connect(14,19,7,6);
Connect(0,3,5,4);
Connect(3,9,5,4);
Connect(9,15,5,4);
Connect(15,20,5,4);
Connect(0,4,3,2);
Connect(4,10,3,2);
Connect(10,16,3,2);
Connect(16,21,3,2);
Connect(0,5,1,0);
Connect(5,11,1,0);
Connect(11,17,1,0);
Connect(17,22,1,0);
Connect(1,7,7,6);
Connect(7,13,7,6);
Connect(6,12,1,0);
Connect(12,18,1,0);
Connect(1,2,9,8);
Connect(2,3,9,8);
Connect(3,4,9,8);
Connect(4,5,9,8);
Connect(5,6,9,8);
Connect(7,8,9,8);
Connect(8,9,9,8);
Connect(9,10,9,8);
Connect(10,11,9,8);
Connect(11,12,9,8);
Connect(13,14,9,8);
Connect(14,15,9,8);
Connect(15,16,9,8);
Connect(16,17,9,8);
Connect(17,18,9,8);
Connect(19,20,9,8);
Connect(20,21,9,8);
Connect(21,22,9,8);
/*var points=[
[r0,c0],
[r0-h,c0-d0-s],
[r0-h,c0+d0+s],
[r0-d0*Math.sin(alpha),c0-d0*Math.cos(alpha)],
[r0-d0*Math.sin(alpha),c0+d0*Math.cos(alpha)],
[r0-d0*Math.sin(2*alpha),c0-d0*Math.cos(2*alpha)],
[r0-d0*Math.sin(2*alpha),c0+d0*Math.cos(2*alpha)],
[r0-(d0+d)*Math.sin(alpha),c0-(d0+d)*Math.cos(alpha)],
[r0-(d0+d)*Math.sin(alpha),c0+(d0+d)*Math.cos(alpha)],
[r0-(d0+d)*Math.sin(2*alpha),c0-(d0+d)*Math.cos(2*alpha)],
[r0-(d0+d)*Math.sin(2*alpha),c0+(d0+d)*Math.cos(2*alpha)],
[r0-(d0+2*d)*Math.sin(alpha),c0-(d0+2*d)*Math.cos(alpha)],
[r0-(d0+2*d)*Math.sin(alpha),c0+(d0+2*d)*Math.cos(alpha)],
[r0-(d0+2*d)*Math.sin(2*alpha),c0-(d0+2*d)*Math.cos(2*alpha)],
[r0-(d0+2*d)*Math.sin(2*alpha),c0+(d0+2*d)*Math.cos(2*alpha)],
[r0-(d0+3*d)*Math.sin(alpha),c0-(d0+3*d)*Math.cos(alpha)],
[r0-(d0+3*d)*Math.sin(alpha),c0+(d0+3*d)*Math.cos(alpha)],
[r0-(d0+3*d)*Math.sin(2*alpha),c0-(d0+3*d)*Math.cos(2*alpha)],
[r0-(d0+3*d)*Math.sin(2*alpha),c0+(d0+3*d)*Math.cos(2*alpha)],
[r0-h-d*Math.sin(alpha),c0-d0-d*Math.cos(alpha)-s],
[r0-h-2*d*Math.sin(alpha),c0-d0-2*d*Math.cos(alpha)-s],
[r0-h-d*Math.sin(alpha),c0+d0+d*Math.cos(alpha)+s],
[r0-h-2*d*Math.sin(alpha),c0+d0+2*d*Math.cos(alpha)+s],
];
for(var i in points) {
var point=points[i];
this.g.Graph.push([]);
this.g.RC.push(point);
}
Connect(0,3,7,6);
Connect(3,7,7,6);
Connect(7,11,7,6);
Connect(11,15,7,6);
Connect(0,5,5,4);
Connect(5,9,5,4);
Connect(9,13,5,4);
Connect(13,17,5,4);
Connect(0,6,3,2);
Connect(6,10,3,2);
Connect(10,14,3,2);
Connect(14,18,3,2);
Connect(0,4,1,0);
Connect(4,8,1,0);
Connect(8,12,1,0);
Connect(12,16,1,0);
Connect(1,19,7,6);
Connect(19,20,7,6);
Connect(2,21,1,0);
Connect(21,22,1,0);
Connect(1,3,9,8);
Connect(3,5,9,8);
Connect(5,6,9,8);
Connect(6,4,9,8);
Connect(4,2,9,8);
Connect(19,7,9,8);
Connect(7,9,9,8);
Connect(9,10,9,8);
Connect(10,8,9,8);
Connect(8,21,9,8);
Connect(20,11,9,8);
Connect(11,13,9,8);
Connect(13,14,9,8);
Connect(14,12,9,8);
Connect(12,22,9,8);
Connect(15,17,9,8);
Connect(17,18,9,8);
Connect(18,16,9,8);*/
this.g.catcher=JocGame.PLAYER_B;
this.g.catcherMin=3;
this.g.catcheeMin=1;
//this.g.initialPos=[[-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2],[0,5,6]];
//this.g.initialPos=[[-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]];
this.g.initialPos=[[11,12,13,14,15,16,17,18,19,20,21,22],[0,3,4]];
this.g.useDrop=false;
this.HuntPostInitGame();
//JocLog("Graph",this.g.Graph);
//JocLog("RC",this.g.RC);
}

View file

@ -0,0 +1,3 @@
<p>TODO: writes rules</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1,133 @@
/*
*
* Copyright (c) 2012 - 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.
*
*/
View.Game.InitView=function() {
this.HuntInitView();
this.g.AisWhite=true;
$.extend(this.g.huntLayout,{
header: 1,
boardHeight: 9,
footer: 1,
left: 1,
boardWidth: 7,
right: 1,
});
this.g.SkipLines={3:5,5:6,6:4,7:9,9:10,10:8,11:13,13:14,14:12,15:17,17:18,18:16};
this.HuntBuildLayout();
this.HuntMakeCoord();
this.HuntDrawBoard();
this.HuntMakePieces();
var dockRC=[0.2,0.9];
this.g.DockCoord=[this.g.posSize*dockRC[1],this.g.posSize*dockRC[0]];
this.g.pieceDock=$("<canvas/>").addClass("piece-dock").css({
left: this.g.DockCoord[0],
top: this.g.DockCoord[1],
}).attr("width",this.g.posSize).attr("height",this.g.posSize).appendTo(this.g.area).hide();
this.HuntDrawPiece(this.g.pieceDock,this.g.catcher);
$("<div/>").addClass("piece-count").css({
left: this.g.DockCoord[0],
top: this.g.DockCoord[1]+this.g.posSize,
width: this.g.posSize*1,
height: this.g.posSize*1,
"line-height": this.g.posSize+"px",
"font-size": this.g.posSize/2+"pt",
}).appendTo(this.g.area).hide();
}
View.Game.HuntPreDrawPositions=function(ctx) {
var $this=this;
ctx.save();
var coord0=this.g.Coord[0];
function DrawArc(pos) {
var coord1=$this.g.Coord[pos];
var r=Math.sqrt((coord0[0]-coord1[0])*(coord0[0]-coord1[0])+(coord0[1]-coord1[1])*(coord0[1]-coord1[1]));
ctx.beginPath();
ctx.arc(coord0[0],coord0[1],r,-Math.PI/5,-(4/5)*Math.PI,true);
ctx.stroke();
ctx.closePath();
}
DrawArc(3);
DrawArc(7);
DrawArc(11);
DrawArc(15);
ctx.restore();
}
View.Game.HuntDrawLine=function(ctx,pos1,pos2) {
if(this.g.SkipLines[pos1]==pos2 || this.g.SkipLines[pos2]==pos1)
return;
var x0=this.g.Coord[pos1][0];
var x1=this.g.Coord[pos2][0];
var y0=this.g.Coord[pos1][1];
var y1=this.g.Coord[pos2][1];
ctx.beginPath();
ctx.moveTo(x0,y0);
ctx.lineTo(x1,y1);
ctx.closePath();
ctx.stroke();
}
View.Board.HuntAnimatePiece=function(aGame,pieceIndex,to,fnt) {
var pos1=this.pieces[pieceIndex].p;
if(aGame.g.SkipLines[pos1]==to || aGame.g.SkipLines[to]==pos1) {
this.HuntAnimatePieceArc(aGame,pieceIndex,to,fnt);
return;
}
var coord=aGame.g.Coord[to];
var x=coord[0];
var y=coord[1];
aGame.g.pieces[pieceIndex].animate({
left: x-aGame.g.posSize/2,
top: y-aGame.g.posSize/2,
},500,function() {
fnt();
});
}
View.Board.HuntAnimatePieceArc=function(aGame,pieceIndex,to,fnt) {
var duration=500;
var step=20;
var loopMax=duration/step;
var coord1=aGame.g.Coord[this.pieces[pieceIndex].p];
var coord0=aGame.g.Coord[0];
var coord=aGame.g.Coord[to];
var dx=(coord[0]-coord0[0]);
var dy=-(coord[1]-coord0[1]);
var dx1=(coord1[0]-coord0[0]);
var dy1=-(coord1[1]-coord0[1]);
var r=Math.sqrt(dx*dx+dy*dy);
var alpha=Math.atan(dy1/dx1);
var alpha1=Math.atan(dy/dx);
if(dx<0)
alpha1+=Math.PI;
if(dx1<0)
alpha+=Math.PI;
var dalpha=(alpha1-alpha)/loopMax;
var loop=0;
var piece=aGame.g.pieces[pieceIndex];
var timer=setInterval(function() {
piece.css({
left: coord0[0]+r*Math.cos(alpha)-aGame.g.posSize/2,
top: coord0[1]-r*Math.sin(alpha)-aGame.g.posSize/2,
});
alpha+=dalpha;
loop++;
if(loop==loopMax) {
clearInterval(timer);
fnt();
}
},step);
}

View file

@ -0,0 +1,70 @@
/*
*
* 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.
*
*/
View.Game.xdPreInit = function(xdv) {
this.g.AisWhite=false;
this.g.huntLayout={
header: 1,
boardHeight: 5,
footer: 1,
left: 1,
boardWidth: 6,
right: 1,
};
this.g.huntGameData.lightsIntensity=0.9;
this.g.huntGameData.sprites="/res/xd-view/meshes/tiger/tokens-pulijudam.png";
this.g.huntGameData.boardJSFile="/res/xd-view/meshes/tiger/pulijudam-board.js";
this.g.huntGameData.hunterJSFile="/res/xd-view/meshes/tiger/lambfoot.js";
this.g.huntGameData.preyJSFile="/res/xd-view/meshes/tiger/tigertooth.js";
this.g.huntGameData.targetJSFile="/res/xd-view/meshes/target4.js";
this.g.huntGameData.preyScale=0.3;
this.g.huntGameData.hunterScale=0.25;
this.g.huntGameData.boardSize=1.15;
this.g.huntGameData.boardStretch=false;
this.g.huntGameData.boardZ=0;
this.g.huntGameData.preyZ0=0;
this.g.huntGameData.hunterZ0=0;
this.g.huntGameData.screenDist=12000;
this.g.huntGameData.screenScale=4.5;
//this.g.huntGameData.fieldMap="/res/xd-view/meshes/tiger/pulijudam.jpg";
this.g.huntGameData.boardField2D="/res/xd-view/meshes/tiger/pulijudam.jpg";
this.g.huntGameData.soundMove="move";
this.g.huntGameData.soundEndJump="jumpend";
this.g.huntGameData.targetColorSelected=0x333333;
this.g.huntGameData.preyMorph=[1];
this.g.huntGameData.hunterMorph=[1];
this.g.huntGameData.sequences=[];
this.g.huntGameData.sequences["prey"]=[];
this.g.huntGameData.sequences["prey"]["walk"]=[
[1],
];
this.g.huntGameData.sequences["prey"]["jump"]=[
[1],
];
this.g.huntGameData.sequences["hunter"]=[];
this.g.huntGameData.sequences["hunter"]["walk"]=[
[1],
];
}
View.Game.xdInitExtra = function(xdv){
}
View.Game.GetOffBoardCoord = function(i,cellSize) {
return [(-this.g.huntLayout.boardWidth/2+this.g.huntLayout.boardWidth/15*i)*cellSize,3.5*cellSize];
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,73 @@
{
"metadata" :
{
"formatVersion" : 3.1,
"generatedBy" : "Blender 2.66 Exporter",
"vertices" : 24,
"faces" : 26,
"normals" : 24,
"colors" : 0,
"uvs" : [5],
"materials" : 2,
"morphTargets" : 0,
"bones" : 0
},
"scale" : 1.000000,
"materials" : [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "mat.board",
"blending" : "NormalBlending",
"colorDiffuse" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865],
"colorSpecular" : [0.5, 0.5, 0.5],
"depthTest" : true,
"depthWrite" : true,
"shading" : "Lambert",
"specularCoef" : 50,
"opacity" : 1.0,
"transparent" : false,
"vertexColors" : false
},
{
"DbgColor" : 15597568,
"DbgIndex" : 1,
"DbgName" : "mat.board.top",
"blending" : "NormalBlending",
"colorDiffuse" : [0.6962963342666626, 0.6962963342666626, 0.6962963342666626],
"colorSpecular" : [0.5, 0.5, 0.5],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Phong",
"specularCoef" : 50,
"opacity" : 1.0,
"transparent" : false,
"vertexColors" : false
}],
"vertices" : [4.8722,-0.447696,-5,5,-0.447696,-4.87219,4.8722,-0.563879,-4.87219,4.8722,-0.563879,4.8722,5,-0.447695,4.8722,4.8722,-0.447695,5,-4.8722,-0.563879,4.87219,-4.8722,-0.447695,5,-5,-0.447695,4.87219,-5,-0.447696,-4.8722,-4.87219,-0.447696,-5,-4.87219,-0.563879,-4.8722,5,-0.0579203,-4.87219,4.8722,-0.0579203,-5,4.9029,-0.0016339,-4.9029,4.9029,-0.00163347,4.9029,4.87219,-0.0579198,5,5,-0.0579198,4.8722,-4.9029,-0.00163347,4.9029,-5,-0.0579198,4.87219,-4.8722,-0.0579198,5,-4.87219,-0.0579203,-5,-5,-0.0579203,-4.8722,-4.9029,-0.0016339,-4.9029],
"morphTargets" : [],
"normals" : [0.315073,0.431196,-0.845424,0.338878,-0.36079,-0.868862,-0.338878,-0.36079,-0.868862,-0.315073,0.431196,-0.845424,0.338878,-0.36079,0.868862,0.315073,0.431196,0.845424,-0.315073,0.431196,0.845424,-0.338878,-0.36079,0.868862,-0.868862,-0.36079,0.338878,-0.845424,0.431196,0.315073,-0.845424,0.431196,-0.315073,-0.868862,-0.36079,-0.338878,0.296152,0.908048,-0.296152,-0.296152,0.908048,-0.296152,-0.296152,0.908048,0.296152,0.296152,0.908048,0.296152,0.868862,-0.36079,-0.338878,0.845424,0.431196,-0.315073,0.845424,0.431196,0.315073,0.868862,-0.36079,0.338878,0.324717,-0.888272,-0.324717,0.324717,-0.888272,0.324717,-0.324717,-0.888272,0.324717,-0.324717,-0.888272,-0.324717],
"colors" : [],
"uvs" : [[0,0,0.9999,0.9999,0.0001,0.9999,0.0001,0.0001,0.999899,0.0001]],
"faces" : [43,13,0,10,21,0,0,0,0,0,0,1,2,3,43,5,16,20,7,0,0,0,0,0,4,5,6,7,43,8,19,22,9,0,0,0,0,0,8,9,10,11,43,14,23,18,15,1,1,2,3,4,12,13,14,15,43,1,12,17,4,0,0,0,0,0,16,17,18,19,42,0,1,2,0,0,0,0,1,16,20,42,3,4,5,0,0,0,0,21,19,4,42,6,7,8,0,0,0,0,22,7,8,42,9,10,11,0,0,0,0,11,2,23,42,12,13,14,0,0,0,0,17,0,12,42,15,16,17,0,0,0,0,15,5,18,42,18,19,20,0,0,0,0,14,9,6,42,21,22,23,0,0,0,0,3,10,13,43,1,4,3,2,0,0,0,0,0,16,19,21,20,43,10,0,2,11,0,0,0,0,0,2,1,20,23,43,0,13,12,1,0,0,0,0,0,1,0,17,16,43,5,7,6,3,0,0,0,0,0,4,7,22,21,43,4,17,16,5,0,0,0,0,0,19,18,5,4,43,8,9,11,6,0,0,0,0,0,8,11,23,22,43,7,20,19,8,0,0,0,0,0,7,6,9,8,43,9,22,21,10,0,0,0,0,0,11,10,3,2,43,14,15,17,12,0,0,0,0,0,12,15,18,17,43,13,21,23,14,0,0,0,0,0,0,3,13,12,43,15,18,20,16,0,0,0,0,0,15,14,6,5,43,18,23,22,19,0,0,0,0,0,14,13,10,9,43,2,3,6,11,0,0,0,0,0,20,21,22,23],
"bones" : [],
"skinIndices" : [],
"skinWeights" : [],
"animation" : {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Some files were not shown because too many files have changed in this diff Show more