samples/99_genre_arcade/sound_golf/app/main.rb
def render_score args
  if args.state.times_wrong == 0 # if the user has guessed wrong zero times, the score is par
    args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: PAR", 0, 1, 0, 0, 0]
  else # otherwise, number of times the user has guessed wrong is shown
    args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: +#{args.state.times_wrong}", 0, 1, 0, 0, 0] # shows score using string interpolation
  end
end
# Shows the score (number of times the user guesses wrong) onto the screen using labels.
Shows the score (number of times the user guesses wrong) onto the screen using labels.
Shows the score ( number of times the user guesses wrong ) onto the screen using labels .
def render_score args
  if args.state.times_wrong == 0 
    args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: PAR", 0, 1, 0, 0, 0]
  else 
    args.outputs.labels << [args.grid.w_half, args.grid.top.shift_down(80), "Score: +#{args.state.times_wrong}", 0, 1, 0, 0, 0] 
  end
end
def render_score args if args . state . times_wrong == 0 args . outputs . labels << [ args . grid . w_half , args . grid . top . shift_down ( 80 ) , "Score: PAR" , 0 , 1 , 0 , 0 , 0 ] else args . outputs . labels << [ args . grid . w_half , args . grid . top . shift_down ( 80 ) , "Score: +#{args.state.times_wrong}" , 0 , 1 , 0 , 0 , 0 ] end end
Shows the score (number of times the user guesses wrong) onto the screen using labels.
Shows the score ( number of times the user guesses wrong ) onto the screen using labels .
# if the user has guessed wrong zero times, the score is par # otherwise, number of times the user has guessed wrong is shown # shows score using string interpolation
args