Changeset 401:f7ee43c0e5c9


Ignore:
Timestamp:
Sep 7, 2013, 6:59:55 AM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Message:

Animated acid

Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/game_object.py

    r393 r401  
    530530    zorder = ZORDER_FLOOR
    531531    damage = None
    532     tile = None
     532    tiles = []
    533533    tile_alpha = 255
     534    tile_frame_ticks = 3
    534535    # How often to hit the player
    535536    rate = 5
     
    544545        self.shape.collision_type = COLLISION_TYPE_SWITCH
    545546        self.shape.sensor = True
     547        if len(self.tiles) > 1:
     548            tile_images = [resources.get_image('tiles', x)
     549                           for x in self.tiles]
     550            renderer = render.TimedTiledRenderer(outline, tile_images,
     551                                                 self.tile_frame_ticks,
     552                                                 self.tile_alpha)
     553        else:
     554            tile_image = resources.get_image('tiles', self.tiles[0])
     555            renderer = render.TiledRenderer(outline, tile_image,
     556                                            self.tile_alpha)
    546557        super(HostileTerrain, self).__init__(
    547558            SingleShapePhysicser(space, self.shape),
    548             render.TiledRenderer(outline,
    549                                  resources.get_image('tiles', self.tile),
    550                                  self.tile_alpha))
     559            renderer)
    551560
    552561    def collide_with_protagonist(self, protagonist):
     
    572581class AcidFloor(HostileTerrain):
    573582    damage = 1
    574     tile = 'acid.png'
     583    tiles = ['acid.png', 'acid2.png']
    575584    tile_alpha = 200
    576585
    577586
    578587class ForceWolfFloor(HostileTerrain):
    579     tile = 'moonlight.png'
     588    tiles = ['moonlight.png']
    580589    rate = 0
    581590    tile_alpha = 150
Note: See TracChangeset for help on using the changeset viewer.