Last active
October 5, 2017 11:25
-
-
Save adnjoo/b637e9635c0d856028e88c33b4a2f6e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#maintext { | |
font-family: Helvetica; | |
font-size: 32px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href="index.css" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> | |
<div id='maintext'>You wake up groggy in a dark room.</div> | |
<img id ='image' src=''> | |
<br><br> | |
<button onclick='myFunction()'>Click me!</button> | |
<script src="index.js"></script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var counter = 0; | |
var responses = ['You find a key on the desk','And open the door with it','Holy s*$& it\'s an ugly @$$ monster', 'You slay the monster', 'Good Job GG','','','','','','What do you want you win already'] | |
function myFunction (){ | |
console.log(counter) | |
document.getElementById('maintext').innerHTML=responses[counter] | |
if (counter==2) { | |
document.getElementById('image').src='https://i.imgur.com/CSnJ3jv.png' | |
} | |
else if (counter ==3) { | |
document.getElementById('image').src='' | |
} | |
else if(counter==5) { | |
window.alert('ok you win') | |
} | |
else if(counter==20) { | |
counter=-1; | |
} | |
counter++ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment