Added darkness!
This commit is contained in:
@@ -27,6 +27,7 @@ A generic level.
|
||||
import pygame
|
||||
|
||||
import player
|
||||
import fadeout
|
||||
|
||||
class Level(object):
|
||||
def __init__(self, game, graphics_dir, size=(0, 0), paused=False):
|
||||
@@ -44,6 +45,11 @@ class Level(object):
|
||||
self.player = player.Player(self, 0, 0)
|
||||
self.objects.append(self.player)
|
||||
|
||||
self.darkness = fadeout.Darkness(self.game, 0)
|
||||
|
||||
def set_darkness(self, darkness):
|
||||
self.darkness.set_darkness(darkness)
|
||||
|
||||
def draw_background(self):
|
||||
self.background = pygame.Surface(self.size)
|
||||
for tile in self.tiles:
|
||||
@@ -69,3 +75,5 @@ class Level(object):
|
||||
|
||||
for obj in sorted(self.objects, key=lambda obj: (obj.y + obj.z)):
|
||||
obj.draw(window)
|
||||
|
||||
self.darkness.draw(window)
|
||||
|
||||
Reference in New Issue
Block a user