Created
November 15, 2015 22:40
-
-
Save anonymous/f6d20575aaa9022686a5 to your computer and use it in GitHub Desktop.
animation module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Animation | |
def initialize(_AnimFile, x, y, z) | |
@x = x | |
@y = y | |
@z = z | |
@AnimStrip = Gosu::Image.load_tiles(_AnimFile,x,y) | |
@AnimIndex = 0 | |
end | |
def draw(loop, framedelay) | |
if @AnimIndex < @AnimStrip.count | |
@AnimStrip[@AnimIndex].draw(@x, @y, @z) | |
@AnimIndex += 1 | |
elsif loop == true | |
@AnimIndex = 0 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment