-
Notifications
You must be signed in to change notification settings - Fork 0
/
block.py
18 lines (15 loc) · 898 Bytes
/
block.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pygame as py
from boundary import Boundary
class Block():
def __init__(self, posx, posy):
self.posx = posx
self.posy = posy
self.resta = 22
self.bondary1 = Boundary(self.posx - self.resta, self.posy - self.resta, self.posx + self.resta, self.posy - self.resta,)
self.bondary2 = Boundary(self.posx - self.resta, self.posy - self.resta, self.posx - self.resta, self.posy + self.resta,)
self.bondary3 = Boundary(self.posx + self.resta, self.posy - self.resta, self.posx + self.resta, self.posy + self.resta,)
self.bondary4 = Boundary(self.posx - self.resta, self.posy + self.resta, self.posx + self.resta, self.posy + self.resta,)
self.walls = [self.bondary1, self.bondary2, self.bondary3, self.bondary4]
def show(self, surface, color):
for wall in self.walls:
wall.show(surface, color)