<s> import pygame <EOL> from pygame . locals import * <EOL> from sys import exit <EOL> from gameobjects . vector2 import Vector2 <EOL> picture_file = '<STR_LIT>' <EOL> pygame . init ( ) <EOL> screen = pygame . display . set_mode ( ( <NUM_LIT> , <NUM_LIT> ) , <NUM_LIT:0> , <NUM_LIT:32> ) <EOL> picture = pygame . image . load ( picture_file ) . convert ( ) <EOL> picture_pos = Vector2 ( <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> scroll_speed = <NUM_LIT> <EOL> clock = pygame . time . Clock ( ) <EOL> joystick = None <EOL> if pygame . joystick . get_count ( ) > <NUM_LIT:0> : <EOL> joystick = pygame . joystick . Joystick ( <NUM_LIT:0> ) <EOL> joystick . init ( ) <EOL> if joystick is None : <EOL> print ( "<STR_LIT>" ) <EOL> pygame . quit ( ) <EOL> exit ( ) <EOL> while True : <EOL> for event in pygame . event . get ( ) : <EOL> if event . type == QUIT : <EOL> pygame . quit ( ) <EOL> exit ( ) <EOL> scroll_direction = Vector2 ( * joystick . get_hat ( <NUM_LIT:0> ) ) <EOL> scroll_direction . normalize ( ) <EOL> screen . fill ( ( <NUM_LIT:255> , <NUM_LIT:255> , <NUM_LIT:255> ) ) <EOL> screen . blit ( picture , ( - picture_pos . x , picture_pos . y ) ) <EOL> time_passed = clock . tick ( ) <EOL> time_passed_seconds = time_passed / <NUM_LIT> <EOL> picture_pos += scroll_direction * scroll_speed * time_passed_seconds <EOL> pygame . display . update ( ) </s>
