projects
/
tabakrolletjie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added rock texture to wall
[tabakrolletjie.git]
/
tabakrolletjie
/
scenes
/
night.py
diff --git
a/tabakrolletjie/scenes/night.py
b/tabakrolletjie/scenes/night.py
index 3f63f872dd408b8a16963b343821b60b3eca6c6c..fe1fae3860d1d87bcb2b8a77d2ff895afff904ed 100644
(file)
--- a/
tabakrolletjie/scenes/night.py
+++ b/
tabakrolletjie/scenes/night.py
@@
-1,6
+1,7
@@
""" In the night, the mould attacks. """
import pygame.locals as pgl
""" In the night, the mould attacks. """
import pygame.locals as pgl
+import pygame.surface
import pymunk
import pymunk
@@
-10,6
+11,7
@@
from ..obstacles import ObstacleManager
from ..enemies import Boyd
from ..events import SceneChangeEvent
from ..utils import debug_timer
from ..enemies import Boyd
from ..events import SceneChangeEvent
from ..utils import debug_timer
+from ..loader import loader
from ..turnip import Turnip
from ..turnip import Turnip
@@
-24,13
+26,23
@@
class NightScene(BaseScene):
turnip = Turnip(space=self._space, **turnip_data)
self._turnips.append(turnip)
turnip = Turnip(space=self._space, **turnip_data)
self._turnips.append(turnip)
-
@debug_timer("night.render")
def render(self, surface, gamestate):
@debug_timer("night.render")
def render(self, surface, gamestate):
- surface.fill((0, 0, 155))
+ surface.blit(loader.load_image("textures", "soil.png"), (0, 0))
+ darkness = pygame.surface.Surface(surface.get_size())
+ darkness = darkness.convert_alpha()
+ darkness.fill((0, 0, 0, 150))
+ surface.blit(darkness, (0, 0))
+
self._mould.render(surface)
self._mould.render(surface)
- for turnip in self._turnips:
- turnip.render(surface)
+
+ for turnip in self._turnips[:]:
+ if turnip.eaten:
+ self._turnips.remove(turnip)
+ turnip.remove()
+ gamestate.eaten += 1
+ else:
+ turnip.render(surface)
self._lights.render_light(surface)
self._obstacles.render(surface)
self._lights.render_fittings(surface)
self._lights.render_light(surface)
self._obstacles.render(surface)
self._lights.render_fittings(surface)