Tournament Sim
BIN
assets/all_c.png
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 2.9 KiB |
BIN
assets/all_d.png
Before Width: | Height: | Size: 395 B After Width: | Height: | Size: 3.8 KiB |
BIN
assets/connection.png
Normal file
After Width: | Height: | Size: 96 B |
BIN
assets/grim.png
Before Width: | Height: | Size: 415 B After Width: | Height: | Size: 3.3 KiB |
BIN
assets/o0006.png
Normal file
After Width: | Height: | Size: 141 B |
Before Width: | Height: | Size: 413 B After Width: | Height: | Size: 3.8 KiB |
BIN
assets/tft.png
Before Width: | Height: | Size: 416 B After Width: | Height: | Size: 4 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();
|
||||
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);
|
||||
|
||||
|
|