Machine_learning_2023/Interface/vacuum_render.py
2023-03-16 20:33:22 +01:00

23 lines
622 B
Python

from Interface.grid_draw import GridDraw, Colors
import sys
import pygame
from Interface.movement import moving_cleaner
def initial_draw(grid_width, grid_height):
grid = GridDraw(grid_width, grid_height)
tile_width = grid_width / 10
tile_height = grid_height / 10
x = tile_width / 2
y = tile_height / 2
radius = 15
# rendering loop
while True:
grid.start_draw()
grid.board(10, 10)
(x, y) = moving_cleaner(grid_width, grid_height, tile_width, tile_height, x, y)
grid.circle(x, y, 20, color=Colors.RED)
grid.end_draw()
pygame.time.delay(10)