Exemplo n.º 1
0
 def __init__(self, WINDOW, CLOCK, FPS = 30, GROUPS = []):
   super().__init__(WINDOW, CLOCK, FPS=30, GROUPS=[])
   self.group_button = pg.sprite.Group()
   self.groups.append(self.group_button)
   self.tomainmenubutton = ui.Button(180,240,'./assets/goscreen.png',self.on_button_click)
   self.group_button.add(self.tomainmenubutton)
   self.to_next_stage = False
 def __init__(self, WINDOW, CLOCK, FPS = 30, GROUPS = []):
   super().__init__(WINDOW, CLOCK, FPS=30, GROUPS=[])
   self.group_button = pg.sprite.Group()
   self.groups.append(self.group_button)
   self.story = []
   self.story_index = 0
   self.story.append(ui.Button(540,360,'./assets/story0.png',self.next_story))
   self.group_button.add(self.story[0])
   self.to_next_stage = False
 def __init__(self, WINDOW, CLOCK, FPS=30, GROUPS=[], score=0):
     super().__init__(WINDOW, CLOCK, FPS=30, GROUPS=[])
     try:
         f = open('./assets/highscore.txt', mode='r')
         s = int(f.readline())
         if s < score:
             f.close()
             f = open('./assets/highscore.txt', mode='w')
             f.write(str(score))
     except:
         f = open('./assets/highscore.txt', mode='w')
         f.write(str(score))
     self.game_font = pg.font.Font('./assets/NotoSans-BoldItalic.ttf', 24)
     self.score = score
     self.group_button = pg.sprite.Group()
     self.groups.append(self.group_button)
     self.tomainmenubutton = ui.Button(540, 360, './assets/clearscreen.png',
                                       self.on_button_click)
     self.group_button.add(self.tomainmenubutton)
     self.to_next_stage = False
 def __init__(self, WINDOW, CLOCK, FPS=30, GROUPS=[]):
     super().__init__(WINDOW, CLOCK, FPS=30, GROUPS=[])
     try:
         f = open('./assets/highscore.txt', 'r')
         highscore = f.readline()
     except:
         highscore = "--"
     self.game_font = pg.font.Font('./assets/NotoSans-BoldItalic.ttf', 20)
     #self.score_text_surface = self.game_font.render("HIGHSCORE: "+str(highscore), True, pg.Color(255,255,255))
     #self.score_text_rect = self.score_text_surface.get_rect()
     #self.score_text_rect.center = (180,300)
     self.group_button = pg.sprite.Group()
     self.group_image = pg.sprite.Group()
     self.groups.append(self.group_image)
     self.groups.append(self.group_button)
     self.play_button = ui.Button(540, 600, './assets/button_start.png',
                                  self.on_button_click)
     self.title_image = ui.Image(540, 360, './assets/title.png')
     self.group_button.add(self.play_button)
     self.group_image.add(self.title_image)
     self.to_next_stage = False
 def __init__(self, WINDOW, CLOCK, FPS=30, GROUPS=[], score=0):
     super().__init__(WINDOW, CLOCK, FPS=30, GROUPS=[])
     try:
         f = open('./assets/highscore.txt', mode='r')
         s = int(f.readline())
         if s < score:
             f.close()
             f = open('./assets/highscore.txt', mode='w')
             f.write(str(score))
     except:
         f = open('./assets/highscore.txt', mode='w')
         f.write(str(score))
     self.game_font = pg.font.Font('./assets/NotoSans-BoldItalic.ttf', 24)
     self.score = score
     self.group_button = pg.sprite.Group()
     self.groups.append(self.group_button)
     self.tomainmenubutton = ui.Button(180, 240, './assets/clearscreen.png',
                                       self.on_button_click)
     self.score_text_surface = self.game_font.render(
         "SCORE: " + str(score), True, pg.Color(255, 255, 255))
     self.score_text_rect = self.score_text_surface.get_rect()
     self.score_text_rect.center = (180, 260)
     self.group_button.add(self.tomainmenubutton)
     self.to_next_stage = False