forked from HipsterDave/The-Legend-of-Talera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.py
46 lines (41 loc) · 1.09 KB
/
game.py
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
import functions
import text
import sys
import time
import random
import os
import levels
typingspeed = 100
def clear():
if sys.platform.startswith("linux"):
os.system("clear")
elif sys.platform.startswith("win32"):
os.system("cls")
def typing(text):
for letter in text:
sys.stdout.write(letter)
sys.stdout.flush()
time.sleep(random.random()*10/typingspeed)
def settype(text, typing_speed):
for letter in text:
sys.stdout.write(letter)
sys.stdout.flush()
time.sleep(random.random()*10/typing_speed)
def tutorial():
clear()
typing("Ah, I see... This is your first time playing THE LEGEND OF TALERA!\n")
typing("Who am I? I am THE DEVELOPER! I will guide you through your quests!\n")
typing("Now... Who are you?\n")
name = input("> ")
typing("Hello, " + name + "!\n")
typing("Since it is your first time playing, here are the rules.\n")
typing("Pick the right answer.\n")
typing("Here are the current levels!\n")
text.levels()
levelpick = ""
while levelpick not in ["1", "2"]:
levelpick = input("> ")
if levelpick == "1":
levels.mines()
elif levelpick == "2":
levels.forest()