class Player
  attr_accessor :jumping, :right, :left, :theta, :position, :radius, :velocity

  def initialize sphere
    @sphere = sphere
    @theta = 0.0
    @radius = 5.0
    @position = @sphere.radius - @radius
    @max = @position
    @jumping = false
    @left = false
    @right = false
    @velocity = 0
  end

  def update dt
    if @jumping and @position == @max then
      # TODO: Determine if on the ground
      @velocity = -6.0 
    end

    if @position < @max or @velocity < 0 then
      @velocity += 0.005 * dt
      @position += @velocity
    else
      @position = @max
    end

    if left then
      @theta += 0.0005 * dt
    elsif right then
      @theta -= 0.0005 * dt
    end
  end
end


