Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- pygame.init()
- BLACK = ( 0, 0, 0)
- WHITE = (255, 255, 255)
- BLUE = ( 0, 0, 255)
- GREEN = ( 0, 255, 0)
- RED = (255, 0, 0)
- size = [600, 600]
- screen = pygame.display.set_mode(size)
- done = False
- clock = pygame.time.Clock()
- screen.fill(WHITE)
- while not done:
- # This limits the while loop to a max of 10 times per second.
- # Leave this out and we will use all CPU we can.
- clock.tick(10)
- for event in pygame.event.get(): # User did something
- if event.type == pygame.QUIT: # If user clicked close
- done = True # Flag that we are done so we exit this loop
- x = [10, 10]
- y = [10, 280]
- for i in range(10):
- if i % 3 == 0:
- depth = 4
- else:
- depth = 2
- pygame.draw.line(screen, BLACK, x, y, depth)
- x[0] = x[0] + 30
- y[0] = y[0] + 30
- x = [10, 10]
- y = [280, 10]
- for i in range(10):
- if i % 3 == 0:
- depth = 4
- else:
- depth = 2
- pygame.draw.line(screen, BLACK, x, y, depth)
- x[1] = x[1] + 30
- y[1] = y[1] + 30
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement