Mercurial > skaapsteker
view skaapsteker/sprites/projectiles.py @ 430:25efc74ac19c
Hook up flight and invisibility discharge
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 09 Apr 2011 18:40:25 +0200 |
parents | 64d8e49e9a86 |
children | c1b0ad1c0932 |
line wrap: on
line source
"""Things people throw at each other.""" from pygame import transform from .base import Projectile class Fireball(Projectile): gravitates = True image_dir = 'sprites/attacks/fireball' animation_regexes = [ ("raining_death", r"^fireball-\d+-sm.png$"), ] facings = { "raining_death" : ( ('left', None), ('right', lambda x: transform.flip(x, True, False))), } PROJECTILE_SIZE = (55, 8) # pixels VELOCITY = (300, -1000) # pps class Lightning(Projectile): gravitates = False friction_coeff = (1.2, 1.2) # negative friction image_dir = 'sprites/attacks' animation_regexes = [ ('frightening', r"^lightning.png$"), ] facings = { "frightening" : ( ('left', None), ('right', lambda x: transform.flip(x, True, False))), } PROJECTILE_SIZE = (55, 8) # pixels VELOCITY = (400, 0) # pps class EnergyDrain(Projectile): gravitates = False friction_coeff = (1.0, 1.0) # no friction image_dir = 'sprites/attacks' animation_regexes = [ ('draining', r"^energy_drain.png$"), ] facings = { "frightening" : ( ('left', None), ('right', lambda x: transform.flip(x, True, False))), } PROJECTILE_SIZE = (55, 8) # pixels VELOCITY = (400, 0) # pps