Tournament Sim

main
Nicky Case 7 years ago
parent 2ddf595e38
commit 27dd21b6a0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 B

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 B

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 413 B

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 4.0 KiB

@ -4,11 +4,13 @@ function TournamentSim(config){
self.id = config.id;
// APP
var app = new PIXI.Application(500, 500, {transparent:true});
var app = new PIXI.Application(500, 500, {transparent:true, resolution:2});
self.dom = app.view;
// DOM
self.dom.className = "object";
self.dom.style.width = 500;
self.dom.style.height = 500;
//self.dom.classList.add("fader");
self.dom.style.left = config.x+"px";
self.dom.style.top = config.y+"px";
@ -35,6 +37,11 @@ function TournamentSim(config){
return array;
};
self.networkContainer = new PIXI.Container();
self.agentsContainer = new PIXI.Container();
app.stage.addChild(self.networkContainer);
app.stage.addChild(self.agentsContainer);
self.populateAgents = function(){
// Clear EVERYTHING
@ -119,10 +126,14 @@ function TournamentSim(config){
// HACK: ALL AT ONCE
self.ALL_AT_ONCE = function(){
self.playOneTournament();
self.eliminateBottom(5);
self.reproduceTop(5);
setTimeout(function(){
self.eliminateBottom(5);
},300);
setTimeout(function(){
self.reproduceTop(5);
},600);
};
setInterval(self.ALL_AT_ONCE, 100);
setInterval(self.ALL_AT_ONCE, 1000);
// ANIMATE
/*app.ticker.add(function(delta) {
@ -161,6 +172,8 @@ function TournamentAgent(config){
// Body!
var body = PIXI.Sprite.fromImage("assets/"+self.strategyName+".png");
body.scale.set(0.5);
if(g.x>250) body.scale.x*=-1;
body.anchor.set(0.5);
g.addChild(body);

Loading…
Cancel
Save