def initGameOver(self): gameOverMenu = pygame.sprite.Sprite() gameOverMenu.image = GameObjects.load_images('gameover') gameOverMenu.rect = pygame.Rect((410, 238), (460, 245)) self.gameOverMenu = pygame.sprite.Group(gameOverMenu) retryButton = GameObjects.Button(648, 425, 'retry') MMButton = GameObjects.Button(790, 425, 'mainmenu') newSongButton = GameObjects.Button(484, 425, 'newsong') self.gameOverButtons = pygame.sprite.Group([retryButton, MMButton, newSongButton])
def initHelp(self): self.helpIndex = 0 helpSprite = pygame.sprite.Sprite() self.pageList = ['helpscreen', 'helpscreen1'] helpSprite.image = GameObjects.load_images(self.pageList[self.helpIndex]) helpSprite.rect = pygame.Rect(0, 0, WIDTH, HEIGHT) self.helpscreen = pygame.sprite.Group(helpSprite) next = GameObjects.Button(1160, 680, 'next') back = GameObjects.Button(120, 680, 'back') self.nextButton = pygame.sprite.Group(next) self.backButton = pygame.sprite.Group(back)
def initStart(self): # create starting conditions startSprite = pygame.sprite.Sprite() startSprite.image = GameObjects.load_images('startscreen') startSprite.rect = pygame.Rect(0, 0, WIDTH, HEIGHT) self.startScreen = pygame.sprite.Group(startSprite) self.startHero = pygame.sprite.Group(GameObjects.startHero()) self.spawnedNotes = pygame.sprite.Group() play = GameObjects.Button(640, 540, 'select') help = GameObjects.Button(640, 650, 'help') options = GameObjects.Button(1100, 665, 'options') self.startButtons = pygame.sprite.Group(play, help, options)
def init(self): self.mode = 'start' self.pianoOn = False self.gameOver = False self.hasDual = False self.filename = 'music/fur_elise.mid' self.timer = 0 self.noteQ = deque(maxlen=5) self.NoteFont = pygame.font.SysFont('alba', 80) self.GameFont = pygame.font.SysFont('alba', 35) self.GameOverFont = pygame.font.SysFont('alba', 38) self.FileFont = pygame.font.SysFont('agency fb', 45) self.timeFont = pygame.font.Font('assets/Aruvarb.ttf', 116) self.gameMode = 'treble' self.inputText = '' self.backarrow = pygame.sprite.Group(GameObjects.Button(60, 34, 'backarrow')) self.hasCPU = True self.isPaused = False # start screen self.initStart() self.initSelect()