Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. import pygame, sys, os, pygame.mixer
  2. from pygame.locals import *
  3. from helpers import load_image
  4. import time, math
  5. from menu import Menu
  6. from game import *
  7. pygame.init()
  8.  
  9. print "Loading... please wait"
  10. BLOCK_SIZE = 48
  11.  
  12. music = pygame.mixer.Sound('menu.ogg')
  13. music.play()
  14. #WALL = 1
  15.  
  16. #FLOOR = 0
  17. #angle = 0
  18. #playerx, playery = 60, 60
  19. #player_movex, player_movey = 0, 0
  20.  
  21.  
  22. #lots of damn variables that are too annoying to put in a damn class
  23. #vpRenderOffset = (80,60)
  24.  
  25.  
  26.  
  27.  
  28. #player_load = pygame.image.load("player.png").convert_alpha()
  29.  
  30. #milli = 0
  31. #clock=pygame.time.Clock()
  32.  
  33. #player_y = 0
  34. #player_x = 0
  35.  
  36.  
  37. class Sprite(pygame.sprite.Sprite):
  38.  
  39. def __init__(self, centerPoint, image):
  40. pygame.sprite.Sprite.__init__(self)
  41. """Set the image and the rect"""
  42. self.image = image
  43. self.rect = image.get_rect()
  44. """Move the rect into the correct position"""
  45. self.rect.center = centerPoint
  46.  
  47. #class level():
  48.  
  49. # def getSprites(self):
  50. # wall, rect = load_image('wall.png')
  51. # floor, rect = load_image('floor.png',-1)
  52. # return [floor, wall]
  53.  
  54. UPDATE = pygame.USEREVENT
  55. pygame.time.set_timer(UPDATE, int(1000.0/30))
  56.  
  57.  
  58. """while 1:
  59. menu = Menu()
  60. game = Game()
  61. if menu.gamestart == 0:
  62. menu.run_menu()
  63. else:
  64. game.game_loop()"""
  65.  
  66. if __name__ == "__main__":
  67. menu = Menu()
  68. game = Game()
  69. print "...done"
  70. if menu.gamestart == 0:
  71. menu.run_menu()
  72. elif menu.gamestart == 1:
  73. game.game_loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement