Introduction to Pygame and Interactive Programs

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/20

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering interactive programming concepts, Pygame setup, event loops, image handling, rectangles, and frame rate management.

21 Terms

1
New cards

Interactive Programs

Programs that open a window, interact through keyboard, mouse, or touch input, and continue running until explicitly told to stop.

2
New cards

Events

User actions or system signals, such as mouse clicks or key presses, that an interactive program waits for and reacts to.

3
New cards

Pygame

A popular Python library for 2D games used to create a window, respond to events, load images, draw graphics, play music, and provide specialized math functions.

4
New cards

pygame-ce

The specific community edition package of Pygame that is searched for and installed in PyCharm.

5
New cards

pygame.init()

The initialization function called at the start of a Pygame program to initialize all imported Pygame modules.

6
New cards

pygame.display.set_mode(size)

The Pygame function that initializes a window or screen for display using a specified width and height size tuple.

7
New cards

Alpha

A numeric value representing transparency in color systems, where 00 represents fully transparent and 255255 represents fully opaque.

8
New cards

convert_alpha()

A method chained when loading an image in Pygame to optimize its pixel format and preserve background transparency.

9
New cards

get_rect()

A Pygame method called on a surface or image to generate a starter rectangle object matching the dimensions of that image.

10
New cards

move_ip()

A Pygame rectangle method that modifies and moves the current rectangle in place, contrasting with move() which returns a newly created rectangle.

11
New cards

Blit (BLT)

An abbreviation for 'bit block transfer' from early 1975 graphics; the operation used to draw an image surface onto a designated rectangle or screen surface.

12
New cards

pygame.display.update()

The function that refreshes the screen to display all visual changes made since the previous frame using double-buffering.

13
New cards

Double-buffering

The rendering technique used by Pygame display updates where changes are drawn to an off-screen buffer before being displayed on the screen.

14
New cards

Flag variable

A boolean variable (such as is_playing = True) used to represent the state of the system and control the execution of a loop.

15
New cards

Game loop

The main while loop of a game that repeatedly checks for events, updates game states and character positions, and redraws elements onto the screen.

16
New cards

clock.tick(framerate)

A method that regulates loop execution speed so that it repeats no faster than a set number of frames per second, such as 6060 frames per second.

17
New cards

pygame.event.get()

A function that retrieves and removes all current event objects from the Pygame event queue as a list.

18
New cards

pygame.QUIT

The event type triggered when the user clicks the window's close button, used to signal the game loop to terminate.

19
New cards

pygame.MOUSEBUTTONDOWN

The event type triggered when a mouse button is clicked or pressed down.

20
New cards

pygame.mouse.get_pos()

A function that retrieves the current (x,y)(x, y) pixel coordinates of the mouse cursor within the window.

21
New cards

pygame.quit()

The function that uninitializes and shuts down all active Pygame modules when exiting a program.