Changeset 53:39d346467052


Ignore:
Timestamp:
Sep 1, 2013, 4:39:37 PM (7 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
Message:

Draw all the walls.

Location:
nagslang
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nagslang/level.py

    r50 r53  
    55
    66POLY_COLORS = {
    7         1: pygame.color.THECOLORS['red'],
    8         2: pygame.color.THECOLORS['green'],
    9         3: pygame.color.THECOLORS['yellow'],
    10         4: pygame.color.THECOLORS['blue'],
    11         5: pygame.color.THECOLORS['lightblue'],
    12         6: pygame.color.THECOLORS['magenta']
    13         }
     7    1: pygame.color.THECOLORS['red'],
     8    2: pygame.color.THECOLORS['green'],
     9    3: pygame.color.THECOLORS['yellow'],
     10    4: pygame.color.THECOLORS['blue'],
     11    5: pygame.color.THECOLORS['lightblue'],
     12    6: pygame.color.THECOLORS['magenta'],
     13}
    1414
    1515
     
    7777
    7878    def get_walls(self):
    79         return self.polygons[1]
     79        return self.polygons.values()
    8080
    8181    def _draw_walls(self):
  • nagslang/screens/area.py

    r52 r53  
    9494        body = pymunk.Body()
    9595        body.position = (0, -300)
    96         corners = self._level.get_walls()
    97         corner = corners[-1]
    98         for next_corner in corners:
    99             wall = pymunk.Segment(body, corner, next_corner, 5)
    100             wall.elasticity = 1.0
    101             self.walls.append(wall)
    102             corner = next_corner
     96        walls = self._level.get_walls()
     97        for wall in walls:
     98            corners = wall
     99            corner = corners[-1]
     100            for next_corner in corners:
     101                wall = pymunk.Segment(body, corner, next_corner, 5)
     102                wall.elasticity = 1.0
     103                self.walls.append(wall)
     104                corner = next_corner
    103105        self.space.add(*self.walls)
    104106
Note: See TracChangeset for help on using the changeset viewer.