<s> import pygame <EOL> from pygame . locals import * <EOL> from random import randint <EOL> class Star ( object ) : <EOL> def __init__ ( self , x , y , speed ) : <EOL> self . x = x <EOL> self . y = y <EOL> self . speed = speed <EOL> def run ( ) : <EOL> pygame . init ( ) <EOL> screen = pygame . display . set_mode ( ( <NUM_LIT> , <NUM_LIT> ) , FULLSCREEN ) <EOL> stars = [ ] <EOL> for n in range ( <NUM_LIT:200> ) : <EOL> x = float ( randint ( <NUM_LIT:0> , <NUM_LIT> ) ) <EOL> y = float ( randint ( <NUM_LIT:0> , <NUM_LIT> ) ) <EOL> speed = float ( randint ( <NUM_LIT:10> , <NUM_LIT> ) ) <EOL> stars . append ( Star ( x , y , speed ) ) <EOL> clock = pygame . time . Clock ( ) <EOL> white = ( <NUM_LIT:255> , <NUM_LIT:255> , <NUM_LIT:255> ) <EOL> while True : <EOL> for event in pygame . event . get ( ) : <EOL> if event . type == QUIT : <EOL> pygame . quit ( ) <EOL> quit ( ) <EOL> if event . type == KEYDOWN : <EOL> pygame . quit ( ) <EOL> quit ( ) <EOL> y = float ( randint ( <NUM_LIT:0> , <NUM_LIT> ) ) <EOL> speed = float ( randint ( <NUM_LIT:10> , <NUM_LIT> ) ) <EOL> star = Star ( <NUM_LIT> , y , speed ) <EOL> stars . append ( star ) <EOL> time_passed = clock . tick ( ) <EOL> time_passed_seconds = time_passed / <NUM_LIT> <EOL> screen . fill ( ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> for star in stars : <EOL> new_x = star . x - time_passed_seconds * star . speed <EOL> pygame . draw . aaline ( screen , white , ( new_x , star . y ) , ( star . x + <NUM_LIT:1.> , star . y ) ) <EOL> star . x = new_x <EOL> def on_screen ( star ) : <EOL> return star . x > <NUM_LIT:0> <EOL> stars = list ( filter ( on_screen , stars ) ) <EOL> pygame . display . update ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> run ( ) </s>
