|
@@ -11,6 +11,8 @@ from pygame import Surface |
|
|
from pygame.time import Clock |
|
|
from pygame.time import Clock |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FPS = 24 |
|
|
|
|
|
|
|
|
def main ( |
|
|
def main ( |
|
|
) -> None: |
|
|
) -> None: |
|
|
pygame.init () |
|
|
pygame.init () |
|
@@ -56,7 +58,7 @@ class Game: |
|
|
for redrawer in sorted (self.redrawers, key = lambda x: x['layer']): |
|
|
for redrawer in sorted (self.redrawers, key = lambda x: x['layer']): |
|
|
redrawer['func'] () |
|
|
redrawer['func'] () |
|
|
pygame.display.update () |
|
|
pygame.display.update () |
|
|
self.clock.tick (24) |
|
|
|
|
|
|
|
|
self.clock.tick (FPS) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GameObject: |
|
|
class GameObject: |
|
@@ -187,5 +189,14 @@ def get_surfaces_from_video ( |
|
|
return surfaces |
|
|
return surfaces |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_chroma_key ( |
|
|
|
|
|
surface: Surface, |
|
|
|
|
|
color: tuple[int, int, int], |
|
|
|
|
|
tolerance: int, |
|
|
|
|
|
) -> Surface: |
|
|
|
|
|
# ChatGPT o kwakunin suru kutu |
|
|
|
|
|
... |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
|
main () |
|
|
main () |