From 41ce7f02e1395d4b91ecb2481d74e286f102cc13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 29 Apr 2021 03:27:19 +0200 Subject: [PATCH] Pygame --- README.md | 4 ++-- index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 439cce2..2ff7e35 100644 --- a/README.md +++ b/README.md @@ -2917,7 +2917,7 @@ pg.init() screen = pg.display.set_mode((500, 500)) rect = pg.Rect(240, 240, 20, 20) while all(event.type != pg.QUIT for event in pg.event.get()): - deltas = {pg.K_UP: (0, -3), pg.K_RIGHT: (3, 0), pg.K_DOWN: (0, 3), pg.K_LEFT: (-3, 0)} + deltas = {pg.K_UP: (0, -1), pg.K_RIGHT: (1, 0), pg.K_DOWN: (0, 1), pg.K_LEFT: (-1, 0)} for key_code, is_pressed in enumerate(pg.key.get_pressed()): rect = rect.move(deltas[key_code]) if key_code in deltas and is_pressed else rect screen.fill((0, 0, 0)) @@ -2964,7 +2964,7 @@ from pygame.transform import scale, … ``` ```python -from pygame.draw import line, arc, rect +from pygame.draw import line, … line(, color, (x1, y1), (x2, y2), width) # Draws a line to the surface. arc(, color, , from_rad, to_rad) # Also: ellipse(, color, ) rect(, color, ) # Also: polygon(, color, points) diff --git a/index.html b/index.html index 099d36c..223ce25 100644 --- a/index.html +++ b/index.html @@ -2511,7 +2511,7 @@ pg.init() screen = pg.display.set_mode((500, 500)) rect = pg.Rect(240, 240, 20, 20) while all(event.type != pg.QUIT for event in pg.event.get()): - deltas = {pg.K_UP: (0, -3), pg.K_RIGHT: (3, 0), pg.K_DOWN: (0, 3), pg.K_LEFT: (-3, 0)} + deltas = {pg.K_UP: (0, -1), pg.K_RIGHT: (1, 0), pg.K_DOWN: (0, 1), pg.K_LEFT: (-1, 0)} for key_code, is_pressed in enumerate(pg.key.get_pressed()): rect = rect.move(deltas[key_code]) if key_code in deltas and is_pressed else rect screen.fill((0, 0, 0)) @@ -2548,7 +2548,7 @@ rect = pg.Rect(240, 2 <Surf> = rotate(<Surf>, degrees) # Returns rotated and scaled surface. <Surf> = flip(<Surf>, x_bool, y_bool) # Returns flipped surface. -
from pygame.draw import line, arc, rect
+
from pygame.draw import line, …
 line(<Surf>, color, (x1, y1), (x2, y2), width)  # Draws a line to the surface.
 arc(<Surf>, color, <Rect>, from_rad, to_rad)    # Also: ellipse(<Surf>, color, <Rect>)
 rect(<Surf>, color, <Rect>)                     # Also: polygon(<Surf>, color, points)