repl.it
@glench/

DVD Logo screensaver remake

Pygame

A Python Play remake of this project: https://repl.it/talk/share/Improved-DVD-logo/11946

fork
loading
Files
  • main.py
  • DVD_blue.png
  • DVD_rainbow.png
  • DVD_white.png
  • DVD_yellow.png
  • nohup.out
  • Packager files
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import play # this should be the first line in your program
import random

all_logos = [
  'DVD_blue.png',
  'DVD_rainbow.png',
  'DVD_white.png',
  'DVD_yellow.png',
]

play.set_background_color('black')

logo = play.new_sprite(random.choice(all_logos))
logo.dx = 1
logo.dy = -1

@play.repeat_forever
async def do():
  if logo.right >= play.screen.right or logo.left <= play.screen.left:
    logo.dx *= -1
    logo.image = random.choice([filename for filename in all_logos if filename != logo.image])

  if logo.top >= play.screen.top or logo.bottom <= play.screen.bottom:
    logo.dy *= -1
    logo.image = random.choice([filename for filename in all_logos if filename != logo.image])
  
  logo.x += logo.dx
  logo.y += logo.dy

play.start_program() # this should be the last line in your program
?