summaryrefslogtreecommitdiffhomepage
path: root/src/helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'src/helper.rb')
-rw-r--r--src/helper.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/helper.rb b/src/helper.rb
index 1de57a5..499f9dc 100644
--- a/src/helper.rb
+++ b/src/helper.rb
@@ -34,7 +34,23 @@ class Tileset
def frames
@frames ||= []
end
+end
+
+class Path
+ def call(time)
+ return nil unless self.paths[time.to_i]
+ self.paths[time.to_i].call(time % 1)
+ end
+ def initialize(*paths)
+ paths.each do |path|
+ self.paths.push path
+ end
+ end
+
+ def paths
+ @paths ||= []
+ end
end
module Helper