summaryrefslogtreecommitdiff
path: root/cameltris/piece.py
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2021-11-12 13:56:06 +0100
committerOlivier Gayot <olivier.gayot@sigexec.com>2021-11-12 13:56:06 +0100
commit4df942db913383d2b2c829f8b89c306a1f75cd9d (patch)
treea9439f58c3da07053b5cccb972a384cd57674174 /cameltris/piece.py
parentec63226505a02745525cad3b6f860b9f15d575cd (diff)
Add some documentation to the cameltris.piece module
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'cameltris/piece.py')
-rw-r--r--cameltris/piece.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/cameltris/piece.py b/cameltris/piece.py
index 2f3e7ce..1bbe2c4 100644
--- a/cameltris/piece.py
+++ b/cameltris/piece.py
@@ -1,3 +1,5 @@
+""" Module that defines all types of pieces """
+
import pygame
@@ -15,13 +17,17 @@ cyan = (30, 164, 150)
class Piece:
+ """ A piece class that provides default methods for performing rotations """
def __init__(self):
+ """ Initialize a piece """
self.square = square_template.copy()
def rotate_clockwise(self):
+ """ Rotate the piece clockwise """
self.elements = list(zip(*self.elements[::-1]))
def rotate_counter_clockwise(self):
+ """ Rotate the piece counter-clockwise """
self.rotate_clockwise()
self.rotate_clockwise()
self.rotate_clockwise()