From e7c5af8fbadd9db8c875ec3cbf5f413add393960 Mon Sep 17 00:00:00 2001 From: KikooDX Date: Tue, 28 Apr 2020 15:15:57 +0200 Subject: [PATCH] Screen size is now noted as a constant --- casioplot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/casioplot.py b/casioplot.py index 1be3584..0bf42fe 100644 --- a/casioplot.py +++ b/casioplot.py @@ -2,15 +2,15 @@ import pygame pygame.init() -screen_width = 384 -screen_height = 192 -screen = pygame.display.set_mode((screen_width, screen_height)) +SCREEN_WIDTH = 384 +SCREEN_HEIGHT = 192 +screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) draw_string = print def set_pixel(x, y, color): pygame.draw.rect(screen, color, pygame.Rect(x, y, 1, 1)) def get_pixel(x, y): - if x >= screen_width or y >= screen_height or x < 0 or y < 0: + if x >= SCREEN_WIDTH or y >= SCREEN_HEIGHT or x < 0 or y < 0: return None return screen.get_at((x, y))[:2] def clear_screen():