Machine_learning_2023/Interface/vacuum_render.py

23 lines
622 B
Python
Raw Normal View History

2023-03-12 16:22:51 +01:00
from Interface.grid_draw import GridDraw, Colors
2023-03-12 18:11:31 +01:00
import sys
import pygame
2023-03-12 20:10:18 +01:00
from Interface.movement import moving_cleaner
2023-03-11 19:31:43 +01:00
2023-03-16 20:33:22 +01:00
2023-03-12 20:10:18 +01:00
def initial_draw(grid_width, grid_height):
grid = GridDraw(grid_width, grid_height)
tile_width = grid_width / 10
tile_height = grid_height / 10
2023-03-12 18:11:31 +01:00
x = tile_width / 2
y = tile_height / 2
radius = 15
2023-03-16 20:33:22 +01:00
# rendering loop
2023-03-12 16:22:51 +01:00
while True:
grid.start_draw()
grid.board(10, 10)
2023-03-16 20:33:22 +01:00
(x, y) = moving_cleaner(grid_width, grid_height, tile_width, tile_height, x, y)
2023-03-12 18:11:31 +01:00
grid.circle(x, y, 20, color=Colors.RED)
2023-03-16 20:33:22 +01:00
grid.end_draw()
pygame.time.delay(10)