Ignore:
Timestamp:
09/01/13 16:51:06 (8 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
Phase:
public
Rebase:
62653433346538316565336562613636666161626332343664666432646562613666383133343938
Message:

Now with a werewolf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/screens/area.py

    r53 r56  
    11"""Display a game area."""
    22
     3import math
    34import pygame
    45import pymunk
     
    89from nagslang.level import Level
    910from nagslang.events import ScreenChange
     11from nagslang.resources import resources
     12from nagslang.mutators import FLIP_H
    1013
    1114
     
    4649
    4750    def render(self, surface):
    48         pymunk.pygame_util.draw(surface, self.shape)
     51        if self.werewolf:
     52            pos = pymunk.pygame_util.to_pygame(self.body.position, surface)
     53            transforms = ()
     54            if abs(self.body.angle) < math.pi / 2:
     55                transforms = (FLIP_H,)
     56
     57            wolf = resources.get_image('creatures', 'werewolf_1.png',
     58                                       transforms=transforms)
     59            surface.blit(wolf, pos)
     60        else:
     61            pymunk.pygame_util.draw(surface, self.shape)
    4962
    5063    def go_werewolf(self):
Note: See TracChangeset for help on using the changeset viewer.