2023-02-18 22:33:32 -05:00
|
|
|
import time
|
|
|
|
|
|
|
|
import pygame
|
|
|
|
|
|
|
|
|
|
|
|
def game():
|
|
|
|
"""
|
|
|
|
Starts the game.
|
|
|
|
"""
|
|
|
|
pygame.init()
|
|
|
|
|
|
|
|
# Hide the cursor for the Pi display.
|
|
|
|
pygame.mouse.set_visible(False)
|
|
|
|
|
|
|
|
# The game is normally rendered at 80 pixels and upscaled from there. If changing displays, change the
|
|
|
|
# screen_size to reflect what the resolution of the new display is.
|
2023-02-19 11:56:28 -05:00
|
|
|
screen_size = 720
|
2023-02-18 22:33:32 -05:00
|
|
|
|
|
|
|
window = pygame.display.set_mode((screen_size, screen_size))
|
|
|
|
surface = pygame.Surface((screen_size, screen_size))
|
|
|
|
|
|
|
|
clock = pygame.time.Clock()
|
|
|
|
|
2023-02-19 12:08:00 -05:00
|
|
|
while True:
|
|
|
|
clock.tick(60)
|
|
|
|
window.fill((0, 0, 0))
|
|
|
|
mouse_pos = pygame.mouse.get_pos()
|
|
|
|
|
|
|
|
pygame.draw.line(window, (255, 255, 255), (720/2, 720/2), mouse_pos, 5)
|
2023-02-19 11:56:28 -05:00
|
|
|
pygame.display.flip()
|
2023-02-19 12:08:00 -05:00
|
|
|
|
|
|
|
for event in pygame.event.get():
|
|
|
|
if event.type == pygame.QUIT:
|
|
|
|
pygame.quit()
|
2023-02-19 11:56:28 -05:00
|
|
|
|
2023-02-18 22:33:32 -05:00
|
|
|
|
|
|
|
pygame.quit()
|
|
|
|
|
|
|
|
game()
|