Compare commits

...

4 Commits
master ... test

Author SHA1 Message Date
Wiktor Szynaka
cb890c028c garbageCan 2023-03-26 14:33:33 +02:00
Wiktor Szynaka
a146880414 srodowisko 2023-03-11 08:23:30 +01:00
Wiktor Szynaka
ffaedf6979 Merge branch 'master' of https://git.wmi.amu.edu.pl/s473616/sztuczna_inteligencja_2023_smieciarka into test 2023-03-11 08:21:09 +01:00
Wiktor Szynaka
8f9266fd45 test 2023-03-06 12:05:54 +01:00
3 changed files with 16 additions and 30 deletions

16
garbageCan.py Normal file
View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

30
main.py
View File

@ -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()