Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
cb890c028c | ||
|
a146880414 | ||
|
ffaedf6979 | ||
|
8f9266fd45 |
16
garbageCan.py
Normal file
16
garbageCan.py
Normal file
@ -0,0 +1,16 @@
|
||||
from garbage import RecognizedGarbage
|
||||
from typing import List, Tuple
|
||||
|
||||
class GarbageCan:
|
||||
position: Tuple[float, float]
|
||||
garbage: List[RecognizedGarbage]
|
||||
|
||||
def __init__(self, position: Tuple[float, float]) -> None:
|
||||
self.position = position
|
||||
self.garbage = []
|
||||
|
||||
def add_garbage(self, garbage: RecognizedGarbage) -> None:
|
||||
self.garbage.append(garbage)
|
||||
|
||||
def remove_garbage(self, garbage: RecognizedGarbage) -> None:
|
||||
self.garbage.remove(garbage)
|
BIN
imgs/a.jpg
Normal file
BIN
imgs/a.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
30
main.py
30
main.py
@ -1,30 +0,0 @@
|
||||
import pygame
|
||||
from gameEventHandler import handle_game_event
|
||||
from gameContext import GameContext
|
||||
from gameContext import startup
|
||||
from PIL import Image
|
||||
|
||||
pygame.init()
|
||||
|
||||
canvas = pygame.display.set_mode((800, 800))
|
||||
|
||||
pygame.display.set_caption("Inteligentna śmieciarka")
|
||||
dust_car_pil = Image.open('imgs/dust_car.png')
|
||||
|
||||
game_context = GameContext()
|
||||
game_context.dust_car_pil = dust_car_pil
|
||||
game_context.dust_car_pygame = pygame.image.frombuffer(dust_car_pil.tobytes(), dust_car_pil.size, 'RGB')
|
||||
game_context.canvas = canvas
|
||||
startup(game_context)
|
||||
|
||||
|
||||
exit = False
|
||||
|
||||
while not exit:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
exit = True
|
||||
else:
|
||||
handle_game_event(event, game_context)
|
||||
|
||||
pygame.display.update()
|
Loading…
Reference in New Issue
Block a user