-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathez.py
95 lines (71 loc) · 1.97 KB
/
ez.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import os
import random
import pygame
def cls():
os.system('cls' if os.name=='nt' else 'clear')
class pStats():
def __init__(self, _name, _level, _atk, _def, _hp):
self.Name = _name
self.Level = _level
self.Atk = _atk
self.Def = _def
self.HP = _hp
Name = ""
Level = 1
Atk = 1
Def = 1
HP = 1
class Player(pStats):
def __init__(self, _name, _gender):
self.Gender = _gender
pStats.__init__(self, _name, 1, 2 + self.Level, 1 + self.Level, 10 + self.Level)
def printStats(self):
print("Name:", self.Name)
print("Gender:", self.Gender)
print("Level:", self.Level)
print("Atk:", self.Atk)
print("Def:", self.Def)
print("HP:", self.HP)
Gender = "F"
class Enemy(pStats):
def __init__(self, _name, _level, _atk, _def, _hp):
pStats.__init__(self, _name, _level, _atk, _def, _hp)
def printStats(self):
print("Enemy Name:", self.Name)
print("Enemy Level:", self.Level)
def main():
# Clear Screen
cls()
# Input Name
tempName = input("What is your name Adventurer: ")
tempGender = ""
# Input Gender with Check
while(tempGender not in ["y", "n"]):
tempGender = input("Small PP (y/n): ")
if tempGender == "y":
tempGender = "M"
else:
tempGender = "F"
# Creation of Hero Object
Hero = Player(tempName, tempGender)
# Clear Screen
cls()
# Print Stats
Hero.printStats()
input("Press Enter to continue...")
print("You Encountered a Goblin!")
input("Press Enter to continue...")
Goblin = Enemy("Goblin", random.randint(1, 2), random.randint(1, 4), random.randint(1, 3), random.randint(5, 10))
cls()
Goblin.printStats()
###################################
#.................................#
#........................A........#
#.................A...............#
#......A..........................#
#..............X..................#
#..A..............................#
#.................................#
###################################
# Calling Main Function
main()