From d803fdbba6618bf1c2e920e711bdc24642bb0a3d Mon Sep 17 00:00:00 2001 From: Nicky Case Date: Wed, 12 Jul 2017 17:24:26 -0400 Subject: [PATCH] crappy full outline --- index.html | 6 +++ js/core/Background.js | 31 +++++++++++ js/core/SlideSelect.js | 1 + js/slides/3_Slides_Tournament.js | 77 ++++++++++++++++++++++++++ js/slides/4_Slides_Evolution.js | 24 +++++++++ js/slides/5_Slides_Noise.js | 5 ++ js/slides/6_Slides_Sandbox.js | 7 ++- js/slides/7_Slides_Conclusion.js | 26 +++++++++ js/slides/8_Slides_Credits.js | 6 +++ lang/en.html | 93 ++++++++++++++++++++++++++++++++ 10 files changed, 274 insertions(+), 2 deletions(-) create mode 100644 js/core/Background.js diff --git a/index.html b/index.html index 83a6563..772776c 100644 --- a/index.html +++ b/index.html @@ -36,6 +36,7 @@ + @@ -49,6 +50,11 @@ + + + + + diff --git a/js/core/Background.js b/js/core/Background.js new file mode 100644 index 0000000..10ac25f --- /dev/null +++ b/js/core/Background.js @@ -0,0 +1,31 @@ +function Background(config){ + + var self = this; + self.id = config.id; + + // Dimensions, yo + var width = $("#main").clientWidth; + var height = $("#main").clientHeight; + var x = -(width-960)/2; + var y = -(height-540)/2; + + // DOM + self.dom = document.createElement("div"); + self.dom.className = "object"; + self.dom.style.left = x+"px"; + self.dom.style.top = y+"px"; + self.dom.style.width = width+"px"; + self.dom.style.height = height+"px"; + self.dom.style.background = config.color; + + // Add... + self.add = function(INSTANT){ + return _addFade(self, INSTANT); + }; + + // Remove... + self.remove = function(INSTANT){ + return _removeFade(self, INSTANT); + }; + +} \ No newline at end of file diff --git a/js/core/SlideSelect.js b/js/core/SlideSelect.js index e0bd981..b9e8edd 100644 --- a/js/core/SlideSelect.js +++ b/js/core/SlideSelect.js @@ -43,6 +43,7 @@ function SlideSelectDot(slide){ // Listen to when the slide changes subscribe("slideshow/slideChange", function(id){ + if(!id) return; // nah if(id==slide.id){ self.dom.setAttribute("selected","yes"); }else{ diff --git a/js/slides/3_Slides_Tournament.js b/js/slides/3_Slides_Tournament.js index 26f0f0f..8bdb2f3 100644 --- a/js/slides/3_Slides_Tournament.js +++ b/js/slides/3_Slides_Tournament.js @@ -5,6 +5,20 @@ SLIDES.push({ onstart: function(self){ + // 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({ + id:"button", type:"Button", x:385, y:466, + text_id:"characters_button", fontSize:16, upperCase:false, + message:"slideshow/scratch" + }); + }, onend: function(self){ self.clear(); @@ -16,6 +30,38 @@ SLIDES.push({ SLIDES.push({ onstart: function(self){ + // 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"); } }); @@ -23,6 +69,20 @@ SLIDES.push({ SLIDES.push({ onstart: function(self){ + // 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"); } }); @@ -30,5 +90,22 @@ SLIDES.push({ SLIDES.push({ onstart: function(self){ + // 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(); } }); \ No newline at end of file diff --git a/js/slides/4_Slides_Evolution.js b/js/slides/4_Slides_Evolution.js index e69de29..7dfb6d9 100644 --- a/js/slides/4_Slides_Evolution.js +++ b/js/slides/4_Slides_Evolution.js @@ -0,0 +1,24 @@ +// Evolution Intro +SLIDES.push({ + id: "evolution", + onstart: function(self){ + + // Words to the side + self.add({ + id:"text", type:"TextBox", + x:510, y:30, width:450, height:500, + text_id:"evolution_intro" + }); + + // Button + self.add({ + id:"button", type:"Button", x:385, y:466, + text_id:"evolution_intro_button", fontSize:16, upperCase:false, + message:"slideshow/scratch" + }); + + }, + onend: function(self){ + self.clear(); + } +}); \ No newline at end of file diff --git a/js/slides/5_Slides_Noise.js b/js/slides/5_Slides_Noise.js index e69de29..ebafbdd 100644 --- a/js/slides/5_Slides_Noise.js +++ b/js/slides/5_Slides_Noise.js @@ -0,0 +1,5 @@ +SLIDES.push({ + id: "noise", + onstart: function(self){ + } +}); \ No newline at end of file diff --git a/js/slides/6_Slides_Sandbox.js b/js/slides/6_Slides_Sandbox.js index 63eb65f..618f4a8 100644 --- a/js/slides/6_Slides_Sandbox.js +++ b/js/slides/6_Slides_Sandbox.js @@ -1,7 +1,10 @@ SLIDES.push({ id: "sandbox", - add:[ + onstart: function(self){ + + } + /*add:[ // The tournament simulation {id:"tournament", type:"Tournament", x:-20, y:-20}, @@ -9,6 +12,6 @@ SLIDES.push({ // Screw it, just ALL of the Sandbox UI {id:"sandbox", type:"SandboxUI"} - ] + ]*/ }); \ No newline at end of file diff --git a/js/slides/7_Slides_Conclusion.js b/js/slides/7_Slides_Conclusion.js index e69de29..48a6852 100644 --- a/js/slides/7_Slides_Conclusion.js +++ b/js/slides/7_Slides_Conclusion.js @@ -0,0 +1,26 @@ +SLIDES.push({ + id: "conclusion", + onstart: function(self){ + + // Splash in background + self.add({ id:"splash", type:"Splash" }); + + // Circular Wordbox + self.add({ + id:"text", type:"TextBox", + x:160, y:10, width:640, height:500, align:"center", size:19, + text_id:"conclusion" + }); + + // Button + self.add({ + id:"button", type:"Button", x:385, y:466, + text_id:"conclusion_button", fontSize:16, upperCase:false, + message:"slideshow/scratch" + }); + + }, + onend: function(self){ + self.clear(); + } +}); \ No newline at end of file diff --git a/js/slides/8_Slides_Credits.js b/js/slides/8_Slides_Credits.js index e69de29..75805d9 100644 --- a/js/slides/8_Slides_Credits.js +++ b/js/slides/8_Slides_Credits.js @@ -0,0 +1,6 @@ +SLIDES.push({ + id: "credits", + onstart: function(self){ + self.add({ id:"bg", type:"Background", color:"#222" }); + } +}); \ No newline at end of file diff --git a/lang/en.html b/lang/en.html index 3633ded..9894563 100644 --- a/lang/en.html +++ b/lang/en.html @@ -79,6 +79,75 @@ blah blah blah blah. But what if... ...we play more than once? →

+ + + + + + + + + +

+COPYCAT: I start with Cooperate, and then, I just copy whatever move you did last time. Meow +

+ALWAYS CHEAT: i hate you +

+ALWAYS COOPERATE: I love you! <3 +

+GRUDGER: "Listen y'all – I start Cooperatin', and I'll keep on Cooperatin'... but if you ever Cheat me once, pardner, I AIN'T EVER FORGIVIN' YOU." +

+DETECTIVE: "First: I analyze you. I start: Cooperate, Cheat, Cooperate, Cooperate. Then: if you retaliated with a Cheat, I switch to playing Copycat. But: if you never fight back, I switch to Always Cheat. My dear Watson: elementary." +

+now what if these characters... +

+

+...were to play against each other? → +

+ +

+It's tournament time! +These five characters will now play against each other – 10 paired games, 10 rounds per game. +

+Place your bets: who do you think will get the highest *total* score? +

+ +

+next match +

+ +

+COPYCAT! (Note: this play-style is also known in game theory as "Tit For Tat") +

+Congrats, you placed your bet on the right horse. +

+Sorry, //////. +

+Now, here's the strange thing: Copycat can _never_ beat another player in the trust game (because it never tries to take advantage of others), it can only ever do _as well as_ the other player. And yet overall, Copycat wins! This, despite being simpler than Detective, nicer than Always Cheat, and more forgiving than Grudger. It almost seems to imply that the Golden Rule is not just a moral truth, but a *mathematical* truth: +

+*Do unto others as you would have them do unto you.* ~Copycat +

+And *that's* why "peace" broke out in the trenches of World War I. Each side was playing a deadly game of trust with each other, but because the nature of trench warfare means they have to face the same group of soldiers over and over again, that allowed a Copycat-like strategy – the unspoken law of "live and let live" – to evolve. +

+ +

+...but does Copycat *always* win? → +

+ + + + + + +

+

+ +

+

+ + + + @@ -120,6 +189,30 @@ In each round of a one-on-one game, there's a [N]% chance a player makes a mista

+ + + + +

+blah blah blah blah +blah blah blah blah +blah blah blah blah
+blah blah blah blah +blah blah blah blah +blah blah blah blah
+blah blah blah blah +blah blah blah blah +

+ +

+<3 +

+ + + + + +