1
0
forked from ndyer/pygame-dvd

renamed dvd references to steam references

This commit is contained in:
Nicholas Dyer 2025-01-06 16:41:10 -05:00
parent afe503bee4
commit 31f6593ae0
7 changed files with 15 additions and 15 deletions

View File

@ -1 +0,0 @@
from . import dvd_screen

View File

@ -1,4 +1,4 @@
import dvd_bounce import steam_saver
import sys import sys
import os import os
@ -11,4 +11,4 @@ if __name__ == '__main__':
if arg == '--window': if arg == '--window':
windowed_mode = True windowed_mode = True
dvd_bounce.main.main(windowed_mode) steam_saver.main.main(windowed_mode)

View File

@ -1,11 +1,11 @@
import pygame import pygame
import dvd_bounce.surfaces as surfaces import steam_saver.surfaces as surfaces
# Global variables # Global variables
SCREEN_SIZE = (1920, 1080) SCREEN_SIZE = (1920, 1080)
FPS = 60 FPS = 60
VALID_SURFACES = [ VALID_SURFACES = [
'dvd_screen' 'steam_screen'
] ]
@ -21,8 +21,8 @@ def main(windowed_mode=False):
else: else:
window = pygame.display.set_mode(SCREEN_SIZE, pygame.FULLSCREEN) window = pygame.display.set_mode(SCREEN_SIZE, pygame.FULLSCREEN)
# Starts the program with the surface 'dial' as the default # Starts the program with the surface 'steam_screen' as the default
surface = getattr(globals()['surfaces'], 'dvd_screen').Surface(SCREEN_SIZE) surface = getattr(globals()['surfaces'], 'steam_screen').Surface(SCREEN_SIZE)
running = True running = True
while running: while running:
clock.tick(FPS) clock.tick(FPS)

View File

@ -0,0 +1 @@
from . import steam_screen

View File

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -6,12 +6,12 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
LOGO_SCALING = 0.1 LOGO_SCALING = 0.1
class DVDLogo(pygame.sprite.Sprite): class SteamLogo(pygame.sprite.Sprite):
""" """
A Pygame sprite representing a DVD logo that moves around the screen. A Pygame sprite representing a Steam logo that moves around the screen.
Attributes: Attributes:
base_image (pygame.Surface): The original image of the DVD logo. base_image (pygame.Surface): The original image of the Steam logo.
x_speed (int): Current speed in the X axis. x_speed (int): Current speed in the X axis.
y_speed (int): Current speed in the Y axis. y_speed (int): Current speed in the Y axis.
max_x (int): Maximum X position on the screen. max_x (int): Maximum X position on the screen.
@ -20,7 +20,7 @@ class DVDLogo(pygame.sprite.Sprite):
def __init__(self, window_size: tuple): def __init__(self, window_size: tuple):
""" """
Initialize DVDLogo sprite with given window size. Initialize SteamLogo sprite with given window size.
Args: Args:
window_size (tuple): Size of the game window (width, height). window_size (tuple): Size of the game window (width, height).
@ -68,7 +68,7 @@ class DVDLogo(pygame.sprite.Sprite):
def update(self): def update(self):
""" """
Update DVDLogo sprite's position and speed based on its current state. Update SteamLogo sprite's position and speed based on its current state.
This method is called each frame during game execution to move the logo around This method is called each frame during game execution to move the logo around
the screen and to handle collision/color changes. the screen and to handle collision/color changes.
@ -121,9 +121,9 @@ class Surface(pygame.Surface):
pygame.mouse.set_visible(False) pygame.mouse.set_visible(False)
# Create a DVDLogo sprite instance and add it to the sprite group. # Create a SteamLogo sprite instance and add it to the sprite group.
dvd_logo = DVDLogo(window_size) steam_logo = SteamLogo(window_size)
self.all_sprites = pygame.sprite.Group(dvd_logo) self.all_sprites = pygame.sprite.Group(steam_logo)
def update(self): def update(self):
""" """