Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Engine: This will handle the title screen, loading saves, and play the actual game.
- import pygame, sys
- class Engine():
- def __init__(self):
- self.atTitle = True
- def playGame(self):
- while self.atTitle is True:
- self.titleScreen()
- def mainScreen(self):
- screenWidth = 640
- screenHeight = 480
- self.screen = pygame.display.set_mode((screenWidth,screenHeight))
- pygame.display.set_caption("Ixtli")
- def InitDisplay(self):
- self.display.CreateScreen()
- self.DisplayInitilized = 1
- def titleScreen(self):
- self.gameTitle()
- self.titleOptions("New Game", 300)
- self.titleOptions("Continue", 325)
- self.titleOptions("Honor", 350)
- self.titleOptions("Quit", 375)
- pygame.display.flip()
- def gameTitle(self):
- titleFont = pygame.font.Font("slkscr.ttf", 30)
- title = titleFont.render("Clocktower Lights", 1, (220,180,120))
- titleRect = title.get_rect()
- titleRect.centerx = self.screen.get_rect().centerx
- titleRect.centery = 25
- self.screen.blit(title, titleRect)
- def titleOptions(self, option, posY):
- font = pygame.font.Font("slkscr.ttf", 18)
- label = font.render(option, 1, (45,105,160))
- titleRect = label.get_rect()
- titleRect.centerx = self.screen.get_rect().centerx
- titleRect.centery = posY
- self.screen.blit(label, titleRect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement