-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpypet_classes.py
More file actions
105 lines (72 loc) · 2.47 KB
/
pypet_classes.py
File metadata and controls
105 lines (72 loc) · 2.47 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
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
96
97
98
99
100
101
102
103
104
#!/usr/bin/env python3
""" PyPet - A Virtual Pet Game In Python - You must take care of your pet.
Inspired by things like Tamagotchi
Since this is terminal based, I plan to add in color, probably via the Colorama Module
In the future, I'll write a Javascript version of this game, so people can play it on the web
Non-working at present. See "Design Notes.txt" and/or "Readme.md" for more info
"""
class Pet(object):
"""Factory Class to Produce Pets"""
def __init__(self, name, key):
self.name = name
self.hungry = True
self.starved = False
self.bored = False
self.upset = False
self.violent = False
self.sleepy = False
self.key = key
self.messages = {
'hungry': "I'm Hungry!!",
'bored': "*Your pet says in a voice, strangely remiminiscent of Willow* Bored Now",
'upset' : "UGH - what the hell?!",
'awake' : "Alright, alright - I'm awake already",
'asleep' : "Your pet is in a deep sleep",
'sleepy' : "Your pet looks like it could really use a rest..."
}
def message_output(self, key):
self.key = key
print(self.messages[self.key])
class Cat(Pet):
""" Everybody wants to be a Cat """
def __init__(self, name, key):
# super(Pet, self).__init__()
self.name = name
self.key = key
pass
class Rat(Pet):
""" Rats are so much nicer than Mice """
def __init__(self):
super(Rat, self).__init__()
self.arg = arg
pass
class Mouse(Pet):
""" How Very Mousy """
def __init__(self):
super(Mouse, self).__init__()
self.arg = arg
pass
class Bunny(Pet):
""" Buns are the cutest :) """
def __init__(self):
super(Bunny, self).__init__()
self.arg = arg
pass
class Turtle(Pet):
""" Slow & Steady wins the race """
def __init__(self):
super(Turtle, self).__init__()
self.arg = arg
pass
def intro():
print("Welcome to PyPet!")
print("What type of pet would you like to be?")
print("")
def menu(pet_choice):
"""Things you can do with your Pet"""
def game_loop():
print("Welcome to PyPet")
cat_pet = Cat('harry', 'hungry')
Cat.message_output('hungry')
if __name__ == '__main__':
game_loop()