1/20
Vocabulary flashcards covering interactive programming concepts, Pygame setup, event loops, image handling, rectangles, and frame rate management.
Interactive Programs
Programs that open a window, interact through keyboard, mouse, or touch input, and continue running until explicitly told to stop.
Events
User actions or system signals, such as mouse clicks or key presses, that an interactive program waits for and reacts to.
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.
pygame-ce
The specific community edition package of Pygame that is searched for and installed in PyCharm.
pygame.init()
The initialization function called at the start of a Pygame program to initialize all imported Pygame modules.
pygame.display.set_mode(size)
The Pygame function that initializes a window or screen for display using a specified width and height size tuple.
Alpha
A numeric value representing transparency in color systems, where 0 represents fully transparent and 255 represents fully opaque.
convert_alpha()
A method chained when loading an image in Pygame to optimize its pixel format and preserve background transparency.
get_rect()
A Pygame method called on a surface or image to generate a starter rectangle object matching the dimensions of that image.
move_ip()
A Pygame rectangle method that modifies and moves the current rectangle in place, contrasting with move() which returns a newly created rectangle.
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.
pygame.display.update()
The function that refreshes the screen to display all visual changes made since the previous frame using double-buffering.
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.
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.
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.
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 60 frames per second.
pygame.event.get()
A function that retrieves and removes all current event objects from the Pygame event queue as a list.
pygame.QUIT
The event type triggered when the user clicks the window's close button, used to signal the game loop to terminate.
pygame.MOUSEBUTTONDOWN
The event type triggered when a mouse button is clicked or pressed down.
pygame.mouse.get_pos()
A function that retrieves the current (x,y) pixel coordinates of the mouse cursor within the window.
pygame.quit()
The function that uninitializes and shuts down all active Pygame modules when exiting a program.