Advertisement
Josif_tepe

Untitled

Oct 26th, 2024
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. import pygame as pg
  2.  
  3. pg.init()
  4. WIDTH = 600
  5. HEIGHT = 600
  6. LINE_COLOR = (186, 22, 12)
  7. BACKGROUND_COLOR = (18, 212, 199)
  8. screen = pg.display.set_mode((WIDTH, HEIGHT))
  9. pg.display.set_caption("Tic Tac Toe")
  10. screen.fill(BACKGROUND_COLOR)
  11.  
  12. def draw_lines_on_board(line_width):
  13.     pg.draw.line(screen, LINE_COLOR, (200, 0), (200, 600), line_width)
  14.     pg.draw.line(screen, LINE_COLOR, (400, 0), (400, 600), line_width)
  15.     pg.draw.line(screen, LINE_COLOR, (0, 200), (600, 200), line_width)
  16.     pg.draw.line(screen, LINE_COLOR, (0, 400), (600, 400), line_width)
  17.  
  18. draw_lines_on_board(15)
  19. while True:
  20.     for event in pg.event.get():
  21.         if event.type == pg.QUIT:
  22.             exit(0)
  23.  
  24.     pg.display.update()
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement