cube-tube/app/sprite.rb

26 lines
607 B
Ruby
Raw Normal View History

2023-03-08 03:06:29 +00:00
module Sprite
# annoying to track but useful for reloading with +i+ in debug mode; would be
# nice to define a different way
SPRITES = {
bullet: "sprites/bullet.png",
enemy: "sprites/enemy.png",
enemy_king: "sprites/enemy_king.png",
enemy_super: "sprites/enemy_super.png",
exp_chip: "sprites/exp_chip.png",
familiar: "sprites/familiar.png",
player: "sprites/player.png",
pause: "sprites/pause.png",
}
class << self
def reset_all(args)
SPRITES.each { |_, v| args.gtk.reset_sprite(v) }
end
def for(key)
SPRITES.fetch(key)
end
end
end