diff --git a/spritesheet.lua b/spritesheet.lua index 88f3dd3..df00509 100644 --- a/spritesheet.lua +++ b/spritesheet.lua @@ -1,5 +1,5 @@ ---local error = require 'errors' 'SpriteSheet2' +local error = require 'errors' 'SpriteSheet2' -------------------------------------------------------------------------------- -- Util @@ -76,6 +76,8 @@ function Animation.new (self) assert(#self > 0) assert(type(self.time) == 'number' or #self == #self.time) + assert(self.wrap == nil or self.wrap == true or self.wrap == false) + local self = setmetatable(self, Animation) self.duration = calculate_animation_duration(self) self.is_animation = true