Changeset 190:97627a999042


Ignore:
Timestamp:
Sep 3, 2013, 7:44:55 PM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Message:

Don't render the old scene with the protagnist's new position during scene changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/screens/area.py

    r188 r190  
    6565
    6666    def setup(self):
     67        self._disable_render = False  # Avoid redrawing on scene changes
    6768        self.keys = ControlKeys()
    6869        self._level = Level(self.name)
     
    127128            if ev.destination != self.name:
    128129                # Go to anther screen
     130                self._disable_render = True
    129131                ScreenChange.post(ev.destination, self.protagonist)
     132                return
    130133            # else we're teleporting within the screen, and just the
    131134            # position change is enough
     
    158161
    159162    def render(self, surface):
    160         #surface.fill(pygame.color.Color(0, 0, 0))
     163        if self._disable_render:
     164            return
    161165        background = self._level.get_background()
    162166        mysurface = background.copy()
Note: See TracChangeset for help on using the changeset viewer.