-
Notifications
You must be signed in to change notification settings - Fork 0
/
platforms.py
37 lines (30 loc) · 878 Bytes
/
platforms.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
import pygame
import sys
import globals
from pygame.locals import *
class Staff:
"""Class for different staff lines as platforms for the notes
Attributes:
rect: pygame.Rect object
surf: pygame.Surface object
y: int
This will create a rectangular line accross the screen at a certain y value.
"""
THICKNESS = 4
def __init__(self, y):
"""
Initialize a Staff object
Args:
y: int
"""
self.surf = pygame.Surface((globals.WIDTH, self.THICKNESS))
self.surf.fill((255, 255, 255))
self.y = y
self.rect = self.surf.get_rect(center=(globals.WIDTH / 2, self.y))
def draw(self, surface):
"""
Draw the Staff object on the screen
Args:
surface: pygame.Surface object
"""
surface.blit(self.surf, self.rect)