From c58b3811220f0810d770b83bda34bbf46c5bd2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 5 Apr 2023 19:59:22 +0200 Subject: [PATCH] Pygame --- README.md | 6 +++--- index.html | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 393da6e..1308bee 100644 --- a/README.md +++ b/README.md @@ -3045,14 +3045,14 @@ rect(, color, , width=0) # Also polygon(, color, po ### Font ```python - = pg.font.Font(, size) # Loads the TTF file. Pass None for default. + = pg.font.Font(, size) # Loads TTF file. Pass None for default font. = .render(text, antialias, color) # Background color can be specified at the end. ``` ### Sound ```python - = pg.mixer.Sound() # Loads the WAV file or array of signed shorts. -.play() # Starts playing the sound. + = pg.mixer.Sound() # Loads WAV file or array of signed shorts. +.play/stop() # Also .set_volume(). ``` ### Basic Mario Brothers Example diff --git a/index.html b/index.html index bc53873..ae5be46 100644 --- a/index.html +++ b/index.html @@ -2482,12 +2482,12 @@ line(<Surf>, color, (x1, y1), (x2, y2), width) # Also ellipse(<Surf>, color, <Rect>, width=0). rect(<Surf>, color, <Rect>, width=0) # Also polygon(<Surf>, color, points, width=0). -

Font

<Font> = pg.font.Font(<path/file>, size)        # Loads the TTF file. Pass None for default.
+

Font

<Font> = pg.font.Font(<path/file>, size)        # Loads TTF file. Pass None for default font.
 <Surf> = <Font>.render(text, antialias, color)  # Background color can be specified at the end.
 
-

Sound

<Sound> = pg.mixer.Sound(<path/file/bytes>)     # Loads the WAV file or array of signed shorts.
-<Sound>.play()                                  # Starts playing the sound.
+

Sound

<Sound> = pg.mixer.Sound(<path/file/bytes>)     # Loads WAV file or array of signed shorts.
+<Sound>.play/stop()                             # Also <Sound>.set_volume(<float>).
 

Basic Mario Brothers Example

import collections, dataclasses, enum, io, itertools as it, pygame as pg, urllib.request