/*
* FadeIn animation
*/
@-webkit-keyframes fadeIn {
0% {opacity: 0;}
100% {opacity: 1;}
}
@keyframes fadeIn {
0% {opacity: 0;}
100% {opacity: 1;}
}
.fadeIn {
-webkit-animation-name: fadeIn;
animation-name: fadeIn;
}
/*
* FadeOut animation
*/
@-webkit-keyframes fadeOut {
0% {opacity: 1;}
100% {opacity: 0;}
}
@keyframes fadeOut{
0% {opacity: 1;}
100% {opacity: 0;}
}
.fadeOut {
-webkit-animation-name: fadeOut;
animation-name: fadeOut;
}
2 Responses
def __init__(self):
self.knowledge_points = 0
self.current_level = 1
def start_game(self):
print("Welcome to Infinite Campus!")
print("A place of endless learning and mysteries.")
self.level_one()
def level_one(self):
print("\n--- LEVEL 1: THE LIBRARY OF LOST KNOWLEDGE ---")
print("You are in a dimly lit library filled with towering shelves of books.")
print("Find 5 Knowledge Points to unlock the exit door.")
while self.knowledge_points < 5:
action = input("Do you want to (1) search for books or (2) talk to the Librarian Ghost? ")
if action == "1":
self.search_books()
elif action == "2":
self.talk_to_ghost()
else:
print("Invalid choice. Please try again.")
print("You have collected 5 Knowledge Points! A hidden door appears.")
self.current_level = 2
self.level_two()
def search_books(self):
print("You search the shelves for books...")
found_book = self.random_book()
if found_book:
self.knowledge_points += 1
print("You found a glowing book! Knowledge Points:", self.knowledge_points)
else:
print("No glowing books here. Keep looking.")
def random_book(self):
import random
return random.choice([True] * 3 + [False]) # 75% chance to find a book
def talk_to_ghost(self):
print("Librarian Ghost whispers: Seek out the hidden knowledge in these halls.")
def level_two(self):
print("\n--- LEVEL 2: HALLWAY OF PAST STUDENTS ---")
print("You enter a hallway lined with photos of past students. You feel like you're being watched.")
self.hallway_challenge()
def hallway_challenge(self):
while True:
choice = input("Do you want to (1) try a door or (2) examine the photos? ")
if choice == "1":
if self.try_door():
break
else:
print("You triggered the Lost Bells! Starting over...")
elif choice == "2":
print("You examine the photos for clues...")
print("You find a pattern that leads you to the correct door!")
break
else:
print("Invalid choice. Please try again.")
print("You've chosen the correct path. Moving on to the cafeteria!")
self.current_level = 3
self.level_three()
def try_door(self):
import random
return random.choice([True, False]) # 50% chance to choose the correct door
def level_three(self):
print("\n--- LEVEL 3: THE CAFETERIA OF CHAOS ---")
print("You enter a chaotic cafeteria filled with strange-looking food.")
self.cafeteria_choice()
def cafeteria_choice(self):
while True:
food_choice = input("Do you want to eat (1) Mystery Meat, (2) Enchanted Veggies, or (3) Spicy Brain Berries? ")
if food_choice == "1":
print("You eat the Mystery Meat. You feel a bit queasy...")
break
elif food_choice == "2":
print("You eat the Enchanted Veggies. You feel energized!")
self.knowledge_points += 2
print("Knowledge Points:", self.knowledge_points)
break
elif food_choice == "3":
print("You eat the Spicy Brain Berries. Your mind is racing!")
self.knowledge_points += 1
break
else:
print("Invalid choice. Please try again.")
print("You are now ready for the Headmaster's quiz.")
self.level_four()
def level_four(self):
print("\n--- LEVEL 4: THE HEADMASTER'S QUIZ ---")
print("Answer the questions correctly to graduate from Infinite Campus.")
correct_answers = 0
questions = [
("What is the purpose of knowledge?\n1. To show superiority\n2. To solve problems\n3. To pass tests", 2),
("Which of these is more powerful—knowledge or curiosity?\n1. Knowledge\n2. Curiosity", 2),
("Why do you wish to leave Infinite Campus?\n1. To find freedom\n2. To continue learning elsewhere\n3. To avoid more questions", 2)
]
for question, answer in questions:
response = input(f"{question} ")
if int(response) == answer:
print("Correct!")
correct_answers += 1
else:
print("Incorrect. The correct answer was:", answer)
if correct_answers == len(questions):
print("Congratulations! You answered all questions correctly.")
print("You step through the final door, leaving Infinite Campus behind.")
else:
print("You didn't pass the quiz. The Headmaster sends you back to start over.")
if __name__ == "__main__":
game = InfiniteCampusGame()
game.start_game()
def __init__(self):
self.knowledge_points = 0
self.current_level = 1
def start_game(self):
print("Welcome to Infinite Campus!")
print("A place of endless learning and mysteries.")
self.level_one()
def level_one(self):
print("\n--- LEVEL 1: THE LIBRARY OF LOST KNOWLEDGE ---")
print("You are in a dimly lit library filled with towering shelves of books.")
print("Find 5 Knowledge Points to unlock the exit door.")
while self.knowledge_points < 5:
action = input("Do you want to (1) search for books or (2) talk to the Librarian Ghost? ")
if action == "1":
self.search_books()
elif action == "2":
self.talk_to_ghost()
else:
print("Invalid choice. Please try again.")
print("You have collected 5 Knowledge Points! A hidden door appears.")
self.current_level = 2
self.level_two()
def search_books(self):
print("You search the shelves for books...")
found_book = self.random_book()
if found_book:
self.knowledge_points += 1
print("You found a glowing book! Knowledge Points:", self.knowledge_points)
else:
print("No glowing books here. Keep looking.")
def random_book(self):
import random
return random.choice([True] * 3 + [False]) # 75% chance to find a book
def talk_to_ghost(self):
print("Librarian Ghost whispers: Seek out the hidden knowledge in these halls.")
def level_two(self):
print("\n--- LEVEL 2: HALLWAY OF PAST STUDENTS ---")
print("You enter a hallway lined with photos of past students. You feel like you're being watched.")
self.hallway_challenge()
def hallway_challenge(self):
while True:
choice = input("Do you want to (1) try a door or (2) examine the photos? ")
if choice == "1":
if self.try_door():
break
else:
print("You triggered the Lost Bells! Starting over...")
elif choice == "2":
print("You examine the photos for clues...")
print("You find a pattern that leads you to the correct door!")
break
else:
print("Invalid choice. Please try again.")
print("You've chosen the correct path. Moving on to the cafeteria!")
self.current_level = 3
self.level_three()
def try_door(self):
import random
return random.choice([True, False]) # 50% chance to choose the correct door
def level_three(self):
print("\n--- LEVEL 3: THE CAFETERIA OF CHAOS ---")
print("You enter a chaotic cafeteria filled with strange-looking food.")
self.cafeteria_choice()
def cafeteria_choice(self):
while True:
food_choice = input("Do you want to eat (1) Mystery Meat, (2) Enchanted Veggies, or (3) Spicy Brain Berries? ")
if food_choice == "1":
print("You eat the Mystery Meat. You feel a bit queasy...")
break
elif food_choice == "2":
print("You eat the Enchanted Veggies. You feel energized!")
self.knowledge_points += 2
print("Knowledge Points:", self.knowledge_points)
break
elif food_choice == "3":
print("You eat the Spicy Brain Berries. Your mind is racing!")
self.knowledge_points += 1
break
else:
print("Invalid choice. Please try again.")
print("You are now ready for the Headmaster's quiz.")
self.level_four()
def level_four(self):
print("\n--- LEVEL 4: THE HEADMASTER'S QUIZ ---")
print("Answer the questions correctly to graduate from Infinite Campus.")
correct_answers = 0
questions = [
("What is the purpose of knowledge?\n1. To show superiority\n2. To solve problems\n3. To pass tests", 2),
("Which of these is more powerful—knowledge or curiosity?\n1. Knowledge\n2. Curiosity", 2),
("Why do you wish to leave Infinite Campus?\n1. To find freedom\n2. To continue learning elsewhere\n3. To avoid more questions", 2)
]
for question, answer in questions:
response = input(f"{question} ")
if int(response) == answer:
print("Correct!")
correct_answers += 1
else:
print("Incorrect. The correct answer was:", answer)
if correct_answers == len(questions):
print("Congratulations! You answered all questions correctly.")
print("You step through the final door, leaving Infinite Campus behind.")
else:
print("You didn't pass the quiz. The Headmaster sends you back to start over.")
if __name__ == "__main__":
game = InfiniteCampusGame()
game.start_game()
Write a comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.