Skip to content

Instantly share code, notes, and snippets.

Created November 15, 2015 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/f6d20575aaa9022686a5 to your computer and use it in GitHub Desktop.
Save anonymous/f6d20575aaa9022686a5 to your computer and use it in GitHub Desktop.
animation module
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