
require 'gosu'
class Scores
  attr_accessor :ammunition, :kills, :timeleft, :killwinning

  def initialize(window,difficulty)
   
    @text = Gosu::Font.new(window,"Arial",20)
    @ammunition = 25
    @kills =0
    if difficulty == "easy" then
      @timeleft = 50 #50sec
      @killwinning =5
    end
    
    if difficulty == "medium" then
      @timeleft = 120 #2min
      @killwinning =30
    end
    
    if difficulty == "hard" then
      @timeleft = 300 #5min
      @killwinning =50
    end
    
    if difficulty == "extreme" then
      @timeleft = 600 #10min
      @killwinning =300
    end
  end
  

  def decreaseammunition
    
   if(@ammunition > 0) then
    @ammunition -= 1
   end

  end
  
  def increasekill
    @kills +=0.5
  end
  
  def increaseammunition
    @ammunition = @ammunition +10
  end
  
  
  
 
  def draw

    @text.draw("Ammunition: "+@ammunition.to_s,10, 10, 1, factor_x = 1, factor_y = 1, color = 0xffffffff, mode = :default)
    @text.draw("Kills: "+@kills.ceil.to_s,700, 10, 1, factor_x = 1, factor_y = 1, color = 0xffffffff, mode = :default)
    @text.draw("Time: "+@timeleft.to_s,500, 10, 1, factor_x = 1, factor_y = 1, color = 0xffffffff, mode = :default)
    
  end
  
end