Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- from random import randint
- pygame.init()
- #Constants
- #Colors
- BLACK = (0, 0, 0)
- RED = (255, 0, 0)
- BLUE = (0, 0, 255)
- WHITE = (255, 255, 255)
- #Pygame
- SCREEN = 0
- CLOCK = 0
- FPS = 30
- FONT = pygame.font.SysFont('cambriacambriamath', 20, False, False)
- #Gameplay
- totLengthX = 21
- totLengthY = 12
- totGifts = 4
- MAXSCORE = 125
- EMPTY = "00"
- WALL = "01"
- UNSPEC = "02"
- OPENINGS = ["NW", "NS", "NE", "WS", "WE", "SE", "SOLID"]
- OPENINGSFALLEN = ["NWa", "NSa", "NEa", "WSa", "WEa", "SEa", "SOLIDa"]
- OPENINGSIMGS = [pygame.image.load("imgs//"+str(i)+".png") for i in OPENINGS]
- OPENINGSFALLENIMGS = [pygame.image.load("imgs//"+str(i)+".png") for i in OPENINGSFALLEN]
- BGIMG = pygame.image.load("imgs//background.png")
- BGIMG = pygame.transform.scale(BGIMG,(1600,900))
- PLAYERIMG = pygame.image.load("imgs//Santa.png")
- GIFTIMG = pygame.image.load("imgs//Gift.png")
- AMOUNTGIFTS = 10
- BLOCKS = \
- [
- [["NW", "SOLID"],
- ["SOLID", "SOLID"]],
- [["NS", "SOLID"],
- ["NW", "SOLID"]],
- [["NS", "SOLID"],
- ["NS", "SOLID"]],
- [["NS", "SOLID"],
- ["NE", "WS"]],
- [["NS", "SOLID"],
- ["NE", "WS"]],
- [["NS", "SOLID", "SOLID", "SOLID"]],
- [["SOLID", "NS", "SOLID", "SOLID"]],
- [["NW", "SOLID", "SOLID", "SOLID"]],
- [["SOLID", "SOLID", "SOLID", "NE"]],
- [["SOLID", "NE", "WS", "SOLID"]],
- [["SOLID", "NE", "NW", "SOLID"]],
- [["NE", "WS", "SOLID", "SOLID"]],
- [["NE", "NW", "SOLID", "SOLID"]],
- [["WE", "WE", "WS", "SOLID"]],
- [["WE", "WE", "NW", "SOLID"]],
- [["WE", "WE", "WE", "WS"]],
- [["WE", "WE", "WE", "NW"]],
- [["WE", "WE", "WE", "WE"]],
- [[EMPTY, "NW", EMPTY],
- ["SOLID", "SOLID", "SOLID"]],
- [[EMPTY, "WE", EMPTY],
- ["SOLID", "SOLID", "SOLID"]],
- [[EMPTY, "NE", EMPTY],
- ["SOLID", "SOLID", "SOLID"]],
- [[EMPTY, "NS", EMPTY],
- ["SOLID", "NS", "SOLID"]],
- [[EMPTY, "NS", EMPTY],
- ["SOLID", "NS", "SOLID"]],
- [[EMPTY, "NS", EMPTY],
- ["NE", "NW", "SOLID"]],
- [[EMPTY, "NS", EMPTY],
- ["WE", "NW", "SOLID"]],
- [[EMPTY, "NS", EMPTY],
- ["SE", "NW", "SOLID"]],
- [[EMPTY, "NS", EMPTY],
- ["SOLID", "NE", "NW"]],
- [[EMPTY, "NS", EMPTY],
- ["SOLID", "NE", "WE"]],
- [[EMPTY, "NS", EMPTY],
- ["SOLID", "NE", "WS"]],
- [[EMPTY, "SOLID", EMPTY],
- ["NS", "SOLID", "SOLID"]],
- [[EMPTY, "SOLID", EMPTY],
- ["WS", "SOLID", "SOLID"]],
- [[EMPTY, "SOLID", EMPTY],
- ["NW", "SOLID", "SOLID"]],
- [[EMPTY, "SOLID", EMPTY],
- ["NE", "WS", "SOLID"]],
- [[EMPTY, "SOLID", EMPTY],
- ["SE", "WE", "NW"]],
- [[EMPTY, "SOLID", EMPTY],
- ["SE", "WE", "WE"]],
- [[EMPTY, "SOLID", EMPTY],
- ["SE", "WE", "WS"]],
- [[EMPTY, "SOLID", "NS"],
- ["SOLID", "SOLID", EMPTY]],
- [[EMPTY, "SOLID", "SE"],
- ["SOLID", "SOLID", EMPTY]],
- [[EMPTY, "NE", "WE"],
- ["SOLID", "SOLID", EMPTY]],
- [[EMPTY, "WE", "WE"],
- ["SOLID", "SOLID", EMPTY]],
- [[EMPTY, "SE", "WE"],
- ["SOLID", "NS", EMPTY]],
- [[EMPTY, "SE", "WE"],
- ["SE", "NW", EMPTY]],
- [["NS", "SOLID", EMPTY],
- [EMPTY, "SOLID", "SOLID"]],
- [["NW", "SOLID", EMPTY],
- [EMPTY, "SOLID", "SOLID"]],
- [["WS", "SOLID", EMPTY],
- [EMPTY, "SOLID", "SOLID"]],
- [["NE", "WE", EMPTY],
- [EMPTY, "SOLID", "SOLID"]],
- [["NE", "NW", EMPTY],
- [EMPTY, "SOLID", "SOLID"]],
- [["NE", "WS", EMPTY],
- [EMPTY, "NW", "SOLID"]],
- [["SOLID", "SOLID", "NS"],
- ["SOLID", EMPTY, EMPTY]],
- [["SOLID", "SOLID", "SE"],
- ["SOLID", EMPTY, EMPTY]],
- [["SOLID", "SE", "WS"],
- ["SOLID", EMPTY, EMPTY]],
- [["WE", "WE", "WS"],
- ["SOLID", EMPTY, EMPTY]],
- [["NE", "WE", "WS"],
- ["SOLID", EMPTY, EMPTY]],
- [["SE", "WE", "WS"],
- ["NS", EMPTY, EMPTY]],
- [["SOLID", "NS", "SOLID"],
- ["SOLID", EMPTY, EMPTY]],
- [["NS", "SOLID", "SOLID"],
- [EMPTY, EMPTY, "SOLID"]],
- ]
- #variables
- running = True
- count = 0
- countmodifier = 1
- cooldownCount = 0
- A = [["00" for j in range(12)] for i in range(21)]
- curBlock = [[]]
- curX1Block = 0
- curY1Block = 0
- curX2Block = 0
- curY2Block = 0
- lengthXBlock = 0
- lengthYBlock = 0
- curXPlayer = 5
- curYPlayer = 20
- Score = 0
- #classes
- class Gift:
- def __init__(self):
- self.x = randint(3,totLengthX-2)
- self.y = randint(1,totLengthY-3)
- y = self.y
- def giftGet(self):
- global Score
- Score = Score + int(1.25**(totLengthX-self.x))
- print(Score)
- AllGifts = []
- #global UNSPEC, BLOCKS, OPENINGS, OPENINGSFALLEN, EMPTY, WHITE, BGIMG, RED, OPENINGSIMGS, OPENINGSFALLENIMGS, PLAYERIMG, getpos, GIFTIMG, BLACK, checkMovePlayer, checkMove, moveBlock, RotateBlock, CheckRotate, MovePlayer, IFEL, deleteLines, dropAll, setup
- #standard functions
- def getpos(req, a):
- count = 0
- for i in a:
- count = count + 1
- if i == req:
- return count
- #A[y][x]. It's like economics :-(.
- def setup():
- global UNSPEC, BLOCKS, OPENINGS, OPENINGSFALLEN, EMPTY, WHITE, BGIMG, RED, OPENINGSIMGS, OPENINGSFALLENIMGS, PLAYERIMG, getpos, GIFTIMG, BLACK, checkMovePlayer, checkMove, moveBlock, RotateBlock, CheckRotate, MovePlayer, IFEL, deleteLines, dropAll, setup
- global WALL, AMOUNTGIFTS, SCREEN, CLOCK, gift, Gift, randint, totLengthY, totLengthX, spawnBlock, BLOCKS
- pygame.mixer.music.load("background.mp3")
- pygame.mixer.music.play(-1)
- global SCREEN, CLOCK
- SCREEN = pygame.display.set_mode((1600,900))
- CLOCK = pygame.time.Clock()
- global A
- for i in range(len(A)):
- for j in range(len(A[i])):
- if j == 0 or j == (len(A[i])-1):
- A[i][j] = WALL
- if i == len(A)-1:
- A[i][j] = WALL
- print(A[i])
- global AllGifts
- for i in range(AMOUNTGIFTS):
- AllGifts.append(Gift())
- for i in range(AMOUNTGIFTS):
- AllGifts.pop(0)
- for i in range(AMOUNTGIFTS):
- AllGifts.append(Gift())
- spawnBlock(randint(0,len(BLOCKS)-1))
- def spawnBlock(a):
- global UNSPEC, BLOCKS, OPENINGS, OPENINGSFALLEN, EMPTY, WHITE, BGIMG, RED, OPENINGSIMGS, OPENINGSFALLENIMGS, PLAYERIMG, getpos, GIFTIMG, BLACK, checkMovePlayer, checkMove, moveBlock, RotateBlock, CheckRotate, MovePlayer, IFEL, deleteLines, dropAll, setup
- global MAXSCORE, Ded
- global A
- global curBlock, lengthXBlock, lengthYBlock
- global curX1Block, curX2Block, curY1Block, curY2Block
- global UNSPEC, OPENINGS, OPENINGSFALLEN, EMPTY, WHITE
- print(BLOCKS[a])
- lengthXBlock = len(BLOCKS[a][0])
- lengthYBlock = len(BLOCKS[a])
- print("SPAWN")
- print(lengthXBlock)
- print(lengthYBlock)
- curBlock = BLOCKS[a]
- CHOICES = []
- x = 0
- y = 0
- print("SPAWN 2")
- ra = randint(1, 4)
- k = 0
- for i in curBlock:
- x = 0
- y = y + 1
- for j in i:
- x = x + 1
- if j == UNSPEC:
- k = k + 1
- curBlock[y - 1][x - 1] = "SOLID"
- curBlock[y-1][x-1] = OPENINGS[randint(0,len(OPENINGS)-2)]
- print("ra = " + str(ra))
- print(curBlock)
- curX1Block = 5
- curY1Block = 0
- curX2Block = 5+lengthXBlock
- curY2Block = lengthYBlock
- for i in range(len(curBlock)):
- for j in range(len(curBlock[i])):
- if A[i][j+5] == EMPTY:
- A[i][j+5] = curBlock[i][j]
- if A[i][j+5] in OPENINGSFALLEN:
- Ded()
- #Just display in here. Do not modify the computations in this function
- def updateDisplay():
- global UNSPEC, BLOCKS, OPENINGS, OPENINGSFALLEN, EMPTY, WHITE, BGIMG, RED, OPENINGSIMGS, OPENINGSFALLENIMGS, PLAYERIMG, getpos, GIFTIMG, BLACK, checkMovePlayer, checkMove, moveBlock, RotateBlock, CheckRotate, MovePlayer, IFEL, deleteLines, dropAll, setup
- global A
- global FONT
- SCREEN.fill(WHITE)
- SCREEN.blit(BGIMG,(0,0))
- cubz = 33
- for i in range(totLengthX):
- for j in range(totLengthY):
- if A[i][j] == WALL:
- pygame.draw.rect(SCREEN, RED, pygame.Rect(j*(cubz+2)+cubz+200, i*(cubz+2)+cubz+130, cubz, cubz))
- elif(A[i][j] in OPENINGS):
- p = getpos(A[i][j], OPENINGS)-1
- SCREEN.blit(OPENINGSIMGS[p],(j*(cubz+2)+cubz+200, i*(cubz+2)+cubz+130))
- elif(A[i][j] in OPENINGSFALLEN):
- p = getpos(A[i][j], OPENINGSFALLEN)-1
- SCREEN.blit(OPENINGSFALLENIMGS[p],(j*(cubz+2)+cubz+200, i*(cubz+2)+cubz+130))
- SCREEN.blit(PLAYERIMG, ((curXPlayer*(cubz+2)+cubz+200, (curYPlayer-1)*(cubz+2)+cubz+130)))
- for i in range(AMOUNTGIFTS):
- SCREEN.blit(GIFTIMG, ((AllGifts[i].y * (cubz + 2) + cubz + 200, (AllGifts[i].x - 1) * (cubz + 2) + cubz + 130)))
- scoreDisp = FONT.render(str("Score: ") + str(Score) + "/" + str(MAXSCORE), True, (BLACK), SCREEN)
- SCREEN.blit(scoreDisp, (1400, 600))
- pygame.display.flip()
- #Just computations in here. Do not modify the display in this function.
- def updateComputations():
- global A
- global lengthXBlock, lengthYBlock
- global countmodifier
- global curXPlayer, curYPlayer
- global Score
- lengthXBlock = len(curBlock[0])
- lengthYBlock = len(curBlock)
- if Score >= MAXSCORE:
- YouWin()
- global count, cooldownCount
- keys = pygame.key.get_pressed()
- #left
- if keys[pygame.K_a] and cooldownCount == 5:
- cooldownCount = 0
- if (checkMove(1)):
- moveBlock(1)
- #right
- elif keys[pygame.K_d] and cooldownCount == 5:
- cooldownCount = 0
- if (checkMove(2)):
- moveBlock(2)
- #rotate
- elif keys[pygame.K_w] and cooldownCount == 5:
- cooldownCount = 0
- print(CheckRotate())
- if (CheckRotate()):
- RotateBlock()
- lengthXBlock = len(curBlock[0])
- lengthYBlock = len(curBlock)
- elif keys[pygame.K_UP] and cooldownCount == 5:
- cooldownCount = 0
- if checkMovePlayer(0):
- MovePlayer(0)
- elif keys[pygame.K_LEFT] and cooldownCount == 5:
- cooldownCount = 0
- if checkMovePlayer(1):
- MovePlayer(1)
- elif keys[pygame.K_DOWN] and cooldownCount == 5:
- cooldownCount = 0
- if checkMovePlayer(2):
- MovePlayer(2)
- elif keys[pygame.K_RIGHT] and cooldownCount == 5:
- cooldownCount = 0
- if checkMovePlayer(3):
- MovePlayer(3)
- #Main menu
- elif keys[pygame.K_ESCAPE]:
- pygame.mixer.music.pause()
- exec(open('Test.py').read())
- pygame.QUIT
- #reset
- elif keys[pygame.K_r]:
- A = [["00" for j in range(12)] for i in range(21)]
- Score = 0
- curXPlayer = 5
- curYPlayer = 20
- setup()
- #Mute
- elif keys[pygame.K_m]:
- if pygame.mixer.music.get_volume() == 0:
- pygame.mixer.music.set_volume(0.5)
- else:
- pygame.mixer.music.set_volume(0)
- elif keys[pygame.K_h]:
- HelpPlay()
- #fastdrop
- elif keys[pygame.K_s]:
- countmodifier = 5
- elif not keys[pygame.K_s]:
- countmodifier = 1
- if cooldownCount < 5:
- cooldownCount = cooldownCount + 1
- if count < FPS/(2*countmodifier):
- count = count + 1
- if count >= FPS/(2*countmodifier):
- count = 0
- if (checkMove(0)):
- moveBlock(0)
- else:
- IFEL()
- spawnBlock(randint(0,len(BLOCKS)-1))
- for i in range(AMOUNTGIFTS):
- if AllGifts[i].y == curXPlayer and AllGifts[i].x == curYPlayer:
- AllGifts[i].giftGet()
- AllGifts.pop(i)
- AllGifts.append(Gift())
- checkMovePlayer(-1)
- # 0 = down
- # 1 = left
- # 2 = right
- def checkMove(direction):
- move = False
- for i in range(lengthYBlock):
- for j in range(lengthXBlock):
- if(curBlock[i][j] in OPENINGS):
- #Down
- if (direction == 0):
- if ((A[i+curY1Block+1][j+curX1Block] == WALL or A[i+curY1Block+1][j+curX1Block] in OPENINGSFALLEN)):
- return False
- else:
- move = True
- #Left
- elif (direction == 1):
- if ((A[i+curY1Block][j+curX1Block-1] == WALL or A[i+curY1Block][j+curX1Block-1] in OPENINGSFALLEN)):
- return False
- else:
- move = True
- #Right
- elif (direction == 2):
- if ((A[i+curY1Block][j+curX1Block+1] == WALL or A[i+curY1Block][j+curX1Block+1] in OPENINGSFALLEN)):
- return False
- else:
- move = True
- return move
- # 0 = down
- # 1 = left
- # 2 = right
- def moveBlock(direction):
- global A
- global curX1Block, curY1Block, curX2Block, curY2Block
- for i in range(curX2Block-curX1Block):
- for j in range(curY2Block-curY1Block):
- if A[curY1Block + j][curX1Block + i] in OPENINGS:
- A[curY1Block + j][curX1Block + i] = EMPTY
- #Down
- if (direction == 0):
- for i in range(curX2Block-curX1Block):
- for j in range(curY2Block-curY1Block):
- if not curBlock[j][i] == EMPTY:
- A[curY1Block+j+1][curX1Block+i] = curBlock[j][i]
- curY1Block = curY1Block+1
- curY2Block = curY2Block+1
- #Left
- if (direction == 1):
- for i in range(curX2Block-curX1Block):
- for j in range(curY2Block-curY1Block):
- if not curBlock[j][i] == EMPTY:
- A[curY1Block+j][curX1Block+i-1] = curBlock[j][i]
- curX1Block = curX1Block-1
- curX2Block = curX2Block-1
- #Right
- if (direction == 2):
- for i in range(curX2Block-curX1Block):
- for j in range(curY2Block-curY1Block):
- if not curBlock[j][i] == EMPTY:
- A[curY1Block+j][curX1Block+i+1] = curBlock[j][i]
- curX1Block = curX1Block+1
- curX2Block = curX2Block+1
- def CheckRotate():
- x = False
- if curY2Block > totLengthX-lengthXBlock+1:
- return False
- else:
- x = True
- if curX2Block > totLengthY-lengthYBlock+1:
- return False
- else:
- x = True
- return x
- def RotateBlock():
- global curBlock
- global lengthXBlock, lengthYBlock
- global curX1Block, curY1Block, curX2Block, curY2Block
- tempBlock = [["00" for j in range(lengthYBlock)] for i in range(lengthXBlock)]
- print(tempBlock)
- print(curBlock)
- x = 0
- y = 0
- for i in range(curX2Block-curX1Block):
- for j in range(curY2Block-curY1Block):
- if curBlock[j][i] in OPENINGS and not curBlock[j][i] == "SOLID":
- if curBlock[j][i] == "WE":
- curBlock[j][i] = "NS"
- elif curBlock[j][i] == "NS":
- curBlock[j][i] = "WE"
- elif curBlock[j][i] == "NE":
- curBlock[j][i] = "SE"
- elif curBlock[j][i] == "SE":
- curBlock[j][i] = "WS"
- elif curBlock[j][i] == "WS":
- curBlock[j][i] = "NW"
- elif curBlock[j][i] == "NW":
- curBlock[j][i] = "NE"
- for i in curBlock:
- y = 0
- for j in i:
- tempBlock[y][x] = curBlock[len(curBlock)-x-1][y]
- y = y + 1
- x = x + 1
- for i in range(totLengthX):
- for j in range(totLengthY):
- if A[i][j] in OPENINGS:
- A[i][j] = EMPTY
- print(tempBlock)
- curBlock = tempBlock
- lengthXBlock = len(curBlock[0])
- lengthYBlock = len(curBlock)
- tempvar = curX2Block
- curX2Block = curX1Block+lengthXBlock
- curY2Block = curY1Block+lengthYBlock
- for i in range(curX2Block-curX1Block):
- for j in range(curY2Block-curY1Block):
- A[curY1Block+j][curX1Block+i] = curBlock[j][i]
- #0 = Up
- #1 = Left
- #2 = Down
- #3 = Right
- def checkMovePlayer(direction):
- global curYPlayer, curXPlayer
- PlayerBlock = (A[curYPlayer-1][curXPlayer])
- P1 = False
- if PlayerBlock == EMPTY:
- if A[curYPlayer][curXPlayer] == EMPTY:
- MovePlayer(2)
- return False
- if direction == 1 and A[curYPlayer-1][curXPlayer-1] in OPENINGSFALLEN and A[curYPlayer-2][curXPlayer-1] == EMPTY:
- curXPlayer = curXPlayer - 1
- curYPlayer = curYPlayer - 1
- return False
- if direction == 3 and A[curYPlayer-1][curXPlayer+1] in OPENINGSFALLEN and A[curYPlayer-2][curXPlayer+1] == EMPTY:
- curXPlayer = curXPlayer + 1
- curYPlayer = curYPlayer - 1
- return False
- P1 = True
- elif direction == 0 and (PlayerBlock == "NEa" or PlayerBlock == "NSa" or PlayerBlock == "NWa"):
- P1 = True
- print("True")
- elif direction == 1 and (PlayerBlock == "NWa" or PlayerBlock == "WEa" or PlayerBlock == "WSa"):
- P1 = True
- print("True")
- elif direction == 2 and (PlayerBlock == "NSa" or PlayerBlock == "SEa" or PlayerBlock == "WSa"):
- P1 = True
- print("True")
- elif direction == 3 and (PlayerBlock == "NEa" or PlayerBlock == "WEa" or PlayerBlock == "SEa"):
- P1 = True
- print("True")
- if (P1):
- DestBlock = "0"
- if direction == 0:
- DestBlock = A[curYPlayer-2][curXPlayer]
- if PlayerBlock == EMPTY and DestBlock == EMPTY:
- return False
- if DestBlock == "NSa" or DestBlock == "SEa" or DestBlock == "WSa":
- return True
- if direction == 1:
- DestBlock = A[curYPlayer-1][curXPlayer-1]
- if DestBlock == "NEa" or DestBlock == "WEa" or DestBlock == "SEa":
- return True
- if direction == 2:
- DestBlock = A[curYPlayer][curXPlayer]
- if DestBlock == "NEa" or DestBlock == "NSa" or DestBlock == "NWa":
- return True
- if direction == 3:
- DestBlock = A[curYPlayer-1][curXPlayer+1]
- if DestBlock == "NWa" or DestBlock == "WEa" or DestBlock == "WSa":
- return True
- if DestBlock == EMPTY:
- return True
- return False
- #0 = Up
- #1 = Left
- #2 = Down
- #3 = Right
- def MovePlayer(direction):
- global curYPlayer, curXPlayer
- if direction == 0:
- curYPlayer = curYPlayer - 1
- if direction == 1:
- curXPlayer = curXPlayer - 1
- if direction == 2:
- curYPlayer = curYPlayer + 1
- if direction == 3:
- curXPlayer = curXPlayer + 1
- #IFEL over LIFE. Welcome to the cringe cave.
- def IFEL():
- print("IFAL")
- for i in range(curX2Block-curX1Block):
- for j in range(curY2Block-curY1Block):
- CurPos = getpos(curBlock[j][i], OPENINGS)
- if (curBlock[j][i] in OPENINGS):
- A[curY1Block + j][curX1Block + i] = OPENINGSFALLEN[CurPos-1]
- deleteLines()
- print("IFEL")
- def deleteLines():
- global curYPlayer, curXPlayer
- AmountEmpty = [0 for j in range(totLengthX-1)]
- for i in range(totLengthX-1):
- AmountEmpty[i] = 0
- for j in range(totLengthY):
- if A[i][j] == EMPTY:
- AmountEmpty[i] = AmountEmpty[i] + 1
- print(AmountEmpty)
- k = 0
- h = 0
- global Score
- for i in AmountEmpty:
- if i == 0:
- for j in range(totLengthY):
- if not A[k][j] == WALL:
- A[k][j] = EMPTY
- dropAll(k-1)
- h = h + 1
- k = k + 1
- Score = Score + h
- def dropAll(line):
- for i in range(line):
- for j in range(1, totLengthY-1):
- if not (A[line-i+1][j] == WALL):
- A[line - i+1][j] = A[line-i][j]
- A[line - i][j] = EMPTY
- #F
- def Ded():
- pygame.mixer.music.pause()
- WinImg = pygame.image.load("Tetded.png")
- global SCREEN
- keys = pygame.key.get_pressed()
- SCREEN.blit(WinImg,(0,0))
- pygame.display.flip()
- if (keys[pygame.K_ESCAPE]):
- exec(open('Test.py').read())
- CLOCK.tick(FPS)
- def YouWin():
- pygame.mixer.music.pause()
- WinImg = pygame.image.load("Tetwin.png")
- global SCREEN
- keys = pygame.key.get_pressed()
- SCREEN.blit(WinImg,(0,0))
- pygame.display.flip()
- if (keys[pygame.K_ESCAPE]):
- exec(open('Test.py').read())
- CLOCK.tick(FPS)
- def HelpPlay():
- pygame.mixer.music.pause()
- exec(open('tethelp.py').read())
- #Main
- setup()
- while running:
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- running = False
- updateDisplay()
- updateComputations()
- CLOCK.tick(FPS)
- pygame.QUIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement