コード例 #1
0
ファイル: main.py プロジェクト: thiagosantos1/Maze_Game
GREEN = [0, 255, 0]
RED = [255, 0, 0]
WIDTH = 960
HEiGHT = 640

pygame.init()
pygame.mixer.pre_init()
pygame.mixer.set_num_channels(3)
pygame.font.init()  # initialize font class in pygame
pygame.mixer.init()

screen = pygame.display.set_mode((WIDTH, HEiGHT))  # 32 x 32  size of tiles
pygame.display.set_caption("Maze Game")

# set up all the tiles
Tile.pre_init(screen)
survivor = Survivor(32, 32 * 6)

clock = pygame.time.Clock()
FPS = 24  # if we increase this number, the speed of character will be lower
total_frames = 0
total_frames_welcome = 0
pygame.mouse.set_visible(True)
# load and play background welcome page sound again
pygame.mixer.music.load('../Sounds/htd.wav')
pygame.mixer.music.play(-1)  # -1 put to loop the music forever

# Loop until the user clicks the close button.
done = False
Zombie.spawn()
while True:
コード例 #2
0
ファイル: main.py プロジェクト: thiagosantos1/Python-Game
pygame.mixer.pre_init()
pygame.mixer.set_num_channels(3)
pygame.font.init() # initialize font class in pygame
pygame.mixer.init()
  
                                # 30 tiles horizontal per line
                                # 30 columns of blocks in total

                                # and 20 vertical per vertical line
                                # 20 lines of block in total

screen = pygame.display.set_mode((WIDTH, HEiGHT)) # 32 x 32  size of tiles
pygame.display.set_caption("Hunted")

# set up all the tiles
Tile.pre_init(screen)

clock = pygame.time.Clock()
FPS = 24 # if we increase this number, the speed of character will be lower
total_frames = 0
total_frames_welcome = 0

survivor = Survivor(32, 32*6)

princess = Princess()

# set the welcome/final page of the game
Welcome.set_welcome(screen)

# load the background music
#pygame.mixer.music.load('../Sound_Effects/background2.wav')