diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..b7103df --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: python ./main.py $PORT diff --git a/README.md b/README.md new file mode 100644 index 0000000..eabd635 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# Adventure + +So the link for it on Heroku is: "choose-or-lose.herokuapp.com" +The game will NOT work on Heroku at the moment. The SQL server that the DB is hosted on has blocked my current IP, so I can't update that. +I am looking for another free SQL hosting alternative before the game goes live again. + + +Known issues: CSS is a bit wonky, coming up with a fix soon. diff --git a/adventure.html b/adventure.html index e8563de..90a657d 100644 --- a/adventure.html +++ b/adventure.html @@ -4,7 +4,7 @@ - Create your own adventure + Look away.. Look far far away! @@ -20,7 +20,7 @@

- Hello and welcome to the "pick an adventure" game! + Turn back! For only fear and loathing await you...

@@ -36,7 +36,7 @@

What is your name?

What game would you like to play?

- +
@@ -48,7 +48,12 @@

What game would you like to play?

Welcome to the adventure

+
+ +
+
+ check monopoly!!!
@@ -75,4 +80,4 @@

- \ No newline at end of file + diff --git a/adventure.sql b/adventure.sql new file mode 100644 index 0000000..6f47017 --- /dev/null +++ b/adventure.sql @@ -0,0 +1,74 @@ +use adventure; + +drop table if exists `userinfo`; +create table `userinfo` ( +`username` varchar(16) not null, +`story_id` tinyint(2) not null default '1', +`current_life` tinyint(3) not null default '100', +`current_gold` tinyint(3) not null default '100', +primary key (`username`) +)ENGINE=MyISAM DEFAULT CHARSET=utf8; + + + + + + + + +drop table if exists `questions`; +create table `questions` ( +`story_id` tinyint(2) not null default '0', +`story_question_text` text, +`answer_id` tinyint(2) not null default'0', +`answer_text` text, +`notes` text, +`goes_to_story_id` tinyint(2) not null default '0', +`health_changes` tinyint(4) not null default '0', +`gold_changes` tinyint(4) not null default '0', +`image_used` text, +foreign key userinfo(story_id) references userinfo (story_id) +)ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +insert into `questions` (`story_id`, `story_question_text`, `answer_id`, `answer_text`, `notes`, `goes_to_story_id`, `health_changes`, `gold_changes`, `image_used`) +values ('1', "You're alone in the woods. There's no one around and your phone is dead. Out of the corner of your eye you spot him. Shia LaBeouf. What do you do?", '1', 'Fawn over him! You loved him in Transformers!', 'Not aggressive, but you drop your guard and lose some money.', '2', -20, -30, "shia lacrouch.png"), +('1', "You're alone in the woods. There's no one around and your phone is dead. Out of the corner of your eye you spot him. Shia LaBeouf. What do you do?", '2', 'Get into a powerful stance and shout "JUST DO IT!" ', 'Aggressive. Shia attacks and you suffer a fatal blow. Game over.', '9', -100, -100, "shia lacrouch.png"), +('1', "You're alone in the woods. There's no one around and your phone is dead. Out of the corner of your eye you spot him. Shia LaBeouf. What do you do?", '3', 'You keep walking. Something tells you that something is wrong.', 'Not aggressive, but pushes the story forward safely.', '3', 0, 0, "shia lacrouch.png"), +('1', "You're alone in the woods. There's no one around and your phone is dead. Out of the corner of your eye you spot him. Shia LaBeouf. What do you do?", '4', 'Break into a run. You have seen enough horror movies and late night TV to know that you should not be alone with anyone in the woods.','Aggressive. Leads into chase segment and drops money. Triggers combat', '3', -10, -20, "shia lacrouch.png"), +('2', "You're starstruck feelings blind you to your surroundings. As the two of you get closer, you suddenly find yourself on the ground. You've been suckerpunched by Shia LaBeouf! What's next?!", '1', 'Stand up and hug it out. He seems like a lovable guy, maybe it was a mistake?', 'Aggressive. Shia bites your jugular and you lose consciousness. Game over.', '9', -100, -100,"shia lapunch.jpg"), +('2', "You're starstruck feelings blind you to your surroundings. As the two of you get closer, you suddenly find yourself on the ground. You've been suckerpunched by Shia LaBeouf! What's next?!", '2', "Get up and run! He's out of is mind!", 'Not aggressive, triggers combat.', '3', 0, 0,"shia lapunch.jpg"), +('2', "You're starstruck feelings blind you to your surroundings. As the two of you get closer, you suddenly find yourself on the ground. You've been suckerpunched by Shia LaBeouf! What's next?!", '3', "Return the favor and punch him back! You ain't no sucka!", 'Aggressive. Triggers combat.', '4', -20, +20, "shia lapunch.jpg"), +('2', "You're starstruck feelings blind you to your surroundings. As the two of you get closer, you suddenly find yourself on the ground. You've been suckerpunched by Shia LaBeouf! What's next?!", '4', 'Start insulting him. His modern art is trash and transformers was only good because of Megan Fox.', 'Aggressive. Triggers combat', '4', -40, 0, "shia lapunch.jpg"), +('3', "He's following you about 30 feet back. He gets down on all fours and breaks into a sprint. He's gaining on you. Shia LaBeouf. You're looking for your car, but you're all turned around. He's almost upon you now and you can see there's blood on his face! My god, there's blood everywhere!",'1', "Run for your life! He's crazed and must be escaped at all costs! Is that a knife in his hands? Is this REALLY Hollywood superstar Shia LaBeouf?!", 'Not aggressive. Safely passes story, lose some health out of fear.', '5', -5, 0, "shia lablood.gif"), +('3', "He's following you about 30 feet back. He gets down on all fours and breaks into a sprint. He's gaining on you. Shia LaBeouf. You're looking for your car, but you're all turned around. He's almost upon you now and you can see there's blood on his face! My god, there's blood everywhere!", '2', "Turn back and take him head on. He's just a regular guy with a drinking problem!", 'Aggressive. Triggers combat.', '4', -20, 0, "shia lablood.gif"), +('3', "He's following you about 30 feet back. He gets down on all fours and breaks into a sprint. He's gaining on you. Shia LaBeouf. You're looking for your car, but you're all turned around. He's almost upon you now and you can see there's blood on his face! My god, there's blood everywhere!", '3', "Run! Run far away! You let the adrenaline in your body push you faster and farther than you can imagine!", 'Not aggressive. Lose health out of fear.', '5', -10, 0, "shia lablood.gif"), +('3', "He's following you about 30 feet back. He gets down on all fours and breaks into a sprint. He's gaining on you. Shia LaBeouf. You're looking for your car, but you're all turned around. He's almost upon you now and you can see there's blood on his face! My god, there's blood everywhere!", '4', "You've been waiting your entire life for this moment. The day you can take Shia LaBeouf head on! You want your money back from all the Holes merchandise you bought. You got an old beat up Camaro because of him that didn't even make it to the summer. This is your revenge!", 'Aggressive. Triggers combat.', '4', -10, 20, "shia lablood.gif"), +('4', "The adrenaline flowing through you, you plan take your stand against Shia LaBeouf. He's coming at you, what's your plan?!", '1', "Run up to him and fake him out. Have him collide face first with your fist. Show him who's the boss!", 'Aggressive. Stuns Shia, leads into option to either run or continue fighting.', '6', 0, 20, "shia lastretch.jpg"), +('4', "The adrenaline flowing through you, you plan take your stand against Shia LaBeouf. He's coming at you, what's your plan?!", '2', "You notice the knife in his pocket. You take the first hit just so you can get close enough to steal it. Turn the tables and attack!", 'Aggressive. Continues combat, gain money, lose health.', '7', -20, 20, "shia lastretch.jpg"), +('4', "The adrenaline flowing through you, you plan take your stand against Shia LaBeouf. He's coming at you, what's your plan?!", '3', "Run! Run far away! You let the adrenaline in your body push you faster and farther than you can imagine!", 'Not aggressive. Lose health out of fear.', '5', -10, 20, "shia lastretch.jpg"), +('4', "The adrenaline flowing through you, you plan take your stand against Shia LaBeouf. He's coming at you, what's your plan?!", '4', "Grab him by his rat tail! Not gonna let some weirdo get the best of you!", 'Aggressive. Stuns Shia, leads into option to either run or continue fighting.', '6', -10, 0, "shia lastretch.jpg"), +('5', "Running for your life, from Shia LaBeouf. He's brandishing a knife! Lurking in the shadows, Hollywood superstar Shia LaBeouf. Living in the woods, killing for sport, eating all the bodies... Actual, cannibal Shia LaBeouf! Now it's dark and you seem to have lost him, but you're hopelessly lost yourself. Stranded with a murderer. You creep silently through the underbrush. A-ha! In the distance, a small cottage with a light on. Whatever shall you do?", '1', "Hope! You move stealthily toward it.", 'Moves story along.. BUT YOUR LEG IS CAUGHT IN A BEAR TRAP!!', '8', -30, 0, "shia larun.jpg"), +('5', "Running for your life, from Shia LaBeouf. He's brandishing a knife! Lurking in the shadows, Hollywood superstar Shia LaBeouf. Living in the woods, killing for sport, eating all the bodies... Actual, cannibal Shia LaBeouf! Now it's dark and you seem to have lost him, but you're hopelessly lost yourself. Stranded with a murderer. You creep silently through the underbrush. A-ha! In the distance, a small cottage with a light on. Whatever shall you do?", '2', "Make a break for it! Someone in there might be able to help you!", 'Bear trap', '8', -30, 0, "shia larun.jpg"), +('5', "Running for your life, from Shia LaBeouf. He's brandishing a knife! Lurking in the shadows, Hollywood superstar Shia LaBeouf. Living in the woods, killing for sport, eating all the bodies... Actual, cannibal Shia LaBeouf! Now it's dark and you seem to have lost him, but you're hopelessly lost yourself. Stranded with a murderer. You creep silently through the underbrush. A-ha! In the distance, a small cottage with a light on. Whatever shall you do?", '3', "Try and go around, make sure you aren't being followed before you make another move.", 'Bear trap', '8', -30, 0, "shia larun.jpg"), +('5', "Running for your life, from Shia LaBeouf. He's brandishing a knife! Lurking in the shadows, Hollywood superstar Shia LaBeouf. Living in the woods, killing for sport, eating all the bodies... Actual, cannibal Shia LaBeouf! Now it's dark and you seem to have lost him, but you're hopelessly lost yourself. Stranded with a murderer. You creep silently through the underbrush. A-ha! In the distance, a small cottage with a light on. Whatever shall you do?", '4', "Get far away from the house. Something tells you it isn't where you want to be.", 'Bear trap', '8', -30, 0, "shia larun.jpg"), +('6', "You've got Shia LaBeouf stunned! A feat of strength and skill agains the vicious hunter! He's temporarily incapacitated, what do you take the chance to do?", '1', "You see the knife he has on his person. Take it to make sure you can still keep the upper hand.", 'Acquire weapon', '7', 0, 10, "shia lastun.jpg"), +('6', "You've got Shia LaBeouf stunned! A feat of strength and skill agains the vicious hunter! He's temporarily incapacitated, what do you take the chance to do?", '2', "Run, the moment of sanctuary should be able to give you enough time to escape!", 'Leads back to the cottage.', '5', 0, 10, "shia lastun.jpg"), +('6', "You've got Shia LaBeouf stunned! A feat of strength and skill agains the vicious hunter! He's temporarily incapacitated, what do you take the chance to do?", '3', "Look for a nearby rock. End the madness now!", 'Curb stomp dat foo', '7', 0, 10, "shia lastun.jpg"), +('6', "You've got Shia LaBeouf stunned! A feat of strength and skill agains the vicious hunter! He's temporarily incapacitated, what do you take the chance to do?", '4', "Attack him! If and when get wakes back up, make sure he's slowed down heavily! Make a run for it into the forest after that!", 'Cripple shot and run!', '5', 0, 0, "shia lastun.jpg"), +('7', "You've take then knife from Shia LaBeouf. You've got the upper hand and can either end it now or make a break for it!", '1', "Throw the knife far away in the opposite direction. Use this as an opportunity to level the playing field as you escape deeper into the forest!", 'Distract, run', '5', 0, -10, "shia lanude.jpg"), +('7', "You've take then knife from Shia LaBeouf. You've got the upper hand and can either end it now or make a break for it!", '2', "Cut off his rat tail, throw it down by him in a display of dominance leave.", 'Still run', '5', 0, 5, "shia lanude.jpg"), +('7', "You've take then knife from Shia LaBeouf. You've got the upper hand and can either end it now or make a break for it!", '3', "Keep the knife, but flee the scene. It's dangerous to be here.", 'run', '5', 0, 0, "shia lanude.jpg"), +('7', "You've take then knife from Shia LaBeouf. You've got the upper hand and can either end it now or make a break for it!", '4', "You can't muster the nerve to end the madness, so you make sure to cover your tracks well. Create a fake path leading to no where as you escape", 'run', '5', 0, 0, "shia lanude.jpg"), +('8', "You move stealthily toward it, But your leg! Ah! It's caught in a bear trap!", '1', "Woozy, you fall over and lose consciousnes. You can't handle the sight of blood.", 'Game Over', '9', -100, 0, "shia lanude.jpg"), +('8', "You move stealthily toward it, But your leg! Ah! It's caught in a bear trap!", '2', "You know you need to move forward at any cost. So you start gnawing off your leg quietly and limp towards the cottage.", 'Move Story', '10', -20, 0, "shia lanude.jpg"), +('8', "You move stealthily toward it, But your leg! Ah! It's caught in a bear trap!", '3', "Getting a second rush of adrenaline, you try to pry open the bear trap.", 'Move Story', '10', -60, 0, "shia lanude.jpg"), +('8', "You move stealthily toward it, But your leg! Ah! It's caught in a bear trap!", '4', "Joke's on the hunter, you've got a prosthetic leg! Well, you did in a dream anyway...", 'Move Story', '9', -100, 0, "shia lanude.jpg"), +('9', "Game over. You've been defeated by Shia LaBeouf.", '1', "Try again.", 'Move Story', '1', 100, 100, "shia lawoods.png"), +('9', "Game over. You've been defeated by Shia LaBeouf.", '1', "You really have to.", 'Move Story', '1', 100, 100, "shia lawoods.png"), +('9', "Game over. You've been defeated by Shia LaBeouf.", '1', "You don't have any choice.", 'Move Story', '1', 100, 100, "shia lawoods.png"), +('9', "Game over. You've been defeated by Shia LaBeouf.", '1', "Yes. Again.", 'Move Story', '1', 100, 100, "shia lawoods.png"), +('10', "Gnawing off your leg quietly, limping toward the cottage quietly. Now you're on the doorstep sitting inside, Shia LaBeouf. Sharpening an ax, but he doesn't hear you enter. You're sneaking up behind him. Strangling superstar Shia LaBeouf. Fighting for your life with Shia LaBeouf! Wrestling a knife from Shia LaBeouf! Stab it in his kidney! Safe at last from Shia LaBeouf.", '1', "Congrats! You're finally safe... From Shia LaBeouf... Press to play again!", 'Move Story', '1', 100, 100, "shia lasafe.png"), +('10', "Gnawing off your leg quietly, limping toward the cottage quietly. Now you're on the doorstep sitting inside, Shia LaBeouf. Sharpening an ax, but he doesn't hear you enter. You're sneaking up behind him. Strangling superstar Shia LaBeouf. Fighting for your life with Shia LaBeouf! Wrestling a knife from Shia LaBeouf! Stab it in his kidney! Safe at last from Shia LaBeouf.", '1', "You really are, don't worry. Let's play again.", 'Move Story', '1', 100, 100, "shia lasafe.png"), +('10', "Gnawing off your leg quietly, limping toward the cottage quietly. Now you're on the doorstep sitting inside, Shia LaBeouf. Sharpening an ax, but he doesn't hear you enter. You're sneaking up behind him. Strangling superstar Shia LaBeouf. Fighting for your life with Shia LaBeouf! Wrestling a knife from Shia LaBeouf! Stab it in his kidney! Safe at last from Shia LaBeouf.", '1', "Boo! He's behind! Nah, just kidding. You are the winner!", 'Move Story', '1', 100, 100, "shia lasafe.png"), +('10', "Gnawing off your leg quietly, limping toward the cottage quietly. Now you're on the doorstep sitting inside, Shia LaBeouf. Sharpening an ax, but he doesn't hear you enter. You're sneaking up behind him. Strangling superstar Shia LaBeouf. Fighting for your life with Shia LaBeouf! Wrestling a knife from Shia LaBeouf! Stab it in his kidney! Safe at last from Shia LaBeouf.", '1', "Ta dah! You are the best!", 'Move Story', '1', 100, 100, "shia lasafe.png"); diff --git a/css/adventure.css b/css/adventure.css index bbaeb69..dc587bb 100644 --- a/css/adventure.css +++ b/css/adventure.css @@ -2,7 +2,8 @@ body{ background-image:url('../images/forest.jpg'); font-family: 'Roboto', sans-serif; - overflow: hidden; + overflow-x: hidden; + overflow-y: auto; } .clickable{ @@ -16,7 +17,7 @@ body{ .shadowed{ -webkit-box-shadow: 3px 3px 23px 0px rgba(50, 50, 50, 0.75); -moz-box-shadow: 3px 3px 23px 0px rgba(50, 50, 50, 0.75); - box-shadow: 3px 3px 23px 0px rgba(50, 50, 50, 0.75); + box-shadow: 3px 3px 23px 0px rgba(50, 50, 50, 0.75); } .greeting-text{ text-align:center; @@ -38,8 +39,14 @@ text-align:center; display: inline-block; } +.situation-image { +width: 80%; +margin-top: 400px; +} - +.adventure { + display: inline-table; +} .option-select{ padding:5px 300px; @@ -56,7 +63,9 @@ text-align:center; display: block; } - +.btn{ + white-space: normal; +} .copyright{ @@ -64,4 +73,4 @@ text-align:center; bottom: 0px; left: 0px; margin: 5px; -} \ No newline at end of file +} diff --git a/images/dark-woods.jpg b/images/dark-woods.jpg new file mode 100644 index 0000000..a9e5337 Binary files /dev/null and b/images/dark-woods.jpg differ diff --git a/images/shia lablood.gif b/images/shia lablood.gif new file mode 100644 index 0000000..cade38e Binary files /dev/null and b/images/shia lablood.gif differ diff --git a/images/shia lacrouch.png b/images/shia lacrouch.png new file mode 100644 index 0000000..6cf4e71 Binary files /dev/null and b/images/shia lacrouch.png differ diff --git a/images/shia lanude.jpg b/images/shia lanude.jpg new file mode 100644 index 0000000..c3e3fca Binary files /dev/null and b/images/shia lanude.jpg differ diff --git a/images/shia lapunch.jpg b/images/shia lapunch.jpg new file mode 100644 index 0000000..42767ee Binary files /dev/null and b/images/shia lapunch.jpg differ diff --git a/images/shia larun.jpg b/images/shia larun.jpg new file mode 100644 index 0000000..7bbf1d5 Binary files /dev/null and b/images/shia larun.jpg differ diff --git a/images/shia lasafe.png b/images/shia lasafe.png new file mode 100644 index 0000000..7ac16ac Binary files /dev/null and b/images/shia lasafe.png differ diff --git a/images/shia lastretch.jpg b/images/shia lastretch.jpg new file mode 100644 index 0000000..834a197 Binary files /dev/null and b/images/shia lastretch.jpg differ diff --git a/images/shia lastun.jpg b/images/shia lastun.jpg new file mode 100644 index 0000000..9c2dc66 Binary files /dev/null and b/images/shia lastun.jpg differ diff --git a/images/shia lawoods.png b/images/shia lawoods.png new file mode 100644 index 0000000..f88759e Binary files /dev/null and b/images/shia lawoods.png differ diff --git a/js/adventure.js b/js/adventure.js index 770d7b3..cd8521b 100644 --- a/js/adventure.js +++ b/js/adventure.js @@ -1,13 +1,12 @@ var Adventures = {}; //currentAdventure is used for the adventure we're currently on (id). This should be determined at the beginning of the program -Adventures.currentAdventure = 0; //todo keep track from db +Adventures.currentAdventure = 0; //currentStep is used for the step we're currently on (id). This should be determined at every crossroad, depending on what the user chose -Adventures.currentStep = 0;//todo keep track from db -Adventures.currentUser = 0;//todo keep track from db +Adventures.currentUser = 0; //TODO: remove for production -Adventures.debugMode = true; +Adventures.debugMode = false; Adventures.DEFAULT_IMG = "./images/choice.jpg"; @@ -49,8 +48,8 @@ Adventures.write = function (message) { $(".situation-text").text(message["text"]).show(); for(var i=0;i', method='GET') def javascripts(filename): @@ -68,9 +165,15 @@ def stylesheets(filename): def images(filename): return static_file(filename, root='images') + +# Local testing +# def main(): +# run(host='localhost', port=9001) + +# Remote server def main(): - run(host='localhost', port=9000) + run(host='0.0.0.0', port=argv[1]) + if __name__ == '__main__': main() - diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1026a5e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +bottle +pymysql \ No newline at end of file