Mercurial > skaapsteker
view skaapsteker/sprites/projectiles.py @ 634:20d6aef11249 default tip
Fix iCCC profiles in PNGs to avoid verbose warnings from libpng.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Fri, 27 Jan 2023 23:32:07 +0100 |
parents | c1b0ad1c0932 |
children |
line wrap: on
line source
"""Things people throw at each other.""" from pygame import transform from .base import Projectile class Fireball(Projectile): gravitates = True launch_sound = 'sounds/woosh fireball.ogg', 0.5 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 launch_sound = 'sounds/lightning.ogg', 0.25 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 launch_sound = 'sounds/woosh.ogg', 0.5 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