@AriTelford1/

WarpedWellmadeIntegers

Pygame

No description

fork
loading
Files
  • main.py
  • meow.png
  • mew.wav
  • nohup.out
  • normalcat.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
32
33
34
35
36
37
38
39
import pygame, sys, time, random
from pygame.locals import *
import time

pygame.init()
mainClock = pygame.time.Clock()
font = pygame.font.SysFont(None, 48)

width = 400
height = 400
windowSurface = pygame.display.set_mode((width, height), 0, 32)

BLACK = (0, 0, 0)
WHITE = (255, 255, 255)

cat = pygame.Rect(50, 100, 400, 400)
meow = pygame.Rect(50, 100, 400, 400)
catImg = pygame.image.load('normalcat.png')
meowImg = pygame.image.load('meow.png')
stretchCat = pygame.transform.scale(catImg, (400, 400))
stretchMeow = pygame.transform.scale(meowImg, (400, 400))
windowSurface.blit(stretchCat, cat)

while True:
  pygame.display.update()
  for event in pygame.event.get():
    if event.type == KEYDOWN:
      if event.key == K_SPACE:
          text = font.render('Meow', True, WHITE, BLACK)
          textRect = text.get_rect()
          textRect.centerx = windowSurface.get_rect().centerx
          textRect.centery = windowSurface.get_rect().centery
          pygame.draw.rect(windowSurface, WHITE, (textRect.left - 20, textRect.top - 20, textRect.width + 40, textRect.height + 40))
          windowSurface.blit(text, textRect)
          windowSurface.blit(stretchMeow, meow)