forked from djferg/civ-ipriot-smiley
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsad.py
More file actions
30 lines (25 loc) · 736 Bytes
/
Copy pathsad.py
File metadata and controls
30 lines (25 loc) · 736 Bytes
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
from smiley import Smiley
class Sad(Smiley):
def __init__(self):
super().__init__()
self.draw_mouth()
self.draw_eyes()
def draw_mouth(self):
"""
Draws the mouth feature on a smiley
"""
mouth = [49, 54, 42, 43, 44, 45]
for pixel in mouth:
self.pixels[pixel] = self.BLANK
def draw_eyes(self, wide_open=True):
"""
Draws open or closed eyes on a smiley
:param wide_open: Render eyes wide open or shut
"""
eyes = [10, 13, 18, 21]
for pixel in eyes:
if wide_open:
eyes = self.BLANK
else:
eyes = self.YELLOW
self.pixels[pixel] = eyes