Ignore:
Timestamp:
Sep 6, 2013, 6:25:06 PM (7 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
Message:

Acid attacks shoot things that look like acid

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/game_object.py

    r362 r363  
    431431
    432432class Bullet(GameObject):
    433     def __init__(self, space, position, impulse, damage,
     433    def __init__(self, space, position, impulse, damage, bullet_type,
    434434                 source_collision_type):
    435435        body = make_body(1, pymunk.inf, position)
     436        body.angle = impulse.angle
    436437        self.last_position = position
    437438        self.shape = pymunk.Circle(body, 2)
     
    439440        self.shape.collision_type = COLLISION_TYPE_PROJECTILE
    440441        self.damage = damage
     442        self.type = bullet_type
    441443        self.source_collision_type = source_collision_type
    442444        super(Bullet, self).__init__(
    443445            SingleShapePhysicser(space, self.shape),
    444             render.ImageRenderer(resources.get_image('objects', 'bullet.png')),
     446            render.ImageRenderer(resources.get_image(
     447                'objects', '%s.png' % self.type)),
    445448        )
    446449        self.physicser.apply_impulse(impulse)
Note: See TracChangeset for help on using the changeset viewer.