forked from ndyer/pygame-dvd
renamed dvd references to steam references
This commit is contained in:
parent
afe503bee4
commit
31f6593ae0
@ -1 +0,0 @@
|
||||
from . import dvd_screen
|
@ -1,4 +1,4 @@
|
||||
import dvd_bounce
|
||||
import steam_saver
|
||||
import sys
|
||||
import os
|
||||
|
||||
@ -11,4 +11,4 @@ if __name__ == '__main__':
|
||||
if arg == '--window':
|
||||
windowed_mode = True
|
||||
|
||||
dvd_bounce.main.main(windowed_mode)
|
||||
steam_saver.main.main(windowed_mode)
|
@ -1,11 +1,11 @@
|
||||
import pygame
|
||||
import dvd_bounce.surfaces as surfaces
|
||||
import steam_saver.surfaces as surfaces
|
||||
|
||||
# Global variables
|
||||
SCREEN_SIZE = (1920, 1080)
|
||||
FPS = 60
|
||||
VALID_SURFACES = [
|
||||
'dvd_screen'
|
||||
'steam_screen'
|
||||
]
|
||||
|
||||
|
||||
@ -21,8 +21,8 @@ def main(windowed_mode=False):
|
||||
else:
|
||||
window = pygame.display.set_mode(SCREEN_SIZE, pygame.FULLSCREEN)
|
||||
|
||||
# Starts the program with the surface 'dial' as the default
|
||||
surface = getattr(globals()['surfaces'], 'dvd_screen').Surface(SCREEN_SIZE)
|
||||
# Starts the program with the surface 'steam_screen' as the default
|
||||
surface = getattr(globals()['surfaces'], 'steam_screen').Surface(SCREEN_SIZE)
|
||||
running = True
|
||||
while running:
|
||||
clock.tick(FPS)
|
1
steam_saver/surfaces/__init__.py
Normal file
1
steam_saver/surfaces/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from . import steam_screen
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
@ -6,12 +6,12 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
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:
|
||||
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.
|
||||
y_speed (int): Current speed in the Y axis.
|
||||
max_x (int): Maximum X position on the screen.
|
||||
@ -20,7 +20,7 @@ class DVDLogo(pygame.sprite.Sprite):
|
||||
|
||||
def __init__(self, window_size: tuple):
|
||||
"""
|
||||
Initialize DVDLogo sprite with given window size.
|
||||
Initialize SteamLogo sprite with given window size.
|
||||
|
||||
Args:
|
||||
window_size (tuple): Size of the game window (width, height).
|
||||
@ -68,7 +68,7 @@ class DVDLogo(pygame.sprite.Sprite):
|
||||
|
||||
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
|
||||
the screen and to handle collision/color changes.
|
||||
@ -121,9 +121,9 @@ class Surface(pygame.Surface):
|
||||
|
||||
pygame.mouse.set_visible(False)
|
||||
|
||||
# Create a DVDLogo sprite instance and add it to the sprite group.
|
||||
dvd_logo = DVDLogo(window_size)
|
||||
self.all_sprites = pygame.sprite.Group(dvd_logo)
|
||||
# Create a SteamLogo sprite instance and add it to the sprite group.
|
||||
steam_logo = SteamLogo(window_size)
|
||||
self.all_sprites = pygame.sprite.Group(steam_logo)
|
||||
|
||||
def update(self):
|
||||
"""
|
Loading…
Reference in New Issue
Block a user