refactor: improve piece class readability
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Tuple
|
||||
from typing import List, Tuple
|
||||
import pygame
|
||||
|
||||
from util.ConfigurationManager import ConfigurationManager
|
||||
@@ -28,3 +28,11 @@ class Entity:
|
||||
if square_one[i][0] == square_two[i][0] and square_one[i][1] == square_two[i][1]:
|
||||
return True
|
||||
return False
|
||||
|
||||
def collide_points(self, points: List) -> bool: # TODO change name later
|
||||
for square_one in self.points:
|
||||
for square_two in points:
|
||||
for i in range(4): # 4 vertices
|
||||
if square_one[i][0] == square_two[i][0] and square_one[i][1] == square_two[i][1]:
|
||||
return True
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user