Changeset 50:94d47bfcc7bb


Ignore:
Timestamp:
Sep 1, 2013, 4:28:33 PM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
rebase_source:
51e63093769aa1bfdf9877bb8fdd98bb658b3823
Message:

Approximate levels and walls

Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/screens/area.py

    r47 r50  
    66
    77from nagslang.screens.base import Screen
     8from nagslang.level import Level
    89from nagslang.events import ScreenChange
    910
     
    8485    def setup(self):
    8586        self.keys = ControlKeys()
     87        self._level = Level(self.name)
     88        self._level.load()
    8689        self.add_walls()
    8790        self.add_protagonist()
     
    9093        self.walls = []
    9194        body = pymunk.Body()
    92         body.position = (400, 300)
    93         corners = [(-200, -150), (-200, 150), (200, 150), (200, -150)]
     95        body.position = (0, -300)
     96        corners = self._level.get_walls()
    9497        corner = corners[-1]
    9598        for next_corner in corners:
     
    113116
    114117    def render(self, surface):
    115         surface.fill(pygame.color.Color(0, 0, 0))
    116         pymunk.pygame_util.draw(surface, *self.walls)
     118        #surface.fill(pygame.color.Color(0, 0, 0))
     119        background = self._level.get_background()
     120        surface.blit(background, (0, 0))
     121        #pymunk.pygame_util.draw(surface, *self.walls)
    117122        self.protagonist.render(surface)
    118123
Note: See TracChangeset for help on using the changeset viewer.