Skip to content

Commit

Permalink
sprites: colorize weapons by ammo type
Browse files Browse the repository at this point in the history
Melee weapons get a red rectangle, projectile weapons get a blue one.

Fixes fragglet#9
  • Loading branch information
fabiangreffrath committed Nov 16, 2023
1 parent 676d0dc commit 37e5fa1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sprites/templates/copy_sprites.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,21 @@ def handle_obstacle(mobj):

handle_player(deh9000.mobjinfo[deh9000.MT_PLAYER])

GUN_FRAME_BY_AMMO = (
"gun",
"gun",
"gun-projectile",
"gun-projectile",
"gun",
"gun-melee",
)

for weapon_id, weapon in enumerate(deh9000.weaponinfo):
for state_id in deh9000.states.walk(weapon.flashstate):
frames[state_id] = "gunflash"
for field in ("upstate", "downstate", "readystate", "atkstate"):
for state_id in deh9000.states.walk(getattr(weapon, field)):
frames[state_id] = "gun"
frames[state_id] = GUN_FRAME_BY_AMMO[weapon.ammo]

wadinfo_names = set()

Expand Down
Binary file added sprites/templates/gun-melee.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sprites/templates/gun-projectile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 37e5fa1

Please # to comment.