dragonruby-zif icon indicating copy to clipboard operation
dragonruby-zif copied to clipboard

Full paths should be allowed for all animations just like they are for sprites

Open fregas opened this issue 2 years ago • 0 comments

This works:

    self.player_sprite = Zif::Sprite.new.tap do |s|
      s.x = player.x
      s.y = player.y
      s.w = player.size
      s.h = player.size
      s.path = 'sprites/spritesheet.png'
      s.source_h = 8
      s.source_w = 8
      s.source_x = 0 * 8
      s.source_y = 0 * 8
    end

this does not:

    player_sprite.new_tiled_animation(
      named: :walk,
      width: 8, 
      height:8, 
      path: 'sprites/spritesheet.png',

      durations: durations,
    )  

Recommend going with the principle of least surprise. Some devs will not use the normal DR conventions. Also recommend if a path is not found throwing an exception stating the problem, but I'm not sure if that's common with DragonRuby itself.

fregas avatar Oct 11 '23 21:10 fregas