added pensoc module

This commit is contained in:
mig 2017-04-09 00:37:01 +02:00
parent ca43ac9254
commit 1a348d6150
72 changed files with 4819 additions and 0 deletions

View file

@ -0,0 +1,5 @@
<div style="position: relative; overflow: hidden;">
<p>Penguin Soccer a été inventé par Avri Klemer en 2007.</p>
</div>
<p>Développement Jocly: Michel gutierrez (@<a target="_blank" href="http://twitter.com/_mig_">_mig_</a>) et Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>).</p>
<p>Graphismes: Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</a>).</p>

View file

@ -0,0 +1,5 @@
<div style="position: relative; overflow: hidden;">
<p>Penguin Soccer has been invented by Avri Klemer in 2007.</p>
</div>
<p>Jocly development: Michel gutierrez (@<a target="_blank" href="http://twitter.com/_mig_">_mig_</a>) and Jérôme Choain (@<a target="_blank" href="http://twitter.com/jcfrog">jcfrog</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,3 @@
<p>Penguin Soccer est un jeu de stratégie dans la famille des jeux de plateau tels que les échecs, les dames ou le jeu de Go. Pas de dé, pas de hasard,
uniquement de la réflexion. Penguin soccer met en scène des pingouins qui glissent sur un bout de banquise pour se disputer un ballon et marquer un but.
</p>

View file

@ -0,0 +1,7 @@
<p>It is a truth universally acknowledged that everybody loves seeing penguins sliding around on the ice. And soccer is the world's game, right? So
take some cute families of penguins, give them an icy soccer field and a ball, and watch the slippery goodness that ensues.</p>
<p>Penguin Soccer is a game in the tradition of Chess, Checkers and Go. There are no dice, no cards, no random elements - only the skill of the two
players. But instead of stern soldiers marching about a battlefield, or abstract stones on a grid, Penguin Soccer is about penguins sliding and spinning
and chasing a soccer ball across a frozen field!</p>

216
src/games/pensoc/index.js Normal file
View file

@ -0,0 +1,216 @@
var mvs = {
"models": {
"pensoc": {
"plazza": "true",
"title-en": "Penguin soccer",
"module": "pensoc",
"js": [
"pensoc-model.js"
],
"gameOptions": {
"levelOptions": {
"distGoalFactor": 12,
"distBallFactor": -1,
"haveBallFactor": 3.2,
"reachableFactor": 0.1,
"ballReachableFactor": 3.4
},
"uctTransposition": "state"
},
"levels": [
{
"ai": "uct",
"playoutDepth": 0,
"minVisitsExpand": 1,
"c": 0.63,
"ignoreLeaf": false,
"log": false,
"uncertaintyFactor": 3,
"name": "baby",
"label": "Baby",
"maxNodes": 2000
},
{
"ai": "uct",
"playoutDepth": 0,
"minVisitsExpand": 1,
"c": 0.63,
"ignoreLeaf": false,
"log": false,
"uncertaintyFactor": 3,
"name": "fast",
"label": "Fast [1sec]",
"maxDuration": 1,
"isDefault": true
},
{
"ai": "uct",
"playoutDepth": 0,
"minVisitsExpand": 1,
"c": 0.63,
"ignoreLeaf": false,
"log": false,
"uncertaintyFactor": 3,
"name": "papa",
"label": "Papa",
"maxNodes": 10000
},
{
"ai": "uct",
"playoutDepth": 0,
"minVisitsExpand": 1,
"c": 0.63,
"ignoreLeaf": false,
"log": false,
"uncertaintyFactor": 3,
"name": "mama",
"label": "Mama",
"maxNodes": 10000
}
],
"defaultLevel": 2,
"summary": "Penguins playing soccer",
"rules": {
"en": "rules.html",
"fr": "rules-fr.html"
},
"credits": {
"en": "credits.html",
"fr": "credits-fr.html"
},
"description": {
"en": "description.html",
"fr": "description-fr.html"
},
"thumbnail": "thumbnail.png",
"strings": [],
"debugEval": true
}
},
"views": {
"pensoc": {
"title-en": "Penguin Soccer View",
"module": "pensoc",
"xdView": true,
"js": [
"pensoc-xd-view.js"
],
"visuals": {
"600x600": [
"res/visuals/pensoc-600x600-3d.jpg",
"res/visuals/pensoc-600x600-2d.jpg"
]
},
"css": [
"pensoc.css"
],
"preferredRatio": 1.1638,
"switchable": true,
"useShowMoves": true,
"useNotation": true,
"animateSelfMoves": false,
"sounds": {
"turn": "turn",
"slide": "slide",
"kick": "kick",
"getup0": "hoha",
"getup1": "hehop",
"slide0": "ouai",
"slide1": "hoho1",
"slide2": "hoho1",
"slide3": "oula1",
"slide4": "oula2",
"haha": "hahaha",
"goout": "hehehehe"
},
"skins": [
{
"name": "3dofficial",
"title": "Official 3D",
"3d": true,
"camera": {
"radius": 15,
"limitCamMoves": true,
"elevationMin": 0,
"rotationAngle": 110
},
"world": {
"skyLightIntensity": 0.2,
"skyLightPosition": {
"x": 24,
"y": 24,
"z": 5
},
"lightIntensity": 0.4,
"lightPosition": {
"x": -12,
"y": 12,
"z": 10
},
"lightShadowDarkness": 0.4,
"fog": false,
"color": 0
},
"preload": [
"smoothedfilegeo|0|/res/xd-view/meshes/banquise4.js",
"smoothedfilegeo|0|/res/xd-view/meshes/goals3.js",
"smoothedfilegeo|0|/res/xd-view/meshes/arrow.js",
"smoothedfilegeo|0|/res/xd-view/meshes/ring-target.js",
"smoothedfilegeo|0|/res/xd-view/meshes/soccerball2.js",
"smoothedfilegeo|0|/res/xd-view/meshes/icecube1.js",
"smoothedfilegeo|0|/res/xd-view/meshes/iceberg-small.js",
"smoothedfilegeo|0|/res/xd-view/meshes/ocean.js",
"smoothedfilegeo|0|/res/xd-view/meshes/mama-animated.js",
"smoothedfilegeo|0|/res/xd-view/meshes/daddy-animated.js",
"smoothedfilegeo|0|/res/xd-view/meshes/baby-animated.js",
"map|/res/xd-view/meshes/soccer-texture2.jpg",
"map|/res/xd-view/meshes/mama-A-diffusex512.jpg",
"map|/res/xd-view/meshes/mama-B-diffusex512.jpg",
"map|/res/xd-view/meshes/daddy-A-diffusex512.jpg",
"map|/res/xd-view/meshes/daddy-B-diffusex512.jpg",
"map|/res/xd-view/meshes/baby-A-diffusex512.jpg",
"map|/res/xd-view/meshes/baby-B-diffusex512.jpg"
]
},
{
"name": "official",
"title": "Official 2D"
}
],
"defaultOptions": {
"sounds": true,
"notation": false,
"moves": true
},
"preloadImages": {
"background": "res/images/ps-background.jpg",
"sprites": "res/images/ps-images.png"
}
}
}
};
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,497 @@
/*
*
* 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.
*
*/
(function() {
function Pos2RC(pos) {
return [Math.floor(pos/8),pos%8];
}
var Dist2Goal=[];
for(var pos=0;pos<64;pos++) {
var rc=Pos2RC(pos);
var r=rc[0];
var c=rc[1];
Dist2Goal.push(Math.max(r,c));
}
var Distance=[];
for(var pos0=0;pos0<64;pos0++) {
var line=[];
Distance.push(line);
var rc0=Pos2RC(pos0);
var r0=rc0[0];
var c0=rc0[1];
for(var pos1=0;pos1<pos0;pos1++) {
var rc1=Pos2RC(pos1);
var r1=rc1[0];
var c1=rc1[1];
line.push(Math.max(Math.abs(r0-r1),Math.abs(c0-c1)));
}
}
function PSDist(pos0,pos1) {
if(pos0==pos1)
return 0;
if(pos1>pos0) {
var tmp=pos1;
pos1=pos0;
pos0=tmp;
}
return Distance[pos0][pos1];
}
var DirsRC=[
[1,1],
[1,0],
[1,-1],
[0,-1],
[-1,-1],
[-1,0],
[-1,1],
[0,1],
];
var Graph=[];
for(var pos=0;pos<64;pos++) {
var cell=[];
var rc=Pos2RC(pos);
for(var d=0;d<8;d++) {
var r=rc[0]+DirsRC[d][0];
var c=rc[1]+DirsRC[d][1];
if(r<0 || r>=8 || c<0 || c>=8)
cell.push(null);
else
cell.push(r*8+c);
}
Graph.push(cell);
}
var Reachable=[];
for(var pos=0;pos<64;pos++) {
var all={};
var reach={
'-1': all,
};
Reachable.push(reach);
for(var d=0;d<8;d++) {
var dir={};
reach[d]=dir;
var pos1=Graph[pos][d];
for(var i=1;i<4 && pos1!=null;i++) {
dir[pos1]=i;
all[pos1]=i;
pos1=Graph[pos1][d];
}
}
}
Model.Game.InitGame = function() {
this.g.Graph=Graph;
this.zobrist=new JocGame.Zobrist({
board: {
type: "array",
size: 65,
values: ["-1","0","1","2","3","4","5","6"],
},
dirs: {
type: "array",
size: 9,
values: ["0","1","2","3","4","5","6"],
},
});
}
Model.Move.Init = function(args) {
this.i=parseInt(args.i); // piece index: 0=WM,1=WP,2=WB,3=BM,4=BP,5=BB
this.p=parseInt(args.p); // destination for the penguin or the ball
this.d=parseInt(args.d); // direction 0 to 7 or -1: the penguin will face after the move, -1 means standing up
this.md=parseInt(args.md); // direction of the movement, for the penguin or the ball
}
Model.Move.CopyFrom = function(args) {
this.Init(args);
}
Model.Move.ToString = function() {
var str="";
str+=this.p;
str+=['M','P','B','M','P','B'][this.i];
str+=this.d;
return str;
}
Model.Move.Equals = function(move) {
return this.p==move.p && this.i==move.i && this.d==move.d && this.md==move.md;
}
Model.Board.Init = function(aGame) {
this.zSign=0;
}
Model.Board.InitialPosition = function(aGame) {
this.board=[];
for(var i=0;i<64;i++)
this.board.push(null);
this.penguins=[];
for(var who=1;who>-2;who-=2)
for(var type=0;type<3;type++) {
var index=this.penguins.length;
var penguin={
p: -1,
i: index,
s: who,
t: type,
d: -1,
};
this.penguins.push(penguin);
this.zSign=aGame.zobrist.update(this.zSign,"board",index,0);
this.zSign=aGame.zobrist.update(this.zSign,"dirs",index,0);
}
this.ball=-1;
this.zSign=aGame.zobrist.update(this.zSign,"board",-1,0);
}
Model.Board.CopyFrom = function(aBoard) {
this.board=[];
for(var i=0;i<aBoard.board.length;i++)
this.board.push(null);
this.penguins=[];
for(var i in aBoard.penguins) {
var penguin0=aBoard.penguins[i];
var penguin={
p: penguin0.p,
s: penguin0.s,
i: penguin0.i,
t: penguin0.t,
d: penguin0.d,
}
this.penguins.push(penguin);
if(penguin.p>-1)
this.board[penguin.p]=penguin;
}
this.ball=aBoard.ball;
this.mWho=aBoard.mWho;
this.zSign=aBoard.zSign;
}
Model.Board.GenerateMoves = function(aGame) {
this.mMoves=this.PenSocGetAllMoves(aGame);
}
Model.Board.PenSocGetAllMoves = function(aGame) {
var moves=[];
for(var i=0;i<this.penguins.length;i++) {
var penguin=this.penguins[i];
if(penguin.s==this.mWho) {
moves=moves.concat(this.PenSocGetBoardMoves(aGame,penguin));
}
}
return moves;
}
Model.Board.PenSocGetRotatingMoves=function(aGame,index,pos,dir,dirSteps) {
var moves=[];
for(var d=dir-dirSteps;d<=dir+dirSteps;d++) {
moves.push({
i:index,
p: pos,
d: (d+8)%8,
md: (dir+8)%8,
});
}
return moves;
}
Model.Board.PenSocGetBoardMoves = function(aGame,penguin) {
var moves=[];
var forbiddenPos=this.mWho==JocGame.PLAYER_A?63:0;
var dirs;
if(penguin.d==-1) { // penguin up
dirs=[0,1,2,3,4,5,6,7];
} else {
dirs=[parseInt(penguin.d)];
}
var pos0=penguin.p;
var dist=penguin.t+1;
var angleSteps=penguin.t+1;
if(pos0==-1) {
pos0=this.mWho==JocGame.PLAYER_A?0:63;
dirs=this.mWho==JocGame.PLAYER_A?[0,1,7]:[4,3,5];
dist=penguin.t;
if(this.board[pos0]!=null)
return moves;
}
if(penguin.p>-1 && penguin.d>-1) {
moves.push({
i: penguin.i,
p: penguin.p,
d: -1,
md: -1,
})
}
if(this.ball!=-1 && this.ball==penguin.p) {
dist=3-penguin.t;
for(var dir=0;dir<8;dir++) {
var pos=pos0, pos1=pos0;
var interrupted=false;
for(var i=0;i<dist;i++) {
pos=aGame.g.Graph[pos][dir];
if(pos==null) {
if(i>0)
moves.push({
i: penguin.i,
p: pos1,
d: -1,
md: dir,
});
interrupted=true;
break;
}
if(pos!=null && this.board[pos]!=null) {
moves.push({
i: penguin.i,
p: pos,
d: -1,
md: dir,
});
interrupted=true;
break;
}
pos1=pos;
}
if(!interrupted) {
moves.push({
i: penguin.i,
p: pos1,
d: -1,
md: dir,
});
}
}
} else {
for(var di=0;di<dirs.length;di++) {
var dir=dirs[di];
var pos=pos0, pos1=pos0;
var sliding=true;
for(var i=0;i<dist;i++) {
//JocLog("Penguin",penguin.t,"dir",dir,"Pos",pos,aGame.g.Graph[pos]);
pos=aGame.g.Graph[pos][dir];
if(pos==null || this.board[pos]!=null) {
if(pos!=null && this.ball!=-1 && pos==this.ball) {
var penguin2=this.board[pos];
if(penguin2 && penguin2.s==penguin.s) {
sliding=false;
break;
}
var valid=true;
var pos2=pos;
while(pos2) {
if(pos2==forbiddenPos) {
valid=false;
break;
}
if(this.board[pos2]==null)
break;
pos2=aGame.g.Graph[pos2][dir];
}
if(valid) {
moves.push({
i: penguin.i,
p: pos,
d: penguin.d,
md: dir,
});
}
} else if(i>0 && pos==null) {
moves.push({
i: penguin.i,
p: pos1,
d: -1,
md: dir,
});
}
sliding=false;
break;
}
if(this.ball==-1 && (pos==27 || pos==28 || pos==35 || pos==36)) {
moves.push({
i: penguin.i,
p: pos,
d: -1,
md: dir,
});
sliding=false;
break;
}
if(pos!=null && this.ball!=-1 && this.ball==pos) {
moves.push({
i: penguin.i,
p: pos,
d: -1,
md: dir,
});
sliding=false;
break;
}
pos1=pos;
}
if(sliding && pos1!=forbiddenPos) {
moves=moves.concat(this.PenSocGetRotatingMoves(aGame,penguin.i,pos1,dir,angleSteps));
}
if(penguin.p==-1 && penguin.t==0 && di==0)
break;
}
}
return moves;
}
/* Optional method.
* If not defined, verification is made by checking move is equal to one of the moves generated by GenerateMove
*/
Model.Board.IsValidMove = function(aGame,move) {
// TODO: truly verify move validity to prevent hacked clients in duel
return true;
}
Model.Board.Evaluate = function(aGame,aFinishOnly,aTopLevel) {
var debug=arguments[3]=="debug";
this.mEvaluation=0;
if(this.ball==0) {
this.mFinished=true;
this.mWinner=JocGame.PLAYER_B;
} else if(this.ball==63) {
this.mFinished=true;
this.mWinner=JocGame.PLAYER_A;
}
if(this.mFinished)
return;
var distBall=0;
var ballReachable=0;
var reachable=0;
for(var i=0;i<6;i++) {
var penguin=this.penguins[i];
var db;
if(penguin.p>=0) {
if(this.ball<0)
db=Math.min(PSDist(penguin.p,27),PSDist(penguin.p,28),PSDist(penguin.p,35),PSDist(penguin.p,36));
else
db=PSDist(penguin.p,this.ball);
var line=Reachable[penguin.p][penguin.d];
for(var pos in line) {
var reach=line[pos];
if(reach<=penguin.t+1) {
reachable+=penguin.s;
if(this.ball>=0 && pos==this.ball)
ballReachable+=penguin.s;
else if(this.ball<0 && (pos==27 || pos==28 || pos==35 || pos==36))
ballReachable+=penguin.s;
}
}
} else
db=8;
distBall+=db*penguin.s;
}
var distGoal=0;
var haveBall=0;
if(this.ball>=0) {
distGoal=Dist2Goal[this.ball]-Dist2Goal[63-this.ball];
var penguin0=this.board[this.ball];
if(penguin0!=null)
haveBall=penguin0.s;
}
var evParams=aGame.mOptions.levelOptions;
if(debug) {
console.log("distBall",distBall,"*",evParams.distBallFactor);
console.log("distGoal",distGoal,"*",evParams.distGoalFactor);
console.log("haveBall",haveBall,"*",evParams.haveBallFactor);
console.log("reachable",reachable,"*",evParams.reachableFactor);
console.log("ballReachable",ballReachable,"*",evParams.ballReachableFactor);
console.log("distBall details",this.ball,Dist2Goal[this.ball],Dist2Goal[63-this.ball]);
}
this.mEvaluation=
distBall*evParams.distBallFactor+
distGoal*evParams.distGoalFactor+
haveBall*evParams.haveBallFactor+
reachable*evParams.reachableFactor;
}
Model.Board.ApplyMove = function(aGame,aMove) {
var penguin=this.penguins[aMove.i];
aMove.d=parseInt(aMove.d);
if(this.ball!=-1 && this.ball==penguin.p) {
this.zSign=aGame.zobrist.update(this.zSign,"board",-1,this.ball+1);
this.ball=aMove.p;
this.zSign=aGame.zobrist.update(this.zSign,"board",-1,this.ball+1);
this.zSign=aGame.zobrist.update(this.zSign,"dirs",penguin.i,penguin.d+1);
penguin.d=aMove.md;
this.zSign=aGame.zobrist.update(this.zSign,"dirs",penguin.i,penguin.d+1);
var penguin1=this.board[aMove.p];
if(penguin1!=null) {
this.zSign=aGame.zobrist.update(this.zSign,"dirs",penguin1.i,penguin1.d+1);
penguin1.d=-1;
this.zSign=aGame.zobrist.update(this.zSign,"dirs",penguin1.i,penguin1.d+1);
}
} else {
if(penguin.p>-1)
this.board[penguin.p]=null;
if(aMove.p>-1) {
var pos1=aMove.p;
var penguin0=penguin;
while(pos1!=null) {
var penguin1=this.board[pos1];
this.board[pos1]=penguin0;
this.zSign=aGame.zobrist.update(this.zSign,"board",penguin0.i,penguin0.p+1);
penguin0.p=pos1;
this.zSign=aGame.zobrist.update(this.zSign,"board",penguin0.i,penguin0.p+1);
if(penguin1==null)
break;
this.zSign=aGame.zobrist.update(this.zSign,"dirs",penguin1.i,penguin1.d+1);
penguin1.d=aMove.md;
this.zSign=aGame.zobrist.update(this.zSign,"dirs",penguin1.i,penguin1.d+1);
penguin0=penguin1;
pos1=aGame.g.Graph[pos1][aMove.md];
}
if(pos1==null) {
this.zSign=aGame.zobrist.update(this.zSign,"board",penguin0.i,penguin0.p+1);
penguin0.p=-1;
this.zSign=aGame.zobrist.update(this.zSign,"board",penguin0.i,penguin0.p+1);
this.zSign=aGame.zobrist.update(this.zSign,"dirs",penguin0.i,penguin0.d+1);
penguin0.d=-1;
this.zSign=aGame.zobrist.update(this.zSign,"dirs",penguin0.i,penguin0.d+1);
}
}
this.zSign=aGame.zobrist.update(this.zSign,"board",penguin.i,penguin.p+1);
penguin.p=aMove.p;
this.zSign=aGame.zobrist.update(this.zSign,"board",penguin.i,penguin.p+1);
this.zSign=aGame.zobrist.update(this.zSign,"dirs",penguin.i,penguin.d+1);
penguin.d=aMove.d;
this.zSign=aGame.zobrist.update(this.zSign,"dirs",penguin.i,penguin.d+1);
if(this.ball==-1 && (aMove.p==27 || aMove.p==28 || aMove.p==35 || aMove.p==36)) {
this.zSign=aGame.zobrist.update(this.zSign,"board",-1,this.ball+1);
this.ball=aMove.p;
this.zSign=aGame.zobrist.update(this.zSign,"board",-1,this.ball+1);
}
if(this.ball!=-1 && this.ball==penguin.p) {
this.zSign=aGame.zobrist.update(this.zSign,"dirs",penguin.i,penguin.d+1);
penguin.d=-1;
this.zSign=aGame.zobrist.update(this.zSign,"dirs",penguin.i,penguin.d+1);
}
}
}
Model.Board.GetSignature = function() {
return this.zSign;
}
})();

View file

@ -0,0 +1,973 @@
/*
*
* 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.PenSocRotate=function(item,deg) {
var xOrigin=item.width()/2;
var yOrigin=item.height()/2;
item.css({
"-moz-transform": "rotate("+deg+"deg)",
"-webkit-transform": "rotate("+deg+"deg)",
"-o-transform": "rotate("+deg+"deg)",
"msTransform": "rotate("+deg+"deg)",
"transform": "rotate("+deg+"deg)",
});
}
View.Game.PenSocMakelighter=function(x,y,r,type) {
var $this=this;
var radius=r*1.25;
function MakeLighter(type) {
var lighter=$("<canvas/>").addClass(type).css({
top: y-radius,
left: x-radius,
"border-radius": radius,
}).attr("width",2*radius).attr("height",2*radius).appendTo($this.g.area);
var ctx=lighter[0].getContext("2d");
if(type=="highlighter")
ctx.strokeStyle="#ff9900";
else if(type=="backlighter")
ctx.strokeStyle="#ff66cc";
ctx.lineWidth=r*0.25;
ctx.beginPath();
ctx.arc(radius,radius,r*1.125,0,Math.PI*2,true);
ctx.closePath();
ctx.stroke();
return lighter;
}
var lighter=MakeLighter(type);
//lighter.push(MakeLighter("backlighter")[0]);
return lighter;
}
View.Game.PenSocMakeHighlighter=function(x,y,r) {
return this.PenSocMakelighter(x,y,r,"highlighter");
}
View.Game.PenSocMakeBacklighter=function(x,y,r) {
return this.PenSocMakelighter(x,y,r,"backlighter");
}
View.Game.PenSocDrawPenguin=function(penguin) {
var deg=this.mViewAs==JocGame.PLAYER_A?
[0,-45,-90,-135,180,135,90,45]:
[180,135,90,45,0,-45,-90,-135];
var data=penguin.data("data");
penguin.attr("width",data.size).attr("height",data.size).css({
top: data.y-data.size/2,
left: data.x-data.size/2,
});
var ctx=penguin[0].getContext("2d");
var resX, resY;
if(data.which==JocGame.PLAYER_A)
resY=200;
else
resY=0;
resX=data.type*200;
if(data.swimming) {
resX+=1200;
this.PenSocRotate(penguin,deg[this.g.initialPos[data.type+(data.which==JocGame.PLAYER_A?0:3)][2]]);
} else if(data.dir>-1) {
resX+=600;
this.PenSocRotate(penguin,deg[data.dir]);
} else {
this.PenSocRotate(penguin,deg[data.which==JocGame.PLAYER_A?0:4]);
}
ctx.drawImage(this.g.imagesRes,resX,resY,200,200,0,0,data.size,data.size);
}
View.Game.PenSocUpdatePenguin=function(penguin,options) {
var data=penguin.data("data");
$.extend(data,options);
penguin.data(data);
this.PenSocDrawPenguin(penguin);
//JocLog("UpdatePenguin",options);
}
View.Game.PenSocMakePenguin=function(options) {
var data={
x: this.g.center,
y: this.g.center,
which: JocGame.PLAYER_A,
type: 0,
dir: -1,
size: this.g.cellSize,
swimming: true,
}
$.extend(data,options);
var penguin=$("<canvas/>").addClass("penguin").data("data",data).appendTo(this.g.area);
this.PenSocDrawPenguin(penguin);
return penguin;
}
View.Game.PenSocMakeBall=function(size) {
var $this=this;
var ball=$("<canvas/>").addClass("ball").css({
top: this.g.center-size/2,
left: this.g.center-size/2,
"border-radius": size/2,
}).attr("width",size).attr("height",size).appendTo(this.g.area);
var ctx=ball[0].getContext("2d");
ctx.drawImage(this.g.imagesRes,0,400,200,200,0,0,size,size);
return ball;
}
View.Game.PenSocMakeCancel=function() {
var size=this.g.cellSize;
this.g.cancelButton=$("<canvas/>").addClass("cancel").css({
top: size*5.5,
left: size*11.6,
"border-radius": size/2,
}).attr("width",size).attr("height",size).appendTo(this.g.area).hide();
this.g.cancelFront=$("<div/>").addClass("front").css({
top: size*5.5,
left: size*11.6,
width: size,
height: size,
"border-radius": size/2,
}).attr("width",size).attr("height",size).appendTo(this.g.area).hide();
var ctx=this.g.cancelButton[0].getContext("2d");
ctx.drawImage(this.g.imagesRes,600,400,200,200,0,0,size,size);
this.g.cancelBacklighter=this.PenSocMakeBacklighter(size*12.1,size*6,size/2).hide();
}
View.Game.PenSocMakeGoal=function(who) {
var top,left,rotate=false;
if(who==JocGame.PLAYER_A) {
top=this.g.areaHeight-this.g.cellSize*2+this.g.cellSize*0.25;
left=this.g.boardSize/Math.sqrt(2)-this.g.cellSize;
} else {
top=-this.g.cellSize*0.25;
left=this.g.boardSize/Math.sqrt(2)-this.g.cellSize;
rotate=true;
}
var goal=$("<canvas/>").addClass("goal").css({
top: top,
left: left,
}).attr("width",this.g.cellSize*2).attr("height",this.g.cellSize*2).appendTo(this.g.area);
if(rotate)
this.PenSocRotate(goal,180);
var ctx=goal[0].getContext("2d");
ctx.drawImage(this.g.imagesRes,200,400,200,200,0,0,this.g.cellSize*2,this.g.cellSize*2);
}
View.Game.InitView=function() {
//JocLog("PenSocInitView");
this.mWidget.empty();
this.g.areaBackground=this.preloadedImages['background'];
this.g.imagesRes=this.preloadedImages['sprites'];
var $this=this;
this.g.areaWidth=Math.min(this.mGeometry.width, this.mGeometry.height*this.mViewOptions.preferredRatio);
this.g.areaHeight=this.g.areaWidth/this.mViewOptions.preferredRatio;
this.g.top=(this.mGeometry.height-this.g.areaHeight)/2;
this.g.left=(this.mGeometry.width-this.g.areaWidth)/2;
this.g.center=this.g.areaHeight/2;
this.g.boardSize=this.g.areaHeight/Math.sqrt(2);
this.g.cellSize=$this.g.boardSize/8;
this.g.Coord=[];
for(var i=0;i<8;i++)
for(var j=0;j<8;j++) {
var x=this.g.center-(i-4)*this.g.cellSize*Math.sqrt(2)/2+(j-4)*this.g.cellSize*Math.sqrt(2)/2;
var y=this.g.center-(i-4)*this.g.cellSize*Math.sqrt(2)/2-(j-3)*this.g.cellSize*Math.sqrt(2)/2;
if(this.mViewAs==JocGame.PLAYER_B) {
x=this.g.center+(i-4)*this.g.cellSize*Math.sqrt(2)/2-(j-4)*this.g.cellSize*Math.sqrt(2)/2;
y=this.g.center+(i-4)*this.g.cellSize*Math.sqrt(2)/2+(j-3)*this.g.cellSize*Math.sqrt(2)/2;
}
this.g.Coord.push([x,y]);
}
this.g.area=$("<div/>").addClass("pensoc-area").css({
top: this.g.top,
left: this.g.left,
width: this.g.areaWidth,
height: this.g.areaHeight,
}).appendTo(this.mWidget);
this.g.areaCanvas=$("<canvas/>").addClass("pensoc-area-canvas").css({
top: 0,
left: 0,
}).attr("width",this.g.areaWidth).attr("height",this.g.areaHeight).appendTo(this.g.area);
var areaCtx=this.g.areaCanvas[0].getContext("2d")
areaCtx.drawImage(this.g.areaBackground,0,0,this.g.areaBackground.width,this.g.areaBackground.height,0,0,$this.g.areaWidth,$this.g.areaHeight);
this.PenSocMakeGoal(JocGame.PLAYER_A);
this.PenSocMakeGoal(JocGame.PLAYER_B);
this.g.board=$("<div/>").addClass("pensoc-board").css({
top:(this.g.areaHeight-this.g.boardSize)/2,
left: (this.g.areaHeight-this.g.boardSize)/2,
width: this.g.boardSize,
height: this.g.boardSize,
}).appendTo(this.g.area);
this.g.boardCanvas=$("<canvas/>").addClass("pensoc-board-canvas").css({
top: 0,
left: 0,
}).attr("width",this.g.boardSize).attr("height",this.g.boardSize).appendTo(this.g.board);
for(var i=0;i<8;i++)
for(var j=0;j<8;j++) {
var pos=i*8+j;
var coord=this.g.Coord[pos];
if(this.mNotation)
$("<div/>").addClass("notation").css({
top: coord[1]-this.g.cellSize/2,
left: coord[0]-this.g.cellSize/2,
width: this.g.cellSize,
height: this.g.cellSize,
"line-height": this.g.cellSize+"px",
"font-size": this.g.cellSize/4+"pt",
}).appendTo(this.g.area).text(pos);
if(this.mShowMoves)
this.PenSocMakeHighlighter(coord[0],coord[1],this.g.cellSize/2).attr("joc-pos",pos).hide();
this.PenSocMakeBacklighter(coord[0],coord[1],this.g.cellSize/2).attr("joc-pos",pos).hide();
$("<div/>").addClass("front").css({
width: this.g.cellSize,
height: this.g.cellSize,
top: coord[1]-this.g.cellSize/2,
left: coord[0]-this.g.cellSize/2,
"border-radius": this.g.cellSize/2,
}).appendTo(this.g.area).attr("joc-pos",pos).hide();
}
if(this.mViewAs==JocGame.PLAYER_A)
this.g.initialPos=[
[0.6*this.g.cellSize,9.5*this.g.cellSize,6],
[2*this.g.cellSize,10.5*this.g.cellSize,7],
[3.5*this.g.cellSize,10.2*this.g.cellSize,0],
[7.5*this.g.cellSize,0.8*this.g.cellSize,1],
[9*this.g.cellSize,0.6*this.g.cellSize,3],
[9.2*this.g.cellSize,2*this.g.cellSize,2],
];
else
this.g.initialPos=[
[7.5*this.g.cellSize,0.8*this.g.cellSize,5],
[9*this.g.cellSize,0.6*this.g.cellSize,7],
[9.2*this.g.cellSize,2*this.g.cellSize,6],
[0.6*this.g.cellSize,9.5*this.g.cellSize,2],
[2*this.g.cellSize,10.5*this.g.cellSize,3],
[3.5*this.g.cellSize,10.2*this.g.cellSize,4],
];
this.g.penguins=[];
for(var who=1;who>-2;who-=2)
for(var type=0;type<3;type++) {
var index=this.g.penguins.length;
var coord=this.g.initialPos[index];
var penguin=this.PenSocMakePenguin({x:coord[0],y:coord[1],which:who,type:type,angle:who==this.mViewAs?0:180})
.attr("joc-index",index).hide();
/*
this.PenSocMakePenguin({x:coord[0],y:coord[1],which:who,type:type,angle:who==this.mViewAs?0:180})
.addClass("ghost");
*/
var highlighter=this.PenSocMakeHighlighter(coord[0],coord[1],this.g.cellSize/2).attr("joc-index",index).hide();
var backlighter=this.PenSocMakeBacklighter(coord[0],coord[1],this.g.cellSize/2).attr("joc-index",index).hide();
var front=$("<div/>").addClass("front").css({
width: this.g.cellSize,
height: this.g.cellSize,
top: coord[1]-this.g.cellSize/2,
left: coord[0]-this.g.cellSize/2,
"border-radius": this.g.cellSize/2,
}).attr("joc-index",index).appendTo(this.g.area).hide();
if(this.mNotation) {
$("<div/>").addClass("notation").css({
left: coord[0]-this.g.cellSize/2,
top: coord[1]+this.g.cellSize/4,
width: this.g.cellSize,
height: this.g.cellSize,
"line-height": this.g.cellSize+"px",
"font-size": this.g.cellSize/4+"pt",
}).appendTo(this.g.area).text(index);
}
this.g.penguins.push({
widget: penguin,
highlighter: highlighter,
backlighter: backlighter,
front: front,
index: this.g.penguins.length,
});
}
this.PenSocMakeRotator();
this.PenSocMakeTranslator();
this.PenSocMakePenguinHandlers();
this.g.ball=this.PenSocMakeBall(this.g.cellSize).hide();
this.PenSocMakeCancel();
this.PenSocRotate(this.g.board,45);
function DrawBoard() {
return;
var cellSize=$this.g.cellSize;
var ctx=$this.g.boardCanvas[0].getContext("2d");
ctx.save();
var grad=ctx.createLinearGradient(0,0,$this.g.boardSize,$this.g.boardSize);
grad.addColorStop(1, 'rgb(240,240,240)');
grad.addColorStop(0, 'rgb(250,250,250)');
ctx.fillStyle=grad;
for(var i=0;i<8;i++)
for(var j=0;j<8;j++)
if((i+j)%2==0) {
ctx.beginPath();
ctx.moveTo(i*cellSize,j*cellSize);
ctx.lineTo((i+1)*cellSize,j*cellSize);
ctx.lineTo((i+1)*cellSize,(j+1)*cellSize);
ctx.lineTo(i*cellSize,(j+1)*cellSize);
ctx.closePath();
ctx.fill();
}
ctx.restore();
}
DrawBoard();
}
View.Game.PenSocMakeRotator=function() {
var rRadius=2.2*this.g.cellSize;
var centerX=this.g.areaWidth-rRadius;
var centerY=this.g.areaHeight-rRadius;
this.g.rotatorPenguin=this.PenSocMakePenguin({
x: centerX,
y: centerY,
pos: 'l',
which: this.mViewAs,
swimming: false,
size: this.g.cellSize*2,
}).addClass("rotator").hide();
this.g.rotatorBall=this.PenSocMakeBall(this.g.cellSize*2).css({
left: centerX-this.g.cellSize,
top: centerY-this.g.cellSize,
}).hide();
/*
this.g.rotatorHighlighter=this.PenSocMakeHighlighter(
centerX,
centerY,
this.g.cellSize/2).addClass("rotator").attr("joc-dir",-1).hide();
this.g.rotatorFront=$("<div/>").addClass("front rotator").css({
left: centerX-this.g.cellSize/2,
top: centerY-this.g.cellSize/2,
width: this.g.cellSize,
height: this.g.cellSize,
"border-radius": this.g.cellSize/2,
}).appendTo(this.g.area).attr("joc-dir",-1).hide();
*/
var radius=1.5*this.g.cellSize;
this.g.rotator=$("<canvas/>").addClass("rotator-circle").css({
top: this.g.areaHeight-2*rRadius,
left: this.g.areaWidth-2*rRadius,
}).attr("width",2*rRadius).attr("height",2*rRadius).appendTo(this.g.area).hide();
var ctx=this.g.rotator[0].getContext("2d");
ctx.strokeStyle="White";
ctx.lineWidth=this.g.cellSize*0.2;
ctx.beginPath();
ctx.arc(rRadius,rRadius,radius,0,2*Math.PI,true);
ctx.closePath();
ctx.stroke();
this.g.directions=[];
for(var i=0;i<8;i++) {
var angleStep=((-2-i)+16)%8;
if(this.mViewAs==JocGame.PLAYER_B)
angleStep=((2-i)+16)%8;
var direction=this.PenSocMakeHighlighter(
centerX+Math.cos(angleStep*(Math.PI/4))*radius,
centerY+Math.sin(angleStep*(Math.PI/4))*radius,
this.g.cellSize/2
).attr("joc-dir",this.g.directions.length).addClass("rotator").hide();
/*
var backlighter=this.PenSocMakeBacklighter(
centerX+Math.cos(angleStep*(Math.PI/4))*radius,
centerY+Math.sin(angleStep*(Math.PI/4))*radius,
this.g.cellSize/2
).attr("joc-dir",this.g.directions.length).addClass("rotator").hide();
*/
if(this.mNotation) {
$("<div/>").addClass("notation rotator").css({
left: centerX+Math.cos(angleStep*(Math.PI/4))*radius-this.g.cellSize/2,
top: centerY+Math.sin(angleStep*(Math.PI/4))*radius-this.g.cellSize/2,
width: this.g.cellSize,
height: this.g.cellSize,
"line-height": this.g.cellSize+"px",
"font-size": this.g.cellSize/4+"pt",
}).appendTo(this.g.area).hide().text(i);
}
var front=$("<div/>").addClass("front rotator").css({
left: centerX+Math.cos(angleStep*(Math.PI/4))*radius-this.g.cellSize/2,
top: centerY+Math.sin(angleStep*(Math.PI/4))*radius-this.g.cellSize/2,
width: this.g.cellSize,
height: this.g.cellSize,
"border-radius": this.g.cellSize/2,
}).appendTo(this.g.area).hide().attr("joc-dir",this.g.directions.length);
this.g.directions.push({
highlighter: direction,
//backlighter: backlighter,
front: front,
});
ctx.fillStyle="White";
ctx.beginPath();
ctx.arc(rRadius+Math.cos(angleStep*(Math.PI/4))*radius,rRadius+Math.sin(angleStep*(Math.PI/4))*radius,this.g.cellSize/4,0,Math.PI*2,true);
ctx.closePath();
ctx.fill();
}
}
View.Game.PenSocMakeTranslator=function() {
var rRadius=2.2*this.g.cellSize;
var centerX=this.g.areaWidth-rRadius;
var centerY=this.g.areaHeight-rRadius;
var radius=1.5*this.g.cellSize;
for(var i=0;i<8;i++) {
var angleStep=((-2-i)+16)%8;
if(this.mViewAs==JocGame.PLAYER_B)
angleStep=((2-i)+16)%8;
var arrow=$("<canvas/>").addClass("arrow").css({
left: centerX+Math.cos(angleStep*(Math.PI/4))*radius-this.g.cellSize/2,
top: centerY+Math.sin(angleStep*(Math.PI/4))*radius-this.g.cellSize/2,
"border-radius": this.g.cellSize/2,
}).attr("width",this.g.cellSize).attr("height",this.g.cellSize).appendTo(this.g.area).attr("joc-dir",i).hide();
this.PenSocRotate(arrow,angleStep*45+90);
var ctx=arrow[0].getContext("2d");
ctx.drawImage(this.g.imagesRes,400,400,200,200,0,0,this.g.cellSize,this.g.cellSize)
}
}
View.Game.PenSocMakePenguinHandlers=function() {
var $this=this;
function MakeLighter(y,type) {
var lighter=$("<div/>").addClass(type).css({
top: y,
right: $this.g.cellSize*0.1,
width: $this.g.cellSize*2.4,
height: $this.g.cellSize*1.5,
"border-radius": $this.g.cellSize*0.2,
"background-color": type=="highlighter"?"#ff9900":"#ff66cc",
}).appendTo($this.g.area);
return lighter;
}
function MakeFront(y) {
var front=$("<div/>").addClass("front").css({
top: y,
right: $this.g.cellSize*0.2,
width: $this.g.cellSize*2.1,
height: $this.g.cellSize*1.3,
"border-radius": $this.g.cellSize*0.2,
}).appendTo($this.g.area);
return front;
}
this.g.buttonsCanvas=$("<canvas/>").addClass("pensoc-buttons-canvas").css({
right: 0,
top: 0,
}).attr("width",3*this.g.cellSize).attr("height",this.g.areaHeight).appendTo(this.g.area).hide();
var ctx=this.g.buttonsCanvas[0].getContext("2d");
function DrawBackground(y) {
ctx.drawImage($this.g.imagesRes,0,600,300,200,$this.g.cellSize*0.6,y,$this.g.cellSize*2.25,$this.g.cellSize*1.5);
}
this.g.handleHighlighters=[];
this.g.handleBacklighters=[];
this.g.handleFronts=[];
this.g.handlePenguins=[];
for(var type=0;type<3;type++) {
var index=2-type;
DrawBackground(index*1.6*this.g.cellSize+0.2*this.g.cellSize);
this.g.handleHighlighters.push(MakeLighter(index*1.6*this.g.cellSize+0.2*this.g.cellSize,"highlighter").hide());
this.g.handleBacklighters.push(MakeLighter(index*1.6*this.g.cellSize+0.2*this.g.cellSize,"backlighter").hide());
this.g.handleFronts.push(MakeFront(index*1.6*this.g.cellSize+0.3*this.g.cellSize).attr("joc-type",type).hide());
this.g.handlePenguins.push(this.PenSocMakePenguin({
x: this.g.areaWidth-this.g.cellSize*1.3,
y: index*this.g.cellSize*1.6+0.9*this.g.cellSize,
size: this.g.cellSize*1.3,
type: type,
swimming: false,
}).hide());
}
this.g.standingCanvas=$("<canvas/>").addClass("pensoc-buttons-canvas").css({
right: 0,
top: this.g.cellSize*7,
}).attr("width",3*this.g.cellSize).attr("height",2*this.g.cellSize).appendTo(this.g.area).hide();
var ctx=this.g.standingCanvas[0].getContext("2d");
ctx.drawImage(this.g.imagesRes,0,600,300,200,$this.g.cellSize*0.6,$this.g.cellSize*0.5,$this.g.cellSize*2.25,$this.g.cellSize*1.5);
ctx.drawImage(this.g.imagesRes,300,600,300,200,$this.g.cellSize*0.5,$this.g.cellSize*0.5,$this.g.cellSize*2.25,$this.g.cellSize*1.5);
this.g.standingHighlighter=MakeLighter(7.5*this.g.cellSize,"highlighter").hide();
this.g.standingFront=MakeFront(7.6*this.g.cellSize).hide();
this.g.slidingCanvas=$("<canvas/>").addClass("pensoc-buttons-canvas").css({
right: 0,
top: this.g.cellSize*8.6,
}).attr("width",3*this.g.cellSize).attr("height",2*this.g.cellSize).appendTo(this.g.area).hide();
var ctx=this.g.slidingCanvas[0].getContext("2d");
ctx.drawImage(this.g.imagesRes,0,600,300,200,$this.g.cellSize*0.6,$this.g.cellSize*0.5,$this.g.cellSize*2.25,$this.g.cellSize*1.5);
ctx.drawImage(this.g.imagesRes,600,600,300,200,$this.g.cellSize*0.5,$this.g.cellSize*0.5,$this.g.cellSize*2.25,$this.g.cellSize*1.5);
this.g.slidingHighlighter=MakeLighter(9.1*this.g.cellSize,"highlighter").hide();
this.g.slidingFront=MakeFront(9.2*this.g.cellSize).hide();
}
View.Game.DestroyView=function() {
this.mWidget.empty();
}
/* Display the current board
* Board based member: 'this' is a board instance.
*/
View.Board.Display=function(aGame) {
//JocLog("Display");
if(this.ball==-1)
aGame.g.ball.css({
top: aGame.g.center-aGame.g.cellSize/2,
left: aGame.g.center-aGame.g.cellSize/2,
}).show();
else {
var coord=aGame.g.Coord[this.ball];
aGame.g.ball.css({
top: coord[1]-aGame.g.cellSize/2,
left: coord[0]-aGame.g.cellSize/2,
}).show();
}
for(var i=0;i<this.penguins.length;i++) {
var penguin=this.penguins[i];
var vPenguin=aGame.g.penguins[i];
if(penguin.p==-1)
aGame.PenSocUpdatePenguin(vPenguin.widget,{
x: aGame.g.initialPos[i][0],
y: aGame.g.initialPos[i][1],
dir: penguin.d,
swimming: true,
});
else
aGame.PenSocUpdatePenguin(vPenguin.widget,{
x: aGame.g.Coord[penguin.p][0],
y: aGame.g.Coord[penguin.p][1],
dir: penguin.d,
swimming: false,
});
vPenguin.widget.show();
}
// display rotator for development
//aGame.mWidget.find(".rotator").show();
//aGame.mWidget.find(".highlighter").show();
}
View.Board.PenSocClearInput=function(aGame) {
aGame.mWidget.find(".highlighter,.backlighter,.arrow").hide();
aGame.mWidget.find(".front").hide().unbind(JocGame.CLICK);
aGame.mWidget.find(".board-arrow").remove();
aGame.g.rotatorPenguin.hide();
aGame.g.rotatorBall.hide();
aGame.g.standingCanvas.hide();
aGame.g.slidingCanvas.hide();
aGame.g.rotator.hide();
aGame.g.cancelButton.hide();
}
View.Board.HumanTurn=function(aGame) {
var $this=this;
var penguinBackData=[];
var skippedMovePos;
var moves=this.PenSocGetAllMoves(aGame);
var move={
i: -1,
p: -1,
d: -1,
md: -1,
}
//JocLog("HumanTurn",moves.length,moves);
aGame.g.buttonsCanvas.show();
for(var i=0;i<3;i++) {
var penguin=this.penguins[i+(this.mWho==JocGame.PLAYER_A?0:3)];
aGame.PenSocUpdatePenguin(aGame.g.handlePenguins[i].show(),{
which: this.mWho,
dir: penguin.d,
});
}
function Input() {
JocLog("Input",move,penguinBackData);
$this.PenSocClearInput(aGame);
if(move.i>-1) {
aGame.g.cancelButton.show();
aGame.g.cancelBacklighter.show();
aGame.g.cancelFront.show().bind(JocGame.CLICK,function() {
aGame.PenSocUpdatePenguin(aGame.g.penguins[move.i].widget,penguinBackData[0]);
penguinBackData=[];
move={i:-1,p:-1,md:-1,d:-1};
Input();
});
}
if(move.i==-1) {
var indexes={};
for(var i in moves)
indexes[moves[i].i]=true;
for(var i in indexes) {
var penguin=$this.penguins[i];
var highlighter;
if(penguin.p==-1) {
highlighter=aGame.mWidget.find(".highlighter[joc-index="+penguin.i+"]");
aGame.mWidget.find(".front[joc-index="+penguin.i+"]").show().bind(JocGame.CLICK,function() {
move.i=parseInt($(this).attr("joc-index"));
$this.PenSocAnimatePenguin(aGame,move.i,$this.mWho==JocGame.PLAYER_A?0:63,-1,function(backPenguin) {
penguinBackData.push(backPenguin);
Input();
});
});
} else {
highlighter=aGame.mWidget.find(".highlighter[joc-pos="+penguin.p+"]");
aGame.mWidget.find(".front[joc-pos="+penguin.p+"]").show().bind(JocGame.CLICK,function() {
move.i=$this.board[parseInt($(this).attr("joc-pos"))].i;
penguinBackData.push(aGame.g.penguins[move.i].widget.data("data"));
Input();
});
}
highlighter.show();
aGame.g.handleHighlighters[penguin.t].show();
aGame.g.handleFronts[penguin.t].show().bind(JocGame.CLICK,function() {
var type=parseInt($(this).attr("joc-type"));
move.i=type+($this.mWho==JocGame.PLAYER_A?0:3);
if($this.penguins[i].p==-1) {
$this.PenSocAnimatePenguin(aGame,move.i,$this.mWho==JocGame.PLAYER_A?0:63,-1,function(backPenguin) {
penguinBackData.push(backPenguin);
Input();
});
} else {
penguinBackData.push(aGame.g.penguins[move.i].widget.data("data"));
Input();
}
});
}
} else if(move.p==-1) {
var poss={};
for(var i in moves)
if(moves[i].i==move.i)
poss[moves[i].p]=true;
var mds={}, mdSlideCount=0;
for(var i in moves)
if(moves[i].i==move.i) {
mds[moves[i].md]=true;
if(moves[i].md!=-1)
mdSlideCount++;
}
var pCount=0;
for(var pos in poss)
pCount++;
if(pCount==1) {
//penguinBackData.push(aGame.g.penguins[move.i].widget.data("data"));
move.p=parseInt(pos);
move.md=moves[0].md;
skippedMovePos=true;
if($this.penguins[move.i].p==move.p)
Input();
else {
$this.PenSocAnimatePenguin(aGame,move.i,move.p,move.md,function(backPenguin) {
Input();
});
}
return;
}
skippedMovePos=false;
for(var pos in poss) {
if(parseInt(pos)!=$this.penguins[move.i].p) {
aGame.mWidget.find(".highlighter[joc-pos="+pos+"]").show();
aGame.mWidget.find(".front[joc-pos="+pos+"]").show().bind(JocGame.CLICK,function() {
move.p=parseInt($(this).attr("joc-pos"));
for(var i=0;i<moves.length;i++) {
var move0=moves[i];
if(move0.i==move.i && move0.p==move.p) {
move.md=move0.md;
break;
}
}
if($this.ball!=-1 && $this.penguins[move.i].p==$this.ball) {
$this.PenSocAnimateBall(aGame,move.p,function() {
Input();
});
} else {
$this.PenSocAnimatePenguin(aGame,move.i,move.p,move.md,function(backPenguin) {
penguinBackData.push(backPenguin);
Input();
});
}
});
}
}
if($this.penguins[move.i].d>-1) {
if(mdSlideCount>0) {
aGame.g.slidingHighlighter.show();
aGame.g.slidingCanvas.show();
aGame.g.slidingFront.show().bind(JocGame.CLICK,function() {
for(var i in moves)
if(moves[i].i==move.i && moves[i].md!=-1) {
move.p=moves[i].p;
move.md=moves[i].md;
break;
}
$this.PenSocAnimatePenguin(aGame,move.i,move.p,move.md,function(backPenguin) {
penguinBackData.push(backPenguin);
Input();
});
});
}
aGame.g.standingHighlighter.show();
aGame.g.standingCanvas.show();
aGame.g.standingFront.show().bind(JocGame.CLICK,function() {
move.p=$this.penguins[move.i].p;
move.md=-1;
Input();
});
} else {
if($this.ball!=-1 && $this.penguins[move.i].p==$this.ball) {
aGame.g.rotatorBall.show();
} else {
aGame.PenSocUpdatePenguin(aGame.g.rotatorPenguin,{
dir: -1,
type: $this.penguins[move.i].t,
which: $this.penguins[move.i].s,
});
aGame.g.rotatorPenguin.show();
}
for(var md in mds) {
if(md!=-1) {
aGame.mWidget.find(".arrow[joc-dir="+md+"]").show();
aGame.g.directions[md].highlighter.show();
aGame.g.directions[md].front.show().bind(JocGame.CLICK,function() {
var md=parseInt($(this).attr("joc-dir"));
for(var i in moves)
if(moves[i].i==move.i && moves[i].md==md) {
move.md=md;
move.p=moves[i].p;
break;
}
if($this.ball!=-1 && $this.penguins[move.i].p==$this.ball) {
$this.PenSocAnimateBall(aGame,move.p,function() {
Input();
});
} else {
$this.PenSocAnimatePenguin(aGame,move.i,move.p,move.md,function(backPenguin) {
penguinBackData.push(backPenguin);
Input();
});
}
});
}
}
}
var penguin=$this.penguins[move.i];
var backfront;
if(penguin.p==-1) {
var corner=$this.mWho==JocGame.PLAYER_A?0:63;
aGame.mWidget.find(".backlighter[joc-pos="+corner+"]").show();
backfront=aGame.mWidget.find(".front[joc-pos="+corner+"]");
} else {
aGame.mWidget.find(".backlighter[joc-pos="+penguin.p+"]").show();
backfront=aGame.mWidget.find(".front[joc-pos="+penguin.p+"]");
}
aGame.g.handleBacklighters[penguin.t].show();
backfront.push(aGame.g.handleFronts[penguin.t][0]);
backfront.show().bind(JocGame.CLICK,function() {
var penguinData=penguinBackData.pop();
var vPenguin=aGame.g.penguins[move.i].widget;
aGame.PenSocUpdatePenguin(vPenguin,penguinData);
move.i=-1;
Input();
});
} else {
aGame.mWidget.find(".rotator").show();
aGame.mWidget.find(".rotator.highlighter").hide();
var dirs={};
var moveCount=0;
var moveDir;
for(var i in moves)
if(moves[i].i==move.i && moves[i].p==move.p) {
dirs[moves[i].d]=true;
moveDir=moves[i].md;
moveCount++;
}
if(moveCount==1) {
move.md=moveDir;
aGame.MakeMove(move);
return;
}
aGame.mWidget.find(".rotator-circle").show();
aGame.PenSocUpdatePenguin(aGame.g.rotatorPenguin,{
which: $this.mWho,
dir: moveDir,
type: $this.penguins[move.i].t,
});
for(var dir in dirs) {
aGame.mWidget.find(".highlighter[joc-dir="+dir+"]").show();
var front=aGame.mWidget.find(".front[joc-dir="+dir+"]");
var pos=aGame.g.Graph[move.p][dir];
if(pos!=null) {
var coord=aGame.g.Coord[pos];
var canvas=$("<canvas/>").addClass("board-arrow").css({
top: coord[1]-aGame.g.cellSize/2,
left: coord[0]-aGame.g.cellSize/2,
}).attr("width",aGame.g.cellSize).attr("height",aGame.g.cellSize).attr("joc-pos",pos).attr("joc-dir",dir).appendTo(aGame.g.area);
var ctx=canvas[0].getContext("2d");
ctx.drawImage(aGame.g.imagesRes,800,400,200,200,0,0,aGame.g.cellSize,aGame.g.cellSize);
var deg=aGame.mViewAs==JocGame.PLAYER_A?
[0,-45,-90,-135,180,135,90,45]:
[180,135,90,45,0,-45,-90,-135];
aGame.PenSocRotate(canvas,deg[dir]);
front.push(aGame.mWidget.find(".front[joc-pos="+pos+"]")[0]);
}
front.show().bind(JocGame.CLICK,function() {
if($(this)[0].hasAttribute("joc-dir"))
move.d=parseInt($(this).attr("joc-dir"));
else
move.d=parseInt(aGame.mWidget.find(".board-arrow[joc-pos="+$(this).attr("joc-pos")+"]").attr("joc-dir"));
aGame.MakeMove(move);
});
}
aGame.mWidget.find(".backlighter[joc-pos="+move.p+"]").show();
aGame.mWidget.find(".front[joc-pos="+move.p+"]").show().bind(JocGame.CLICK,function() {
var penguinData=penguinBackData.pop();
var vPenguin=aGame.g.penguins[move.i].widget;
aGame.PenSocUpdatePenguin(vPenguin,penguinData);
if(skippedMovePos)
move.i=-1;
move.p=-1;
move.md=-1;
aGame.g.rotatorPenguin.hide();
aGame.mWidget.find(".rotator-circle").hide();
Input();
});
}
}
Input();
}
/* Optional method.
* Board based member: 'this' is a board instance.
* If implemented, it is called after a human player made the move.
*/
View.Board.HumanTurnEnd=function(aGame) {
this.PenSocClearInput(aGame);
}
View.Board.PenSocAnimatePenguin=function(aGame,index,to,dir,fnt) {
var vPenguin=aGame.g.penguins[index].widget;
var penguinData=JSON.parse(JSON.stringify(vPenguin.data("data")));
aGame.PenSocUpdatePenguin(vPenguin,{
swimming: false,
dir: dir,
})
var coord=aGame.g.Coord[to];
this.PenSocClearInput(aGame);
vPenguin.animate({
top: coord[1]-aGame.g.cellSize/2,
left: coord[0]-aGame.g.cellSize/2,
},400,function() {
aGame.PenSocUpdatePenguin(vPenguin,{
y: coord[1],
x: coord[0],
});
fnt(penguinData);
});
}
View.Board.PenSocAnimateBall=function(aGame,to,fnt) {
var coord=aGame.g.Coord[to];
this.PenSocClearInput(aGame);
aGame.g.ball.animate({
top: coord[1]-aGame.g.cellSize/2,
left: coord[0]-aGame.g.cellSize/2,
},400,function() {
fnt();
});
}
View.Board.PlayedMove=function(aGame,aMove) {
var vPenguin=aGame.g.penguins[aMove.i].widget;
var from=aGame.mOldBoard.penguins[aMove.i].p;
var to=this.penguins[aMove.i].p;
if(from!=-1 && aGame.mOldBoard.ball==from) {
var coord=aGame.g.Coord[aMove.p];
aGame.g.ball.animate({
top: coord[1]-aGame.g.cellSize/2,
left: coord[0]-aGame.g.cellSize/2,
},700,function() {
aGame.MoveShown();
});
} else if(from!=to) {
if(from==-1) {
var corner=this.mWho==JocGame.PLAYER_A?0:63;
var coord=aGame.g.Coord[corner];
aGame.PenSocUpdatePenguin(vPenguin,{
swimming: false,
dir: aMove.md,
});
vPenguin.animate({
top: coord[1]-aGame.g.cellSize/2,
left: coord[0]-aGame.g.cellSize/2,
},300,function() {
if(to==corner)
aGame.MoveShown();
else {
var coord=aGame.g.Coord[to];
vPenguin.animate({
top: coord[1]-aGame.g.cellSize/2,
left: coord[0]-aGame.g.cellSize/2,
},700,function() {
aGame.MoveShown();
});
}
})
} else {
aGame.PenSocUpdatePenguin(vPenguin,{
dir: aMove.md,
});
var coord=aGame.g.Coord[to];
vPenguin.animate({
top: coord[1]-aGame.g.cellSize/2,
left: coord[0]-aGame.g.cellSize/2,
},700,function() {
aGame.MoveShown();
});
}
} else {
aGame.MoveShown();
}
return false;
}
/* Optional method.
* Board based member: 'this' is a board instance.
* If implemented, must return true if there is no need to wait for an animation to achieve,
* if it returns false, the implementation must ensure it will call aMoveDoneFnt to resume
* the game.
*/
View.Board.ShowEnd=function(aGame) {
return true;
}

File diff suppressed because it is too large Load diff

102
src/games/pensoc/pensoc.css Normal file
View file

@ -0,0 +1,102 @@
.pensoc-area {
position: absolute;
background-color: #F0F0FF;
z-index: 0;
overflow: hidden;
}
.pensoc-area-canvas {
position: absolute;
background-color: Orange;
z-index: 0;
}
.pensoc-buttons-canvas {
position: absolute;
//background-color: Lime;
z-index: 7;
}
.pensoc-board {
position: absolute;
Xbackground-color: #99FFFF;
z-index: 0;
}
.pensoc-board-canvas {
position: absolute;
z-index: 0;
}
.highlighter,.backlighter {
position: absolute;
z-index: 5;
/*background-color: rgba(255,128,128,0.5);*/
}
.rotator-circle {
position: absolute;
z-index: 4;
}
.arrow {
position: absolute;
z-index: 4;
}
.back {
background-color: Orange;
}
.penguin {
position: absolute;
z-index: 10;
}
.goal {
position: absolute;
z-index: 12;
}
.ghost {
opacity: 0.2;
z-index: 8;
}
.ball {
position: absolute;
z-index: 3;
}
.cancel {
position: absolute;
z-index: 3;
/*background-color: White;*/
}
.board-arrow {
position: absolute;
z-index: 18;
}
.front {
position: absolute;
z-index: 20;
cursor: pointer;
background-color: rgba(0,0,0,0);
}
.notation {
position: absolute;
z-index: 15;
color: #808080;
text-align: center;
}
.clicker {
background-color: #fff;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
filter": alpha(opacity=0);
opacity: 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,56 @@
{
"metadata" :
{
"formatVersion" : 3.1,
"generatedBy" : "Blender 2.66 Exporter",
"vertices" : 24,
"faces" : 28,
"normals" : 24,
"colors" : 0,
"uvs" : [],
"materials" : 1,
"morphTargets" : 0,
"bones" : 0
},
"scale" : 1.000000,
"materials" : [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "mat.arrow",
"blending" : "NormalBlending",
"colorDiffuse" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865],
"colorSpecular" : [0.5, 0.5, 0.5],
"depthTest" : true,
"depthWrite" : true,
"shading" : "Phong",
"specularCoef" : 50,
"opacity" : 1.0,
"transparent" : false,
"vertexColors" : false
}],
"vertices" : [-0.3,-0.0614519,1.77765,-0.433909,-0.061452,-0.3,0.433909,-0.061452,-0.3,0.3,-0.0614519,1.77765,1.15749,-0.061452,-0.214496,-1.15749,-0.061452,-0.214496,0,-0.061452,-1.80725,-0.3,0.0529429,1.77765,-0.261051,0.0750169,1.73611,-0.433909,0.0529428,-0.3,-0.392283,0.0750168,-0.3,-0.421443,0.0750168,-0.343302,0.392283,0.0750168,-0.3,0.433909,0.0529428,-0.3,0.421443,0.0750168,-0.343302,0.3,0.0529429,1.77765,0.261051,0.0750169,1.73611,1.15749,0.0529428,-0.214496,1.06806,0.0750168,-0.266893,-1.15749,0.0529428,-0.214496,-1.06806,0.0750168,-0.266893,0,0.0529428,-1.80725,-0.0336863,0.0750168,-1.69023,0.0336863,0.0750168,-1.69023],
"morphTargets" : [],
"normals" : [-0.55678,-0.580798,0.593829,0.55678,-0.580798,0.593829,0.60268,0.472823,0.642781,-0.60268,0.472823,0.642781,0.17188,0.971282,-0.164434,0.058199,0.988708,0.138035,0.153966,0.983917,0.090213,0.181402,0.964171,0.193457,0.201117,0.977722,0.059755,-0.201117,0.977722,0.059755,-0.181402,0.964171,0.193457,-0.264321,-0.910703,0.317392,0.264321,-0.910703,0.317392,-0.058199,0.988708,0.138035,-0.17188,0.971282,-0.164434,0.448866,0.719047,0.530534,-0.153966,0.983917,0.090213,0,-0.562609,-0.826716,-0.721732,-0.547929,0.422864,-0.448866,0.719047,0.530534,-0.750481,0.493362,0.439711,0,0.494247,-0.869289,0.721732,-0.547929,0.422864,0.750481,0.493362,0.439711],
"colors" : [],
"uvs" : [],
"faces" : [35,0,3,15,7,0,0,1,2,3,34,23,14,18,0,4,5,6,35,16,12,10,8,0,7,8,9,10,35,0,1,2,3,0,0,11,12,1,34,11,23,22,0,13,4,14,34,11,14,23,0,13,5,4,34,11,10,14,0,13,9,5,34,10,12,14,0,9,8,5,35,13,15,3,2,0,15,2,1,12,34,11,22,20,0,13,14,16,34,6,1,5,0,17,11,18,34,2,1,6,0,12,11,17,35,1,9,19,5,0,11,19,20,18,35,5,19,21,6,0,18,20,21,17,34,2,6,4,0,12,17,22,35,17,4,6,21,0,23,22,17,21,35,13,2,4,17,0,15,12,22,23,34,9,10,11,0,19,9,13,34,12,13,14,0,8,15,5,34,21,22,23,0,21,14,4,35,8,10,9,7,0,10,9,19,3,35,12,16,15,13,0,8,7,2,15,35,16,8,7,15,0,7,10,3,2,35,13,17,18,14,0,15,23,6,5,35,20,22,21,19,0,16,14,21,20,35,11,20,19,9,0,13,16,20,19,35,23,18,17,21,0,4,6,23,21,35,1,0,7,9,0,11,0,3,19],
"bones" : [],
"skinIndices" : [],
"skinWeights" : [],
"animation" : {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View file

@ -0,0 +1,42 @@
{
"metadata" :
{
"formatVersion" : 3.1,
"generatedBy" : "Blender 2.66 Exporter",
"vertices" : 120,
"faces" : 90,
"normals" : 0,
"colors" : 0,
"uvs" : [],
"materials" : 0,
"morphTargets" : 0,
"bones" : 0
},
"scale" : 1.000000,
"materials" : [],
"vertices" : [5.44475,0.174688,5.41725,3.98731,-0.00700773,3.98731,5.49112,0.172095,2.56931,3.97488,-0.00686967,2.35549,5.94654,-0.154148,6.08982,7.19258,-0.0665081,3.38078,5.50216,0.177571,2.01382,3.97521,-0.00687388,1.76678,7.61831,-0.156804,1.90444,5.48357,-0.00706996,0.711856,3.95764,-0.00668547,0.293207,7.4558,0.13171,0.748405,5.77016,-0.00707005,-1.09255,3.98486,-0.00698087,-1.1807,7.84584,-0.0781199,-0.934152,5.5819,-0.00707012,-2.77005,3.96999,-0.00682946,-2.64749,7.5617,-0.0820288,-2.61993,5.50799,-0.00707017,-3.67568,3.94784,-0.00657603,-3.21721,7.69905,0.0786274,-4.26849,5.65984,0.181309,-4.75585,3.95675,-0.00672737,-3.81084,6.92336,-0.128066,-5.20303,5.56418,0.263581,-5.48757,3.96433,-0.00679971,-3.9636,6.53683,-0.0938116,-6.41497,2.18636,0.21683,-5.43285,1.75631,-0.00661248,-3.94878,2.40375,-0.170647,-6.42156,0.732197,0.141689,-5.72492,0.587666,-0.00677967,-3.96412,0.800702,-0.204534,-7.00791,-1.46569,0.170802,-5.45082,-1.17634,-0.0068173,-3.96839,-1.60194,-0.188083,-6.06456,-2.57093,0.146214,-5.25572,-2.35636,-0.00688578,-3.97099,-2.60278,-0.191139,-5.83081,-3.6773,0.145771,-5.50666,-3.25081,-0.00703375,-3.98956,-4.0044,-0.161759,-6.39101,-5.54009,0.086855,-5.53955,-3.99592,-0.00710376,-3.99592,-6.40736,-0.183602,-6.4067,-5.49007,0.0655453,-3.69243,-3.99526,-0.00709638,-2.95945,-6.37846,-0.205486,-4.40469,-5.54092,0.059581,-2.58569,-3.99629,-0.00710778,-2.22016,-6.96898,-0.210179,-3.33376,-5.54796,0.125969,-1.4774,-3.99581,-0.00710236,-1.18394,-7.66871,-0.00707008,-1.85174,-5.52484,-0.00707002,-0.368616,-3.99303,-0.00707136,-0.295778,-7.83873,-0.00707002,-0.499562,-5.57989,-0.00706998,0.553629,-3.99325,-0.00707385,0.591594,-7.79308,2.98023e-08,0.502048,-5.89077,-0.00706993,1.65945,-3.99419,-0.00708427,1.47933,-8.10294,0.00436601,1.50265,-5.94218,-0.00706983,3.87525,-3.99594,-0.00710365,3.25595,-7.277,0.00791536,4.00472,-5.54021,0.0582426,4.97168,-3.99618,-0.00710623,3.70016,-6.0447,-0.188726,5.47263,-5.40343,0.0876335,5.43089,-3.99613,-0.00710568,3.99613,-5.73217,-0.199917,6.14609,-3.31861,0.18736,5.82276,-2.36391,-0.00702755,3.9891,-3.60406,-0.190391,7.02676,-1.47366,0.0850415,5.52474,-0.886795,-0.00704382,3.99056,-1.60165,-0.177532,6.52346,-0.553722,0.0987427,5.55118,-0.295694,-0.00705774,3.99181,-0.800963,-0.199144,7.04747,0.552202,0.11786,5.5151,0.590912,-0.00702299,3.98868,0.198485,-0.181517,6.50762,2.39385,0.110378,5.51928,2.36427,-0.00703438,3.98971,2.33819,-0.195516,7.31135,4.05507,0.106185,5.52456,3.25286,-0.00706156,3.99216,4.40508,-0.178563,6.39408,5.764,-1.04366,5.91482,6.97322,-1.04366,3.28582,7.39224,-1.04366,1.85016,7.25793,-1.04366,0.723826,7.61304,-1.04366,-0.904562,7.3373,-1.04366,-2.54054,7.50169,-1.04366,-4.15699,6.71195,-1.04366,-5.04439,6.33685,-1.04366,-6.22052,2.32588,-1.04366,-6.22692,0.770189,-1.04366,-6.79595,-1.56147,-1.04366,-5.88046,-2.53274,-1.04366,-5.65362,-3.89295,-1.04366,-6.19727,-6.22492,-1.04366,-6.2125,-6.19687,-1.04366,-4.26963,-6.78655,-1.04366,-3.24011,-7.48024,-1.04366,-1.7995,-7.65582,-1.04366,-0.482812,-7.58923,-1.04366,0.489206,-7.92003,-1.04366,1.46025,-7.06887,-1.04366,3.89133,-5.87297,-1.04366,5.31587,-5.56968,-1.04366,5.96943,-3.50444,-1.04366,6.82408,-1.56119,-1.04366,6.33565,-0.784156,-1.04366,6.84417,0.185764,-1.04366,6.32028,2.26226,-1.04366,7.10027,4.26808,-1.04366,6.21009],
"morphTargets" : [],
"normals" : [],
"colors" : [],
"uvs" : [[]],
"faces" : [1,1,0,2,3,1,2,0,4,5,1,2,5,8,6,1,3,2,6,7,1,6,8,11,9,1,7,6,9,10,1,9,11,14,12,1,10,9,12,13,1,12,14,17,15,1,13,12,15,16,1,15,17,20,18,1,16,15,18,19,1,18,20,23,21,1,19,18,21,22,1,21,23,26,24,1,22,21,24,25,1,24,26,29,27,1,25,24,27,28,1,27,29,32,30,1,28,27,30,31,1,30,32,35,33,1,31,30,33,34,1,33,35,38,36,1,34,33,36,37,1,36,38,41,39,1,37,36,39,40,1,39,41,44,42,1,40,39,42,43,1,42,44,47,45,1,43,42,45,46,1,45,47,50,48,1,46,45,48,49,1,48,50,53,51,1,49,48,51,52,1,51,53,56,54,1,52,51,54,55,1,54,56,59,57,1,55,54,57,58,1,57,59,62,60,1,58,57,60,61,1,60,62,65,63,1,61,60,63,64,1,63,65,68,66,1,64,63,66,67,1,66,68,71,69,1,67,66,69,70,1,69,71,74,72,1,70,69,72,73,1,72,74,77,75,1,73,72,75,76,1,75,77,80,78,1,76,75,78,79,1,78,80,83,81,1,79,78,81,82,1,81,83,86,84,1,82,81,84,85,1,84,86,89,87,1,85,84,87,88,1,87,0,1,88,1,0,87,89,4,1,44,41,103,104,1,41,38,102,103,1,38,35,101,102,1,35,32,100,101,1,32,29,99,100,1,29,26,98,99,1,26,23,97,98,1,23,20,96,97,1,20,17,95,96,1,17,14,94,95,1,14,11,93,94,1,11,8,92,93,1,8,5,91,92,1,5,4,90,91,1,4,89,119,90,1,89,86,118,119,1,86,83,117,118,1,83,80,116,117,1,80,77,115,116,1,77,74,114,115,1,74,71,113,114,1,71,68,112,113,1,68,65,111,112,1,65,62,110,111,1,62,59,109,110,1,59,56,108,109,1,56,53,107,108,1,53,50,106,107,1,50,47,105,106,1,47,44,104,105],
"bones" : [],
"skinIndices" : [],
"skinWeights" : [],
"animation" : {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,56 @@
{
"metadata" :
{
"formatVersion" : 3.1,
"generatedBy" : "Blender 2.66 Exporter",
"vertices" : 66,
"faces" : 64,
"normals" : 0,
"colors" : 0,
"uvs" : [],
"materials" : 1,
"morphTargets" : 0,
"bones" : 0
},
"scale" : 1.000000,
"materials" : [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "Material.003",
"blending" : "NormalBlending",
"colorDiffuse" : [1.0, 1.0, 1.0],
"colorSpecular" : [0.1698576658964157, 0.5724393725395203, 0.6981925964355469],
"depthTest" : true,
"depthWrite" : true,
"shading" : "Phong",
"specularCoef" : 123,
"opacity" : 1.0,
"transparent" : false,
"vertexColors" : false
}],
"vertices" : [-0.862063,-1.01083,1.67441,-1.45977,-1.21794,-1.12457,1.46287,-1.40156,-1.47855,1.24727,-1.11344,1.12987,-1.18461,0.971858,1.33376,-1.46943,1.22923,-1.24294,1.0277,1.23457,-1.36965,1.2795,1.14198,1.52148,-1.26003,-0.18306,-0.935282,-1.00467,-0.127725,1.43677,1.23467,-0.312158,-1.23523,1.10536,-0.110071,1.1362,-1.05463,1.20393,-1.52503,-0.368268,1.1488,-1.80011,0.336682,1.18807,-1.67775,0.540134,-1.291,-1.71636,-0.397007,-1.21691,-1.93859,-1.24921,-1.21253,-1.41985,0.581885,1.10339,1.88196,-0.106541,1.05661,1.81936,-0.770125,0.992529,1.5371,-0.392603,-1.01744,1.60591,0.187733,-1.03937,1.36053,0.684174,-1.06811,1.17033,0.54625,-0.245176,-1.35388,-0.17942,-0.181302,-1.41694,-0.897405,-0.181242,-1.18621,-0.554246,-0.13942,1.4341,0.0254537,-0.149095,1.28292,0.536585,-0.120877,1.23889,-1.1798,0.882071,0.901919,-1.22147,0.859509,0.182298,-1.33438,1.03464,-0.503344,-1.37703,-1.14088,-0.346938,-1.00044,-1.05206,0.513668,-0.884002,-1.00972,1.23213,1.05658,1.18704,-0.63743,1.15255,1.14821,0.136944,1.24901,1.13344,1.02871,1.37278,-1.20981,0.825541,1.59987,-1.4065,0.255296,1.58433,-1.4548,-0.558985,-1.07341,-0.143343,-0.246955,-0.911436,-0.118087,0.314306,-0.994697,-0.117011,0.957939,1.18458,-0.179347,0.685724,1.2099,-0.273028,0.216017,1.33438,-0.380415,-0.429997,-1.24738,-1.14005,-0.607424,-0.676854,-1.05267,0.416624,-0.412224,-1.01488,1.18826,-0.754022,-1.14133,-0.868647,-0.00820173,-1.11794,0.266431,0.186674,-1.05665,0.952875,0.587039,-1.35997,-0.637315,0.800688,-1.26233,0.29061,0.791325,-1.15308,0.838509,0.3974,1.12204,-0.902568,0.465515,1.0353,0.378156,0.563278,1.09121,1.45387,-0.24783,1.01838,-0.929274,-0.179036,0.864486,0.0560575,-0.113335,1.01963,1.44297,-0.944798,1.03379,-0.76672,-0.818087,0.803028,0.177737,-0.763536,0.894441,1.07342],
"morphTargets" : [],
"normals" : [],
"colors" : [],
"uvs" : [],
"faces" : [3,42,8,1,33,0,3,24,10,2,15,0,3,45,11,3,39,0,3,0,21,27,9,0,3,54,15,2,41,0,3,63,12,5,32,0,3,32,5,8,42,0,3,14,6,10,24,0,3,38,7,11,45,0,3,20,4,9,27,0,3,8,26,17,1,0,3,26,25,16,17,0,3,25,24,15,16,0,3,11,29,23,3,0,3,29,28,22,23,0,3,28,27,21,22,0,3,33,1,17,48,0,3,48,17,16,51,0,3,51,16,15,54,0,3,36,6,14,57,0,3,57,14,13,60,0,3,60,13,12,63,0,3,5,12,26,8,0,3,12,13,25,26,0,3,13,14,24,25,0,3,7,18,29,11,0,3,18,19,28,29,0,3,19,20,27,28,0,3,35,0,9,44,0,3,44,43,34,35,0,3,43,42,33,34,0,3,10,47,41,2,0,3,47,46,40,41,0,3,46,45,39,40,0,3,23,56,39,3,0,3,56,55,40,39,0,3,55,54,41,40,0,3,20,65,30,4,0,3,65,64,31,30,0,3,64,63,32,31,0,3,4,30,44,9,0,3,30,31,43,44,0,3,31,32,42,43,0,3,6,36,47,10,0,3,36,37,46,47,0,3,37,38,45,46,0,3,0,35,50,21,0,3,35,34,49,50,0,3,34,33,48,49,0,3,21,50,53,22,0,3,50,49,52,53,0,3,49,48,51,52,0,3,22,53,56,23,0,3,53,52,55,56,0,3,52,51,54,55,0,3,7,38,59,18,0,3,38,37,58,59,0,3,37,36,57,58,0,3,18,59,62,19,0,3,59,58,61,62,0,3,58,57,60,61,0,3,19,62,65,20,0,3,62,61,64,65,0,3,61,60,63,64,0],
"bones" : [],
"skinIndices" : [],
"skinWeights" : [],
"animation" : {}
}

View file

@ -0,0 +1,58 @@
{
"metadata" :
{
"formatVersion" : 3.1,
"generatedBy" : "Blender 2.66 Exporter",
"vertices" : 12,
"faces" : 10,
"normals" : 0,
"colors" : 0,
"uvs" : [20],
"materials" : 1,
"morphTargets" : 0,
"bones" : 0
},
"scale" : 1.000000,
"materials" : [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "icecubemat",
"blending" : "NormalBlending",
"colorDiffuse" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865],
"colorSpecular" : [1,1,1],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuse" : "celltext1.jpg",
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Phong",
"specularCoef" : 50,
"opacity" : 1.0,
"transparent" : false,
"vertexColors" : false
}],
"vertices" : [-0.5,-0.5,0.5,-0.5,-0.5,-0.5,0.5,-0.5,-0.5,0.5,-0.5,0.5,-0.5,0.47269,0.5,-0.47269,0.5,0.472689,-0.5,0.472689,-0.5,-0.47269,0.5,-0.47269,0.5,0.472689,-0.5,0.47269,0.5,-0.47269,0.5,0.47269,0.5,0.47269,0.5,0.472689],
"morphTargets" : [],
"normals" : [],
"colors" : [],
"uvs" : [[0.111405,0.111405,0.888595,0.111405,0.888595,0.867369,0.111405,0.867369,0.961515,0.039274,0.9474,0.947886,0.038485,0.946622,0.0526,0.03801,0.111406,0.888594,0.111406,0.111406,0.888594,0.111406,0.888594,0.888594,0.111666,0.111405,0.888595,0.111673,0.888334,0.867384,0.111405,0.867116,9.9e-05,0.985796,0.01396,9.9e-05,0.98604,0.985796,0.999901,0.0001]],
"faces" : [11,0,3,10,4,0,0,1,2,3,11,8,10,3,2,0,2,3,0,1,11,11,9,7,5,0,4,5,6,7,11,0,1,2,3,0,8,9,10,11,11,6,8,2,1,0,12,13,14,15,11,5,7,6,4,0,7,6,16,17,11,7,9,8,6,0,6,5,18,16,11,9,11,10,8,0,5,4,19,18,11,11,5,4,10,0,4,7,17,19,11,1,0,4,6,0,14,15,12,13],
"bones" : [],
"skinIndices" : [],
"skinWeights" : [],
"animation" : {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,59 @@
{
"metadata" :
{
"formatVersion" : 3.1,
"generatedBy" : "Blender 2.63 Exporter",
"vertices" : 64,
"faces" : 92,
"normals" : 64,
"colors" : 0,
"uvs" : [36],
"materials" : 1,
"morphTargets" : 0,
"bones" : 0
},
"scale" : 1.000000,
"materials" : [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "ocean",
"blending" : "NormalBlending",
"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorSpecular" : [0.0486111044883728, 0.0486111044883728, 0.0486111044883728],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuse" : "ocean-texture2.jpg",
"mapDiffuseRepeat" : [50, 50],
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Phong",
"specularCoef" : 50,
"opacity" : 1.0,
"transparent" : false,
"vertexColors" : false
}],
"vertices" : [0,-0.0123162,-1,0,0.0123161,-1,0.19509,-0.0123162,-0.980785,0.19509,0.0123161,-0.980785,0.382683,-0.0123162,-0.92388,0.382683,0.0123161,-0.92388,0.55557,-0.0123162,-0.83147,0.55557,0.0123161,-0.83147,0.707107,-0.0123162,-0.707107,0.707107,0.0123161,-0.707107,0.83147,-0.0123162,-0.55557,0.83147,0.0123161,-0.55557,0.92388,-0.0123162,-0.382683,0.92388,0.0123162,-0.382683,0.980785,-0.0123162,-0.19509,0.980785,0.0123162,-0.19509,1,-0.0123162,-7.49595e-08,1,0.0123162,-7.60363e-08,0.980785,-0.0123162,0.19509,0.980785,0.0123162,0.19509,0.92388,-0.0123162,0.382683,0.92388,0.0123162,0.382683,0.83147,-0.0123161,0.55557,0.83147,0.0123162,0.55557,0.707107,-0.0123161,0.707107,0.707107,0.0123162,0.707107,0.55557,-0.0123161,0.83147,0.55557,0.0123162,0.83147,0.382683,-0.0123161,0.92388,0.382683,0.0123162,0.92388,0.19509,-0.0123161,0.980785,0.19509,0.0123162,0.980785,-3.25841e-07,-0.0123161,1,-3.25841e-07,0.0123162,1,-0.195091,-0.0123161,0.980785,-0.195091,0.0123162,0.980785,-0.382684,-0.0123161,0.923879,-0.382684,0.0123162,0.923879,-0.555571,-0.0123161,0.831469,-0.555571,0.0123162,0.831469,-0.707107,-0.0123161,0.707106,-0.707107,0.0123162,0.707106,-0.83147,-0.0123161,0.55557,-0.83147,0.0123162,0.55557,-0.92388,-0.0123162,0.382683,-0.92388,0.0123162,0.382683,-0.980785,-0.0123162,0.195089,-0.980785,0.0123162,0.195089,-1,-0.0123162,-9.65061e-07,-1,0.0123162,-9.66137e-07,-0.980785,-0.0123162,-0.195091,-0.980785,0.0123162,-0.195091,-0.923879,-0.0123162,-0.382684,-0.923879,0.0123162,-0.382684,-0.831469,-0.0123162,-0.555571,-0.831469,0.0123161,-0.555571,-0.707106,-0.0123162,-0.707108,-0.707106,0.0123161,-0.707108,-0.555569,-0.0123162,-0.83147,-0.555569,0.0123161,-0.83147,-0.382682,-0.0123162,-0.92388,-0.382682,0.0123161,-0.92388,-0.195089,-0.0123162,-0.980786,-0.195089,0.0123161,-0.980786],
"morphTargets" : [],
"normals" : [0,-0.68569,-0.727866,0,0.68569,-0.727866,0.142003,0.68569,-0.713889,0.142003,-0.68569,-0.713889,0.278542,0.68569,-0.672475,0.278542,-0.68569,-0.672475,0.40437,0.68569,-0.605213,0.40437,-0.68569,-0.605213,0.514664,0.68569,-0.514664,0.514664,-0.68569,-0.514664,0.605213,0.68569,-0.40437,0.605213,-0.68569,-0.40437,0.672475,0.68569,-0.278542,0.672475,-0.68569,-0.278542,0.713889,0.68569,-0.142003,0.713889,-0.68569,-0.142003,0.727866,0.68569,0,0.727866,-0.68569,0,0.713889,0.68569,0.142003,0.713889,-0.68569,0.142003,0.672475,0.68569,0.278542,0.672475,-0.68569,0.278542,0.605213,0.68569,0.40437,0.605213,-0.68569,0.40437,0.514664,0.68569,0.514664,0.514664,-0.68569,0.514664,0.40437,0.68569,0.605213,0.40437,-0.68569,0.605213,0.278542,0.68569,0.672475,0.278542,-0.68569,0.672475,0.142003,0.68569,0.713889,0.142003,-0.68569,0.713889,0,0.68569,0.727866,0,-0.68569,0.727866,-0.142003,0.68569,0.713889,-0.142003,-0.68569,0.713889,-0.278542,0.68569,0.672475,-0.278542,-0.68569,0.672475,-0.40437,0.68569,0.605213,-0.40437,-0.68569,0.605213,-0.514664,0.68569,0.514664,-0.514664,-0.68569,0.514664,-0.605213,0.68569,0.40437,-0.605213,-0.68569,0.40437,-0.672475,0.68569,0.278542,-0.672475,-0.68569,0.278542,-0.713889,0.68569,0.142003,-0.713889,-0.68569,0.142003,-0.727866,0.68569,0,-0.727866,-0.68569,0,-0.713889,0.68569,-0.142003,-0.713889,-0.68569,-0.142003,-0.672475,0.68569,-0.278542,-0.672475,-0.68569,-0.278542,-0.605213,0.68569,-0.40437,-0.605213,-0.68569,-0.40437,-0.514664,0.68569,-0.514695,-0.514664,-0.68569,-0.514695,-0.40437,0.68569,-0.605213,-0.40437,-0.68569,-0.605213,-0.278542,0.68569,-0.672475,-0.278542,-0.68569,-0.672475,-0.142003,0.68569,-0.713889,-0.142003,-0.68569,-0.713889],
"colors" : [],
"uvs" : [[0,0,1,0,1,1,0,1,0.5,0,0.402455,0.009607,0.308658,0.03806,0.222215,0.084265,0.597545,0.009607,0.146446,0.146447,0.691342,0.03806,0.084265,0.222215,0.777785,0.084265,0.03806,0.308659,0.853553,0.146447,0.009607,0.402455,0.915735,0.222215,0,0.5,0.96194,0.308658,0.009607,0.597546,0.990393,0.402455,0.03806,0.691342,1,0.5,0.084266,0.777786,0.990393,0.597545,0.146447,0.853554,0.96194,0.691342,0.222215,0.915735,0.915735,0.777785,0.308659,0.96194,0.853553,0.853553,0.402456,0.990393,0.777785,0.915735,0.5,1,0.691342,0.96194,0.597545,0.990393]],
"faces" : [43,0,1,3,2,0,0,1,2,3,0,1,2,3,43,2,3,5,4,0,0,1,2,3,3,2,4,5,43,4,5,7,6,0,0,1,2,3,5,4,6,7,43,6,7,9,8,0,0,1,2,3,7,6,8,9,43,8,9,11,10,0,0,1,2,3,9,8,10,11,43,10,11,13,12,0,0,1,2,3,11,10,12,13,43,12,13,15,14,0,0,1,2,3,13,12,14,15,43,14,15,17,16,0,0,1,2,3,15,14,16,17,43,16,17,19,18,0,0,1,2,3,17,16,18,19,43,18,19,21,20,0,0,1,2,3,19,18,20,21,43,20,21,23,22,0,0,1,2,3,21,20,22,23,43,22,23,25,24,0,0,1,2,3,23,22,24,25,43,24,25,27,26,0,0,1,2,3,25,24,26,27,43,26,27,29,28,0,0,1,2,3,27,26,28,29,43,28,29,31,30,0,0,1,2,3,29,28,30,31,43,30,31,33,32,0,0,1,2,3,31,30,32,33,43,32,33,35,34,0,0,1,2,3,33,32,34,35,43,34,35,37,36,0,0,1,2,3,35,34,36,37,43,36,37,39,38,0,0,1,2,3,37,36,38,39,43,38,39,41,40,0,0,1,2,3,39,38,40,41,43,40,41,43,42,0,0,1,2,3,41,40,42,43,43,42,43,45,44,0,0,1,2,3,43,42,44,45,43,44,45,47,46,0,0,1,2,3,45,44,46,47,43,46,47,49,48,0,0,1,2,3,47,46,48,49,43,48,49,51,50,0,0,1,2,3,49,48,50,51,43,50,51,53,52,0,0,1,2,3,51,50,52,53,43,52,53,55,54,0,0,1,2,3,53,52,54,55,43,54,55,57,56,0,0,1,2,3,55,54,56,57,43,56,57,59,58,0,0,1,2,3,57,56,58,59,43,58,59,61,60,0,0,1,2,3,59,58,60,61,42,35,33,31,0,4,5,6,34,32,30,42,35,31,29,0,4,6,7,34,30,28,42,37,35,29,0,8,4,7,36,34,28,42,37,29,27,0,8,7,9,36,28,26,42,39,37,27,0,10,8,9,38,36,26,42,39,27,25,0,10,9,11,38,26,24,42,41,39,25,0,12,10,11,40,38,24,42,41,25,23,0,12,11,13,40,24,22,42,43,41,23,0,14,12,13,42,40,22,42,43,23,21,0,14,13,15,42,22,20,42,45,43,21,0,16,14,15,44,42,20,42,45,21,19,0,16,15,17,44,20,18,42,47,45,19,0,18,16,17,46,44,18,42,47,19,17,0,18,17,19,46,18,16,42,49,47,17,0,20,18,19,48,46,16,42,49,17,15,0,20,19,21,48,16,14,42,51,49,15,0,22,20,21,50,48,14,42,51,15,13,0,22,21,23,50,14,12,42,53,51,13,0,24,22,23,52,50,12,42,53,13,11,0,24,23,25,52,12,10,42,55,53,11,0,26,24,25,54,52,10,42,55,11,9,0,26,25,27,54,10,8,42,57,55,9,0,28,26,27,56,54,8,42,57,9,7,0,28,27,29,56,8,6,42,59,57,7,0,30,28,29,58,56,6,42,59,7,5,0,30,29,31,58,6,4,42,61,59,5,0,32,30,31,60,58,4,42,3,61,5,0,33,32,31,2,60,4,42,3,63,61,0,33,34,32,2,62,60,42,3,1,63,0,33,35,34,2,1,62,43,1,0,62,63,0,2,3,0,1,1,0,63,62,43,60,61,63,62,0,0,1,2,3,61,60,62,63,42,30,32,34,0,8,4,5,31,33,35,42,28,30,34,0,10,8,5,29,31,35,42,28,34,36,0,10,5,6,29,35,37,42,26,28,36,0,12,10,6,27,29,37,42,26,36,38,0,12,6,7,27,37,39,42,24,26,38,0,14,12,7,25,27,39,42,24,38,40,0,14,7,9,25,39,41,42,22,24,40,0,16,14,9,23,25,41,42,22,40,42,0,16,9,11,23,41,43,42,20,22,42,0,18,16,11,21,23,43,42,20,42,44,0,18,11,13,21,43,45,42,18,20,44,0,20,18,13,19,21,45,42,18,44,46,0,20,13,15,19,45,47,42,16,18,46,0,22,20,15,17,19,47,42,16,46,48,0,22,15,17,17,47,49,42,14,16,48,0,24,22,17,15,17,49,42,14,48,50,0,24,17,19,15,49,51,42,12,14,50,0,26,24,19,13,15,51,42,12,50,52,0,26,19,21,13,51,53,42,10,12,52,0,28,26,21,11,13,53,42,10,52,54,0,28,21,23,11,53,55,42,8,10,54,0,30,28,23,9,11,55,42,8,54,56,0,30,23,25,9,55,57,42,6,8,56,0,32,30,25,7,9,57,42,6,56,58,0,32,25,27,7,57,59,42,4,6,58,0,34,32,27,5,7,59,42,4,58,60,0,34,27,29,5,59,61,42,2,4,60,0,35,34,29,3,5,61,42,2,60,62,0,35,29,31,3,61,63,42,0,2,62,0,33,35,31,0,3,63],
"bones" : [],
"skinIndices" : [],
"skinWeights" : [],
"animation" : {}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,72 @@
{
"metadata" :
{
"formatVersion" : 3.1,
"generatedBy" : "Blender 2.63 Exporter",
"vertices" : 72,
"faces" : 62,
"normals" : 24,
"colors" : 0,
"uvs" : [],
"materials" : 1,
"morphTargets" : 0,
"bones" : 0
},
"scale" : 1.000000,
"materials" : [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "ring",
"blending" : "NormalBlending",
"colorDiffuse" : [0.24284644488761487, 0.38950949295624326, 0.0],
"colorSpecular" : [0.5, 0.5, 0.5],
"depthTest" : true,
"depthWrite" : true,
"shading" : "Phong",
"specularCoef" : 50,
"opacity" : 1.0,
"transparent" : false,
"vertexColors" : false
},
{
"DbgColor" : 15597568,
"DbgIndex" : 1,
"DbgName" : "square",
"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
}],
"vertices" : [-0.600834,0.0792329,0.66495,-0.665212,0.0792329,0.66495,-0.665212,0.0792329,0.600834,-0.600834,0.0792329,0.600834,-0.600834,0.120851,0.66495,-0.665212,0.120851,0.66495,-0.665212,0.120851,0.600834,-0.600834,0.120851,0.600834,-0.665212,0.0792329,0.27917,-0.600834,0.0792329,0.27917,-0.665212,0.120851,0.27917,-0.600834,0.120851,0.27917,-0.27917,0.0792329,0.66495,-0.27917,0.0792329,0.600834,-0.27917,0.120851,0.66495,-0.27917,0.120851,0.600834,0.66495,0.0792328,0.600834,0.66495,0.0792328,0.665212,0.600834,0.0792328,0.665213,0.600834,0.0792328,0.600834,0.66495,0.120851,0.600834,0.66495,0.120851,0.665212,0.600834,0.120851,0.665213,0.600834,0.120851,0.600834,0.27917,0.0792328,0.665213,0.27917,0.0792328,0.600834,0.27917,0.120851,0.665213,0.27917,0.120851,0.600834,0.66495,0.0792328,0.279171,0.600834,0.0792328,0.279171,0.66495,0.120851,0.279171,0.600834,0.120851,0.279171,0.600834,0.0792328,-0.66495,0.665212,0.0792328,-0.66495,0.665212,0.0792328,-0.600834,0.600834,0.0792328,-0.600834,0.600834,0.120851,-0.66495,0.665212,0.120851,-0.66495,0.665212,0.120851,-0.600834,0.600834,0.120851,-0.600834,0.665212,0.0792328,-0.27917,0.600834,0.0792328,-0.27917,0.665212,0.120851,-0.27917,0.600834,0.120851,-0.27917,0.27917,0.0792328,-0.66495,0.27917,0.0792328,-0.600834,0.27917,0.120851,-0.66495,0.27917,0.120851,-0.600834,-0.66495,0.0792328,-0.600834,-0.66495,0.0792328,-0.665212,-0.600834,0.0792328,-0.665212,-0.600834,0.0792328,-0.600834,-0.66495,0.120851,-0.600834,-0.66495,0.120851,-0.665212,-0.600834,0.120851,-0.665212,-0.600834,0.120851,-0.600834,-0.27917,0.0792328,-0.665212,-0.27917,0.0792328,-0.600834,-0.27917,0.120851,-0.665212,-0.27917,0.120851,-0.600834,-0.66495,0.0792328,-0.27917,-0.600834,0.0792328,-0.27917,-0.66495,0.120851,-0.27917,-0.600834,0.120851,-0.27917,-0.850384,-0.101447,0.850384,-0.850384,-0.101447,-0.850384,0.850384,-0.101447,-0.850384,0.850384,-0.101447,0.850384,-0.850384,-0.0489159,0.850384,-0.850384,-0.048916,-0.850384,0.850384,-0.048916,-0.850384,0.850384,-0.0489159,0.850384],
"morphTargets" : [],
"normals" : [-0.577349,-0.577349,0.577349,0,-0.707083,0.707083,0,0.707083,0.707083,-0.577349,0.577349,0.577349,-0.707083,0.707083,0,-0.707083,-0.707083,0,0.301492,0.904508,-0.301492,0.301492,-0.904508,-0.301492,0.577349,-0.577349,-0.577349,0.577349,0.577349,-0.577349,-0.577349,0.577349,-0.577349,-0.577349,-0.577349,-0.577349,0.577349,0.577349,0.577349,0.577349,-0.577349,0.577349,0.707083,0.707083,0,0.707083,-0.707083,0,-0.301492,0.904508,-0.301492,-0.301492,-0.904508,-0.301492,0,0.707083,-0.707083,0,-0.707083,-0.707083,-0.301492,0.904508,0.301492,-0.301492,-0.904508,0.301492,0.301492,0.904508,0.301492,0.301492,-0.904508,0.301492],
"colors" : [],
"uvs" : [],
"faces" : [35,1,0,4,5,0,0,1,2,3,35,5,6,2,1,0,3,4,5,0,35,7,3,9,11,0,6,7,8,9,35,3,7,15,13,0,7,6,9,8,35,0,1,2,3,0,1,0,5,7,35,7,6,5,4,0,6,4,3,2,35,10,11,9,8,0,10,9,8,11,35,2,6,10,8,0,5,4,10,11,35,3,2,8,9,0,7,5,11,8,35,6,7,11,10,0,4,6,9,10,35,15,14,12,13,0,9,12,13,8,35,7,4,14,15,0,6,2,12,9,35,4,0,12,14,0,2,1,13,12,35,0,3,13,12,0,1,7,8,13,35,20,21,17,16,0,14,12,13,15,35,21,22,18,17,0,12,2,1,13,35,23,19,25,27,0,16,17,11,10,35,19,23,31,29,0,17,16,10,11,35,16,17,18,19,0,15,13,1,17,35,23,22,21,20,0,16,2,12,14,35,26,27,25,24,0,3,10,11,0,35,18,22,26,24,0,1,2,3,0,35,19,18,24,25,0,17,1,0,11,35,22,23,27,26,0,2,16,10,3,35,31,30,28,29,0,10,9,8,11,35,23,20,30,31,0,16,14,9,10,35,20,16,28,30,0,14,15,8,9,35,16,19,29,28,0,15,17,11,8,35,36,37,33,32,0,18,9,8,19,35,37,38,34,33,0,9,14,15,8,35,39,35,41,43,0,20,21,0,3,35,35,39,47,45,0,21,20,3,0,35,32,33,34,35,0,19,8,15,21,35,39,38,37,36,0,20,14,9,18,35,42,43,41,40,0,12,3,0,13,35,34,38,42,40,0,15,14,12,13,35,35,34,40,41,0,21,15,13,0,35,38,39,43,42,0,14,20,3,12,35,47,46,44,45,0,3,10,11,0,35,39,36,46,47,0,20,18,10,3,35,36,32,44,46,0,18,19,11,10,35,32,35,45,44,0,19,21,0,11,35,52,53,49,48,0,4,10,11,5,35,53,54,50,49,0,10,18,19,11,35,55,51,57,59,0,22,23,13,12,35,51,55,63,61,0,23,22,12,13,35,48,49,50,51,0,5,11,19,23,35,55,54,53,52,0,22,18,10,4,35,58,59,57,56,0,9,12,13,8,35,50,54,58,56,0,19,18,9,8,35,51,50,56,57,0,23,19,8,13,35,54,55,59,58,0,18,22,12,9,35,63,62,60,61,0,12,3,0,13,35,55,52,62,63,0,22,4,3,12,35,52,48,60,62,0,4,5,0,3,35,48,51,61,60,0,5,23,13,0,35,65,64,68,69,1,11,0,3,10,35,69,70,66,65,1,10,9,8,11,35,70,71,67,66,1,9,12,13,8,35,64,67,71,68,1,0,13,12,3,35,64,65,66,67,1,0,11,8,13,35,71,70,69,68,1,12,9,10,3],
"bones" : [],
"skinIndices" : [],
"skinWeights" : [],
"animation" : {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 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" : 16,
"faces" : 9,
"normals" : 1,
"colors" : 0,
"uvs" : [5],
"materials" : 2,
"morphTargets" : 0,
"bones" : 0
},
"scale" : 1.000000,
"materials" : [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "mat.screen.frame",
"blending" : "NormalBlending",
"colorDiffuse" : [0.009773542877637487, 0.009773542877637487, 0.009773542877637487],
"colorSpecular" : [0.5544217228889465, 0.5544217228889465, 0.5544217228889465],
"depthTest" : true,
"depthWrite" : true,
"shading" : "Lambert",
"specularCoef" : 50,
"opacity" : 1.0,
"transparent" : false,
"vertexColors" : false
},
{
"DbgColor" : 15597568,
"DbgIndex" : 1,
"DbgName" : "mat.screen",
"blending" : "NormalBlending",
"colorDiffuse" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865],
"colorSpecular" : [0.2541455030441284, 0.333633154630661, 0.5],
"depthTest" : true,
"depthWrite" : true,
"mapDiffuseWrap" : ["repeat", "repeat"],
"shading" : "Lambert",
"specularCoef" : 50,
"opacity" : 1.0,
"transparent" : false,
"vertexColors" : false
}],
"vertices" : [-1.06636,-0.799769,0.0284454,1.06636,-0.799769,0.0284454,-1.06636,0.799769,0.0284453,1.06636,0.799769,0.0284453,1.56636,-0.799769,0.0284454,1.56636,0.799769,0.0284453,-1.56636,-0.799769,0.0284454,-1.56636,0.799769,0.0284453,-1.06636,0.899769,0.0284453,1.06636,0.899769,0.0284453,1.56636,0.899769,0.0284453,-1.56636,0.899769,0.0284453,-1.06636,-0.899769,0.0284454,1.06636,-0.899769,0.0284454,1.56636,-0.899769,0.0284454,-1.56636,-0.899769,0.0284454],
"morphTargets" : [],
"normals" : [0,0,1],
"colors" : [],
"uvs" : [[0,0,8.7e-05,8.7e-05,0.999956,8.7e-05,0.999956,0.999913,8.7e-05,0.999913]],
"faces" : [43,4,1,13,14,0,0,0,0,0,0,0,0,0,43,0,6,15,12,0,0,0,0,0,0,0,0,0,43,0,1,3,2,1,1,2,3,4,0,0,0,0,43,1,0,12,13,0,0,0,0,0,0,0,0,0,43,3,5,10,9,0,0,0,0,0,0,0,0,0,43,3,1,4,5,0,0,0,0,0,0,0,0,0,43,0,2,7,6,0,0,0,0,0,0,0,0,0,43,7,2,8,11,0,0,0,0,0,0,0,0,0,43,2,3,9,8,0,0,0,0,0,0,0,0,0],
"bones" : [],
"skinIndices" : [],
"skinWeights" : [],
"animation" : {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View file

@ -0,0 +1,97 @@
<h2>But du jeu</h2>
<p>Marquer un but en envoyant le ballon sur la case du coin opposé, peu importe que la case soit occupée ou non.</p>
<h2>Déroulement du jeu</h2>
<p>Un tour consiste à choisir un pingouin et lui assigner une action. Les actions possibles dépendent de sa situation.
Le “(+↺/↻)” en fin de glissade vous rappelle qu'il a la possibilité de changer de direction pour le prochain coup.
Situations et actions possibles correspondantes:</p>
<p><i>Entrée sur le terrain</i></p>
<ul>
<li> Le pingouin entre en jeu par son coin, puis → <b>Glissade</b> puis choix d'une direction (+↺/↻).</li>
</ul>
<p><i>Pingouin allongé</i>, il faut choisir entre 2 possibilités:</p>
<ul>
<li><b>glisser</b> dans la direction actuelle puis choix d'une nouvelle direction (+↺/↻)</li>
<li><b>se mettre debout</b></li>
</ul>
<p><i>Pingouin debout</i></p>
<ul>
<li><i>sans ballon</i><b>glissade</b> dans n'importe quelle direction puis choix de direction (+↺/↻)</li>
<li><i>avec ballon</i>, <b>shoot</b> dans n'importe quelle direction et on finit sur le ventre dans cette direction</li>
</ul>
<h2>Position de départ</h2>
<ul>
<li>Chaque joueur dispose de 3 pingouins initialement en dehors du terrain.</li>
<li>Le ballon est au centre du terrain à cheval sur les 4 cases centrales jusqu'à
ce qu'un premier pingouin en prenne possession en arrivant sur une de ces 4 cases.</li>
</ul>
<h2>Règles de jeu</h2>
<h3>Possession du ballon</h3>
<p>La <b>seule option</b> pour un pingouin en possession du ballon est de frapper la balle.</p>
<ul>
<li>Le premier pingouin qui glisse jusqu'à une des 4 cases centrales prend possession du ballon.</li>
<li>Lorsqu'un pingouin prend possession du ballon, il se met debout.</li>
<li>Le ballon ne peut être déplacé que par un coup de pied.</li>
<li>Le pingouin qui a la balle ne peut l'abandonner, il doit la frapper pour la libérer.</li>
</ul>
<h3>Coup de pied</h3>
<ul>
<li>Lorsqu'il frappe le ballon en sa possession, le pingouin se retrouve sur le ventre sur sa case
et dans la direction qu'il a choisie pour shooter le ballon.
<ul>
<li>Mama, la plus grande, shoote de 3 cases.</li>
<li>Papa, le moyen, shoote de 2 case.</li>
<li>Baby, le petit, shoote d'1 case.</li>
</ul></li>
<li>Si le ballon va pour quitter le terrain, il s'arrête à la dernière case possible.</li>
<li>Si le ballon atteint une case avec un pingouin, le ballon s'arrête et ce pingouin
se lève en possession du ballon.</li>
</ul>
<h3>Station debout</h3>
<p>Tout pingouin en position de glissade sur le ventre peut se relever. Lorsqu'un pingouin est débout, sa direction est libre.</p>
<h3>Glissade</h3>
<p>S'il n'est pas en possession du ballon, le pingouin peut presque toujours glisser.</p>
<ul>
<li>Un pingouin sur le ventre peut glisser tout droit puis éventuellement se trouner dans une nouvelle direction:
<ul>
<li>Mama, la grande, glisse d'une case et peut se tourner jusqu'à 45° dans chaque direction.</li>
<li>Papa, le moyen, glisse de 2 cases et peut se tourner jusqu'à 90° dans chaque direction.</li>
<li>Baby, le moyen, glisse de 3 cases et peut se tourner jusqu'à 135° dans chaque direction.</li>
</ul></li>
<li>Un pingouin dont la glissade le ferait sortir du terrain s'arrête en limite de terrain et se lève .</li>
<li>Un pingouin en possession de la balle ne peut pas glisser.</li>
<li>Un pingouin qui glisse jusqu'à la balle s'arrête et prend possession de la balle (et donc se lève).</li>
<li>Tout pingouin peut tacler le pinguoin en possession du ballon en glissant jusqu'à lui.
Le pinguoin taclé est poussé d'une case dans la direction de la glissade.
Si la case atteinte par le pingouin taclé est occupé par une autre pingouin, ce dernier est également
poussé d'une case et ainsi de suite de proche en proche.
Un pingouin poussé se retrouve se le ventre dans la direction de la poussée.
Un pingouin poussé hors du terrain rejoint sa position de départ.
</li>
<li>Un coup qui aboutirait à mettre un pingouin dans le but adverse est interdit.</li>
</ul>
<h2>Fin de partie</h2>
<p>Si vous ammenez le ballon dans le but adverse (coin opposé), occupé ou non, c'est la victoire!</p>

100
src/games/pensoc/rules.html Normal file
View file

@ -0,0 +1,100 @@
<h2>Goal</h2>
<p>Get the ball into your opponents corner space, regardless of whether your opponent has a penguin there.</p>
<h2>Gameplay</h2>
<p>Each turn, you must select one of your penguins, and you must have it take an action. The actions available
to it depends on its current situation. The “(+↺/↻)” at the end of sliding options reminds you that the penguin
has the option of spinning after a slide. Penguin situations and the respective available actions are as follows:</p>
<p><i>Entering the game</i></p>
<ul>
<li><b>sliding</b>, the first space of its move will always be in your corner space, pointed in any of the three
directions (+↺/↻) — Its as if the penguins started the move from just outside the playfield.</li>
</ul>
<p><i>Lying down pengouin:</i></p>
<ul>
<li><b>sliding</b> in the direction it is already facing (+↺/↻)</li>
<li><b>standing</b></li>
</ul>
<p><i>Standing penguoin</i></p>
<ul>
<li><i>without the ball</i><b>sliding</b> in any orthogonal or diagonal direction (+↺/↻)</li>
<li><i>with the ball</i>, <b>kick</b> it in any orthogonal or diagonal direction → sliding position in the kick direction</li>
</ul>
<h2>Setup</h2>
<ul>
<li>Each player has three penguins outside the field.</li>
<li>The ball stands at the intersection of the center four squares. It is considered to be in all four squares
until a penguin first enters one of them, at which point, it moves into the penguins space.</li>
</ul>
<h2>General Rules</h2>
<h3>Possession of the Ball</h3>
<p>The <b>only option</b> a penguin in possession of the ball has is to kick the ball. Penguins can only pass or shoot.</p>
<ul>
<li>The first penguin to slide into one of the four center squares takes possession of the ball, which in this
case means the ball shifts slightly from the center intersection to be in only that space, and then the
penguin stops sliding, stands up, and takes possession of it.</li>
<li>Possession of the ball is indicated by putting it under your standing penguin.</li>
<li>The ball can only be moved by kicking it.</li>
<li>The penguin with the ball cannot abandon the ball and slide away.</li>
</ul>
<h3>Kicking</h3>
<ul>
<li>A penguin kicks in any direction and slips on the ice in the process, does a backflip, and lands on its
belly facing toward the ball, still in the same space where it was.
<ul>
<li>Mama, the big, strong penguin, kicks the ball 3 spaces.</li>
<li>Papa, the medium penguin, kicks the ball 2 spaces.</li>
<li>Baby, the small, weak penguin, kicks the ball 1 space.</li>
</ul></li>
<li>If the ball is about to go off the board, it stops. The penguins will always keep the precious ball in play!</li>
<li>If the ball reaches a square with a penguin, it stops in the penguins space, and the struck penguin
stands up, in possession of the ball.</li>
</ul>
<h3>Standing</h3>
<p>Any penguin that is in a sliding position can stand up. When a penguin is standing, its facing is irrelevant.</p>
<h3>Sliding</h3>
<p>Although a penguin in possession of the ball cannot slide, a penguin in almost any other situation can slide.</p>
<ul>
<li>Each penguin can slide in a straight line on its belly, then optionally spin:
<ul>
<li>Mama, the big, slow penguin, must slide 1 square, then may spin up to 45° either direction.</li>
<li>Papa, the medium penguin, must slide 2 squares, then may spin up to 90° either direction.</li>
<li>Baby, the small, fast penguin, must slide 3 squares, then may spin up to 135° either direction.</li>
</ul></li>
<li>A penguin whose full move would make it slide off the board stops just short and stands up instead.</li>
<li>A penguin with the ball cannot slide.</li>
<li>A penguin that slides to the balls location stops sliding, stands up, and takes possession of it.</li>
<li>A penguin of any size may tackle by sliding into the space with the opponents ball handler. A tackle
is the one and only time a penguin will strike another penguin. Anything for the ball! The attacker
pushes the tackled penguin off the ball, and that penguin falls over in the direction it was pushed,
moving one space that way. If it hits another penguin, that one also either falls over in that direction (if
it was standing), or turns to face that direction (if it wasnt standing), moving one space that way, and so
on. Being pushed during a tackle can push a penguin off the edge of the board, back into the sea.</li>
<li>You may not make a move that would put a penguin in your opponents corner, by any means.</li>
</ul>
<h2>Game End</h2>
<p>If you get the ball into your opponents corner space, even if your opponent has a penguin there, you win!</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB