xxxxxxxxxx
269
//question 4, answer 2 = jumping overboard
/*
if (ques == 0) {
if (ans == 1) {
q = "";
ques = 0;
a1 = "";
a2 = "";
a3 = "";
}
if (ans == 2) {
q = "";
ques = 0;
a1 = "";
a2 = "";
a3 = "";
}
if (ans == 3) {
q = "";
ques = 0;
a1 = "";
a2 = "";
a3 = "";
}
ans = 0;
}
*/
{
let q;
let ques;
let a1;
let a2;
let a3;
let ans;
}
function setup() {
createCanvas(1000, 1000);
textSize(25);
q = "Buttercup tells you to fetch some water. What do you say?";
ques = 1;
a1 = "As you wish.";
a2 = "As you wish...";
a3 = "As you wish.";
ans = 0;
}
function draw() {
{
background(220);
text(q, 50, 110);
if (a1) {
text(a1, 80, 360);
rect(50, 340, 20, 20);
}
if (a2) {
text(a2, 80, 460);
rect(50, 440, 20, 20);
}
if (a3) {
text(a3, 80, 560);
rect(50, 540, 20, 20);
}
}
if (ques == 1) {
if (ans != 0) {
q = "A romance has budded between you and Buttercup. She (romantically) asks you to\nsweep the floor. What do you say?";
ques = 2;
a1 = "As you wish, Buttercup.";
a2 = "As you wish.";
a3 = "As you... wish?";
ans = 0;
}
}
if (ques == 2) {
if (ans != 0) {
q = "You and Buttercup are thinking of marriage, but you have no money. What will you\ndo?";
ques = 3;
a1 = "Seek your fortune overseas.";
a2 = "Get a local job.";
a3 = "Resort to crime.";
ans = 0;
}
}
if (ques == 3) {
if (ans == 1) {
q = "On a ship headed for the Americas, you have a lot of hope for the future. You are\nmaking your bed, then suddenly everyone is screaming. The ship is being attacked\nby pirates! What do you do?";
ques = 4;
a1 = "Fight back.";
a2 = "Jump overboard.";
a3 = "Hide in the storage rooms.";
ans = 0;
}
if (ans == 2) {
q = "You become a knight, slowly but steadily acummulating a wealth, while becoming a\nmaster swordfighter as well. Your next mission is to kill the infamous Dread Pirate\nRoberts, an alleged threat to the nation.";
ques = 5;
a1 = "Next.";
a2 = false;
a3 = false;
ans = 0;
}
if (ans == 3) {
q = "You've always heard tales of the infamous Dread Pirate Roberts, and you know he\nand his crew make a fortune. So at midnight, you steal a royal ship and sail off to\nGreenland, where he is rumored to have a base.";
ques = 0;
console.log("????");
a1 = "Next.";
a2 = false;
a3 = false;
ans = 0;
}
ans = 0;
}
if (ques == 4) {
if (ans == 1) {
q = "You snatch a sword from one of the fallen men and engage in combat with a very\nuncoordinated pirate. After deafeating him with a stab through the shoulder, you are\nknoncked unconsious from behind.";
ques = 8;
a1 = "Next.";
a2 = false;
a3 = false;
ans = 0;
}
if (ans == 2) {
q = "The icy cold water hits you like a shockwave, and you find it hard to swim with all of\nyour clothes. You cling to a rope drooping from the pirates' ship. You remain\nunnoticed until the pirates begin to sail away, victorious. What is your plan?";
ques = 0;
a1 = "Stay clinging to the rope.";
a2 = "Climb aboard and quickly try to hide.";
a3 = "Ditch the boat and swim in the ocean.";
ans = 0;
}
if (ans == 3) {
q = "You hurry to the storage rooms and hide amongst the assorted junk. You hear\nshouting above you on deck. Suddenly, a cannonball shoots through a wall and\nwater begins pouring in. By the time the next cannonball comes through, the\nwater is up to your knees. What do you do?";
ques = 7;
a1 = "Wait it out where you are.";
a2 = "Go up on deck.";
a3 = "Go up to jump overboard.";
ans = 0;
}
ans = 0;
}
if (ques == 5) {
q = "After sailing for a month, you and the rest of the crew find Dread Pirate Roberts'\nship. The two ships quickly steer up next to each other and engage in combat.\nWhat do you do?";
ques = 6;
a1 = "Stay and defend.";
a2 = "Swing over and fight.";
a3 = "Find a hiding spot in the storage rooms.";
ans = 0;
}
if (ques == 6) {
if (ans == 1 || ans == 2) {
q = "Sword in hand, you slice down multiple pirates withought a scratch. Suddenly a\nheavy blow to the back of your head renders you unconsious.";
ques = 0;
a1 = "Next";
a2 = false;
a3 = false;
ans = 0;
}
if (ans == 3) {
ques = 4
ans = 1;
}
ans = 0;
}
if (ques == 7) {
if (ans == 1) {
q = "Ignoring the water, you stay where you are. A cannonball whizzes past you head as the water reaches your torso. You swim towards the exit, when pieces of lumber fall, blocking your path. You take a final breath, and search for an alternate way out.";
ques = 10;
a1 = "Next.";
a2 = false;
a3 = false;
ans = 0;
}
if (ans == 2) {
q = "You find yourself on deck, only realise the ship is sinking. What do you do?";
ques = 0;
a1 = "Find a floating piece of wood to board.";
a2 = "Hide on the other ship.";
a3 = "Surrender.";
ans = 0;
}
if (ans == 3) {
q = "You scramble up the ladder onto the deck, where chaos flourishes all around you.\nYou dodge around fighting pirates, and more importantly, unoccupied ones. You run\nand dive over the edge of the ship.";
ques = 4;
a1 = false;
a2 = "Next.";
a3 = false;
}
ans = 0;
}
if (ques == 8) {
if (ans == 1) {
q = "You awake in a prison. Through a small window, you observe you're still at sea. You must be aboard the Dread Priate Robert's ship! What will you do?";
ques = 15;
a1 = "Wait";
a2 = "Escape";
a3 = "Yell";
}
ans = 0;
}
if (ques == 9) {
ques = 4
ans = 2;
}
if (ques == 10) {
if (ans == 1) {
q = "You look for windows or holes in the hull, finding both. You open, then and try to\nsqueeze though a window, but your hips get stuck. Awkwardly pushing yourself\nback into the ship, your lungs pulse. You find a small cannon hole from which you see your last glimps of sunlight.";
ques = 11;
a1 = "DEATH.";
a2 = false;
a3 = false;
}
}
if (ques == 11) {
if (ans == 1) {
q = "You look for windows or holes in the hull, finding both. You open, then and try to\nsqueeze though a window, but your hips get stuck. Awkwardly pushing yourself\nback into the ship, your lungs pulse. You find a cannon hole just wide enough,\nsquirm through, and almost choke swimming to the surface.";
ques = 11;
a1 = "Next.";
a2 = false;
a3 = false;
}
}
//floating 11
//hiding 12
//surrendered 13
//clinging to rope 14
//in DRE PI ROB prison (15)
//
}
function mousePressed() {
if (mouseX >= 50 && mouseX <= 70) {
if(mouseY >= 340 && mouseY <= 360) {
ans = 1;
}
if(mouseY >= 440 && mouseY <= 460) {
ans = 2;
}
if(mouseY >= 540 && mouseY <= 560) {
ans = 3;
}
}
}