repl.it
@MATHyou/

Image Test and File test

Pygame

No description

fork
loading
Files
  • main.py
  • nohup.out
  • Poo.png
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import pygame
from time import sleep
import random
pygame.init()
winheight = 500
winwidth = 500
win = pygame.display.set_mode((winwidth, winheight))
pygame.display.set_caption("IMAGE!!!!")
run = True
image = pygame.image.load('Poo.png')
def message(msg, color, cords, size):
    fontsize = int(size)
    font = pygame.font.SysFont(None, fontsize)
    screen_text = font.render(msg, True, color)
    win.blit(screen_text, cords)
while run:
    win.fill((255,255,255))
    sleep(0.005)
    for event in pygame.event.get(): 
        if event.type == pygame.QUIT:
            run = False
    keys = pygame.key.get_pressed()
    pos = pygame.mouse.get_pos() 
    poop = win.blit(image, (10,10))
    pressed1, pressed2, pressed3 = pygame.mouse.get_pressed()
    if poop.collidepoint(pos) and pressed1:
    	break
    pygame.display.update()
while True:
    print("THE POOP WILL HAUNT YOU FOREVER.")
pygame.quit()