repl.it
Pygame

No description

fork
loading
Files
  • main.py
  • nohup.out
  • whitey.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import pygame
# Initialize pygame
pygame.init()
# Set the pygame display area to
# 800 pixels wide, 600 pixels tall
gameDisplay = pygame.display.set_mode((800,500))
# Set the application title to 'Fuck'
pygame.display.set_caption('Fuck')
# Set the sequence for each color in a variable
black = (0, 0, 0)
white = (255, 255, 255)
# Used to track time within pygame, used primarily for fps
clock = pygame.time.Clock()
# Load the image whitey.png into pygame
pawnImg = pygame.image.load('whitey.png')

crashed = False


def pawn(x, y):
	gameDisplay.blit(pawnImg, (x, y))


def setupWhitePawns():
	pawn(160,y)
	pawn(x, y)
	pawn(220,y)
	pawn(340,y)
	pawn(400,y)
	pawn(460,y)
	pawn(520,y)
	pawn(580,y)
# X is the width times .45
x = (800 * 0.35)
# Y is the height times .8
y = (600 * 0.6)

while not crashed:
    # Get all the events in pygame
	for event in pygame.event.get():
        # If the event is pygame QUIT, the application has crashed
		if event.type == pygame.QUIT:
			crashed = True
	# Make the pygame display background white
	gameDisplay.fill(white)
	# Execute the pawn function which enables the pawn to be seen
	setupWhitePawns()
	# Update the pygame window to display new things
	pygame.display.update()
	# The fps that we are running, 60 in this case
	clock.tick(60)
pygame.quit()
print ("reached the end?")
Fetching token
?