Exemple #1
0
    def refresh_screen(self):
        if self.ingame or self.take_screenshot:
            self.screen.fill((255, 255, 255))
            Light.nullify_shadow()
            Light.nullify_light()

            for light in self.lights:
                light.draw_shadow(self.camera)
                light.draw_light(self.camera)
            for swinging_light in self.swinging_lights:
                swinging_light.draw(self.screen, self.camera)
            Light.draw_everything(self.screen)

            for saw in self.level_saws:
                saw.draw(self.screen, self.camera)
            for block in self.level_blocks:
                block.draw(self.screen, self.camera)

            self.player.display_avatar(self.screen, self.camera)
            self.player.equipment.draw(self.screen, self.camera)
        if not self.ingame:
            if self.take_screenshot:
                self.background.blit(self.screen, (0, 0))
                self.take_screenshot = False

            self.screen.blit(self.background, (0, 0))
            Menu.MENUS[self.current_menu].draw(self.screen)
        pygame.display.update()
Exemple #2
0
    def refresh_screen(self):
        if self.ingame or self.take_screenshot:
            self.screen.fill((255, 255, 255))
            Light.nullify_shadow()
            Light.nullify_light()

            for light in self.lights:
                light.draw_shadow(self.camera)
                light.draw_light(self.camera)
            for swinging_light in self.swinging_lights:
                swinging_light.draw(self.screen, self.camera)
            Light.draw_everything(self.screen)

            for saw in self.level_saws:
                saw.draw(self.screen, self.camera)
            for block in self.level_blocks:
                block.draw(self.screen, self.camera)

            self.player.display_avatar(self.screen, self.camera)
            self.player.equipment.draw(self.screen, self.camera)
        if not self.ingame:
            if self.take_screenshot:
                self.background.blit(self.screen, (0, 0))
                self.take_screenshot = False

            self.screen.blit(self.background, (0, 0))
            Menu.MENUS[self.current_menu].draw(self.screen)
        pygame.display.update()
 def draw(self, screen):
     screen.fill((255, 255, 255))
     Light.nullify_shadow()
     Light.nullify_light()
     self.draw_light(screen)
     for piece in self.world:
         piece.draw(screen, self.camera)
     for swinging_light in self.swinging_lights:
         swinging_light.draw(screen, self.camera)
     Light.draw_everything(screen)
     self.menu.draw(screen, (0, 255, 0))
     for button in self.buttons:
         button.draw(screen)
     for text_box in self.textboxes:
         text_box.draw(screen)
     self.block_textbox.draw(screen)
     pygame.display.update()
 def draw(self, screen):
     screen.fill((255, 255, 255))
     Light.nullify_shadow()
     Light.nullify_light()
     self.draw_light(screen)
     for piece in self.world:
         piece.draw(screen, self.camera)
     for swinging_light in self.swinging_lights:
         swinging_light.draw(screen, self.camera)
     Light.draw_everything(screen)
     self.menu.draw(screen, (0, 255, 0))
     for button in self.buttons:
         button.draw(screen)
     for text_box in self.textboxes:
         text_box.draw(screen)
     self.block_textbox.draw(screen)
     pygame.display.update()