# https://www.cs.ucsb.edu/~pconrad/cs5nm/topics/pygame/drawing/
import pygame
+import sys
+import os
IMAGE_PATH = 'road.png'
SCREEN_WIDTH = 800
except:
joystick = None
+ if len(sys.argv) > 1:
+ if sys.argv[1] == '-':
+ outputfile = sys.stdout.fileno()
+ else:
+ outputfile = os.open(sys.argv[1], os.O_WRONLY)
+ else:
+ outputfile = None
+
clock = pygame.time.Clock()
fps = 30
screen.blit(background.convert(), (0, 0))
scrolling_map.draw(screen)
+ if outputfile:
+ buf = pygame.image.tostring(pygame.display.get_surface(), "RGB", False)
+ os.write(outputfile, buf)
+
pygame.display.update()
pygame.quit()