class Hoop
Attributes
active[RW]
x[RW]
y[RW]
Public Class Methods
new()
click to toggle source
# File lib/rubyhop/hoop.rb, line 3 def initialize @hoop = Rubyhop.image "hoop.png" # center of screen @x = @y = 0 @active = true end
Public Instance Methods
draw()
click to toggle source
# File lib/rubyhop/hoop.rb, line 20 def draw @hoop.draw @x - 66, @y - 98, 1000 - @x end
miss(player)
click to toggle source
# File lib/rubyhop/hoop.rb, line 9 def miss player if (@x - player.x).abs < 12 && (@y - player.y).abs > 72 # the player missed the hoop return true end false end
update(movement)
click to toggle source
# File lib/rubyhop/hoop.rb, line 17 def update movement @x -= movement end