Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- import time
- class GameConfig:
- windowW = 800
- windowH = 500
- white = (195,195,195)
- imgTour = pygame.image.load('tour.png')
- imgArme = pygame.image.load('arme.png')
- tourW = 296
- tourH = 171
- armeW = 360
- armeH = 360
- class GameState:
- def __init__(self):
- self.tourX = 0
- self.tourY = 500-171
- self.armeX =
- self.armeY =
- def draw(self,window):
- window.fill(GameConfig.white)
- window.blit(GameConfig.imgTour,(self.tourX,self.tourY))
- window.blit(GameConfig.imgArme,(self.armeX,self.armeY))
- def gameLoop(window):
- game_over = False
- gameState = GameState()
- while not game_over:
- for event in pygame.event.get() :
- if event.type == pygame.QUIT :
- game_over = True
- gameState.draw(window)
- pygame.display.update()
- def main():
- pygame.init()
- window = pygame.display.set_mode((GameConfig.windowW, GameConfig.windowH))
- pygame.display.set_caption("Tower")
- gameLoop(window)
- pygame.quit()
- quit()
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement