Skip to content

Instantly share code, notes, and snippets.

@roberto
Last active December 23, 2015 05:59
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 roberto/6590397 to your computer and use it in GitHub Desktop.
Save roberto/6590397 to your computer and use it in GitHub Desktop.
class Asteroid
attr_reader :x, :y
def initialize(game)
@sprite = Gosu::Image.load_tiles(game, "images/asteroids.png", 320/5, 384/6, true)
@x, @y = 100, 100
end
def update
end
def draw
@sprite[Gosu::milliseconds / 50 % @sprite.size].draw_rot(@x, @y, 3, 0)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment