Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pygame import *
- init()
- window = display.set_mode((800, 600))
- window.fill(Color('#ffffff'))
- draw.rect(window, Color('#cccccc'), [0, 0, 100, 100])
- run = 1
- while run:
- for e in event.get():
- if e.type == MOUSEBUTTONDOWN:
- window.fill(Color('#ffffff'))
- position = mouse.get_pos()
- draw.rect(window, Color('#cccccc'), [position[0] - 50, position[1] - 50, 100, 100])
- if e.type == QUIT:
- run = 0
- display.update()
- quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement