Skip to content

Instantly share code, notes, and snippets.

@NithishKolli
Created January 23, 2014 10:51
Show Gist options
  • Save NithishKolli/8576623 to your computer and use it in GitHub Desktop.
Save NithishKolli/8576623 to your computer and use it in GitHub Desktop.
import pygame
from pygame.locals import *
displayString = "Babu faggot"
def initialiseWindow():
#Intiliase values
(width,height)= 400,500
screen = pygame.display.set_mode((width,height))
pygame.display.set_caption('Hangman by Nitesh')
background_colour = (255,255,255)
screen.fill(background_colour)
#Add string to the screen
font=pygame.font.Font(None, 36)
text = font.render(displayString, 1, (10, 10, 10))
textpos = text.get_rect()
textpos.centerx = background.get_rect().centerx
background.blit(text, textpos)
# Blit everything to the screen
screen.blit(background, (0, 0))
pygame.display.flip()
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if __name__ == '__main__':
initialiseWindow()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment