diff options
| author | realtradam <[email protected]> | 2022-01-25 15:10:13 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-01-25 15:10:13 -0500 |
| commit | 83e1cbba34e76f1f7265fdb56710d2efdcaa6b5c (patch) | |
| tree | 72f9917622c7be1046931e7dbf233f1c7a5f797a /src/helper.rb | |
| parent | cd135f7493caa50bb25200c6b3f665dfa3aad447 (diff) | |
| download | orc-arena-of-time-83e1cbba34e76f1f7265fdb56710d2efdcaa6b5c.tar.gz orc-arena-of-time-83e1cbba34e76f1f7265fdb56710d2efdcaa6b5c.zip | |
added path objects
Diffstat (limited to 'src/helper.rb')
| -rw-r--r-- | src/helper.rb | 16 |
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 |
