ncase.me-trust/js/slides/3_Slides_Tournament.js

111 lines
1.9 KiB
JavaScript
Raw Normal View History

2017-07-12 18:59:22 +00:00
// Show the characters
SLIDES.push({
id: "tournament",
onstart: function(self){
2017-07-12 21:24:26 +00:00
// Text
self.add({
id:"text", type:"TextBox",
x:160, y:10, width:640, height:500, align:"center", size:19,
text_id:"characters"
});
// Button
self.add({
2017-07-13 15:07:33 +00:00
id:"button", type:"Button", size:"long", x:385, y:466,
text_id:"characters_button",
2017-07-12 21:24:26 +00:00
message:"slideshow/scratch"
});
2017-07-12 18:59:22 +00:00
},
onend: function(self){
self.clear();
}
});
// round-robin tournament, place your bets
SLIDES.push({
onstart: function(self){
2017-07-12 21:24:26 +00:00
// Tournament
Tournament.INITIAL_AGENTS = [
{strategy:"tft", count:1},
{strategy:"all_d", count:1},
{strategy:"all_c", count:1},
{strategy:"grudge", count:1},
{strategy:"prober", count:1}
];
self.add({id:"tournament", type:"Tournament", x:-20, y:20});
// Words to the side
self.add({
id:"text", type:"TextBox",
x:510, y:30, width:450, height:500,
text_id:"place_your_bets"
});
// Button
self.add({
id:"button", type:"Button",
x:510, y:400,
text_id:"label_tft",
onclick:function(){
_.answer = "tft";
publish("slideshow/next");
}
});
},
onend: function(self){
self.remove("text");
self.remove("button");
2017-07-12 18:59:22 +00:00
}
});
// go through it ONE BY ONE
SLIDES.push({
onstart: function(self){
2017-07-12 21:24:26 +00:00
// Button
self.add({
id:"button", type:"Button",
x:510, y:400,
text_id:"next_match",
onclick:function(){
_.answer = "tft";
publish("slideshow/next");
}
});
},
onend: function(self){
self.remove("button");
2017-07-12 18:59:22 +00:00
}
});
// who the winner is!
SLIDES.push({
onstart: function(self){
2017-07-12 21:24:26 +00:00
// Words to the side
self.add({
id:"text", type:"TextBox",
x:510, y:30, width:450, height:500,
text_id:"tournament_winner"
});
// Button
self.add({
id:"button", type:"Button", x:385, y:466,
text_id:"tournament_teaser", fontSize:16, upperCase:false,
message:"slideshow/scratch"
});
},
onend: function(self){
self.clear();
2017-07-12 18:59:22 +00:00
}
});