Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch1 #11

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions Python/load.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env python3
#jobega was here

import pygame
import random


pygame.init()


WIDTH, HEIGHT = 800, 600
FPS = 60
SPEED = 5

screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("DVD Player Simulator")


dvd_logo = pygame.image.load("dvd_logo.png").convert_alpha()
DVD_WIDTH, DVD_HEIGHT = dvd_logo.get_width(), dvd_logo.get_height()


original_logo = dvd_logo.copy()

x = random.randint(0, WIDTH - DVD_WIDTH)
y = random.randint(0, HEIGHT - DVD_HEIGHT)
dx, dy = SPEED, SPEED
direction = (dx, dy)

clock = pygame.time.Clock()

running = True
while running:
screen.fill((0, 0, 0))


for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False


x += direction[0]
y += direction[1]

if x <= 0 or x >= WIDTH - DVD_WIDTH:
direction = (-direction[0], direction[1])

new_color = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
temp_logo = original_logo.copy()
temp_logo.fill(new_color, special_flags=pygame.BLEND_RGB_MULT)
dvd_logo = temp_logo
if y <= 0 or y >= HEIGHT - DVD_HEIGHT:
direction = (direction[0], -direction[1])
new_color = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
temp_logo = original_logo.copy()
temp_logo.fill(new_color, special_flags=pygame.BLEND_RGB_MULT)
dvd_logo = temp_logo

screen.blit(dvd_logo, (x, y))

pygame.display.flip()
clock.tick(FPS)

pygame.quit()
26 changes: 26 additions & 0 deletions Python/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from setuptools import setup, find_packages

setup(
name='DVDPlayerSimulator',
version='1.0',
packages=find_packages(),
install_requires=[
'pygame',
],
entry_points={
'console_scripts': [
'dvd_simulator = load:__main__',
],
},
description='A DVD Player built using Pygame',
license='MIT',
keywords='dvd simulator pygame game',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Topic :: Games/Entertainment',
],
)