-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic-rpg.js
More file actions
67 lines (57 loc) · 2.87 KB
/
Copy pathbasic-rpg.js
File metadata and controls
67 lines (57 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*function checkSupported() {
let canvas = document.getElementById('canvas');
if (canvas.getContext){
let ctx = canvas.getContext('2d');
} else {
alert("We're sorry, but your browser does not support the canvas tag. Please use any web browser other than Internet Explorer.");
}
}*/
function help() {
alert("help! I am trapped in the alert box. use the buttons to help me escape. Be quick, we only have 30 seconds from when you take the pill.");
}
help();
function closeWindow() {
window.close()
}
let numOfPills = 0;
function newPill() {
document.getElementById("help").style.color = "#FF0000";
numOfPills ++;
if (numOfPills === 1) {
alert("those pills are tasty. more!");
numOfPills ++;
if (numOfPills === 2) {
alert("yum");
numOfPills++;
if (numOfPills === 3) {
alert("YUM");
numOfPills ++;
document.getElementById("redPill").style.color = "#FF0000";
if (numOfPills === 4) {
alert("are you annoyed yet?");
numOfPills ++;
if (numOfPills === 5) {
alert("THE POWER!!! EVEN MORE!!!");
document.body.style.background= "#FF0000";
numOfPills ++;
if (numOfPills === 6) {
alert("I think I can make a new button... no idea what it does...");
//document.getElementById("snake").innerHTML = "<button id='sum' onclick='summonSnake()'>Click to summon the snake</button>";
document.getElementById("help").style.color = "#FFFFFF";
document.getElementById("snake").innerHTML="<button id='sum' onclick='summonSnake()'>Click to summon the Snake</button>'"
}
}
}
}
}
}
}
function summonSnake() {
alert("OH NO BEN HAS FILLED ALL THE HOMEWORK CRITERIA DO NOT CLICK THAT... you clicked it didn't you. not all games end happily... its been a short ride but this is the end. The snake will crush us in seconds... unless you buy the bonus pack from the developer for the cheap cost of $199.99");
document.getElementById('sum').parentNode.removeChild(document.getElementById('sum'));
document.getElementById("snake").innerHTML="<img alt='a snek boi' src='aHR0cDovL3d3dy5saXZlc2NpZW5jZS5jb20vaW1hZ2VzL2kvMDAwLzA2OS83NzQvb3JpZ2luYWwvY29icmEtc25ha2UtMTQwODI5LmpwZw==.webp'>";
setTimeout( function () {document.getElementById("help").innerHTML="<h1>IM BEING CRUSHED</h1>"},100);
setTimeout( function () {alert("arrragaghiu")},1000);
while (numOfPills === 6) {
console.log("[secret knowledge] pills taken... game ending shortly")
}}