-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemotions.py
More file actions
113 lines (94 loc) · 3.13 KB
/
Copy pathemotions.py
File metadata and controls
113 lines (94 loc) · 3.13 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
105
106
107
108
109
110
111
112
113
import head
import random
import pygame
import maestro
import xbox
import drive
import time
#VARIABLES
#
# FUNCTIONS
#
def playSnd(file) :
global channel
file = "/home/pi/walle/Sounds/" + file
if file[-3:] == "wav":
channel.play(pygame.mixer.Sound(file))
else:
pygame.mixer.music.load(file)
pygame.mixer.music.play()
class Emotions:
def __init__(self, head):
self.head = head
#
# EMOTION OPTIONS
#:
def happy(self):
playSnd("Chatter 2.mp3")
self.head.browCenter()
self.head.lookCentered()
def curious(self):
self.head.lookCentered()
self.head.browCenter()
def sad(self):
playSnd("Ohhhh.mp3")
self.head.browDown()
self.head.lookDown()
self.head.lookLeft()
def pissed(self):
playSnd("Motor whir.mp3")
self.head.browUp()
self.head.lookCentered()
playSnd("Jitters.mp3")
def startled(self):
playSnd("Whoohoo.mp3")
self.head.lookCentered()
self.head.browCenter()
def intro(self):
self.head.lookUp()
self.head.browCenter()
#playSnd("Walle Name.mp3")
playSnd ("Walle Name.mp3")
# function to select an emotion
def Outburst(self):
selectEm = random.randint(0,5)
if selectEm == 0:
self.happy()
elif selectEm == 1:
self.curious()
elif selectEm == 2:
self.sad()
elif selectEm == 3:
self.pissed()
elif selectEm == 4:
self.startled()
else:
self.intro()
print selectEm
# BAD WOLF
def easterEgg(self):
#if egg == 0:
# self.head.lookCentered()
# self.head.browUp()
self.head.lookUp()
self.head.browUp()
playSnd("Yowl.mp3")
# self.head.lookLeft()
# self.head.lookRight()
# self.head.lookLeft()
# self.head.lookRight()
# self.head.lookLeft()
#Drive in circles, maybe?
#playSnd("Whoa 2.mp3")
#else:
# self.intro()
#Additional Thoughts
"""
Play the Sad emotion if Wall-E receives no input in a 20 second interval
play the happy emotion the first time someone moves the left joystick
play the easterEgg emotion the first time the Y Button is pressed
(Preferably pressed after someone says "Alex is driving")
easterEgg will cause walle to scream and drive in circles
while shaking his head no
This emotion will be set to only activate once using a boolean ADR
"""