samples/09_performance/05_sprites_as_classes/app/main.rb
# calls methods needed for game to run properly
calls methods needed for game to run properly
calls methods needed for game to run properly
def tick args
  if Kernel.global_tick_count == 0
    puts ""
    puts ""
    puts "========================================================="
    puts "* INFO: Sprites, Classes"
    puts "* INFO: Please specify the number of sprites to render."
    args.gtk.console.set_command "reset_with count: 100"
  end
  if args.state.tick_count == 0
    args.state.stars = args.state.star_count.map { |i| Star.new args.grid }
  end
  args.state.stars.each(&:move)
  args.outputs.sprites << args.state.stars
  args.outputs.background_color = [0, 0, 0]
  args.outputs.primitives << args.gtk.current_framerate_primitives
end
def tick args if Kernel . global_tick_count == 0 puts "" puts "" puts "=========================================================" puts "* INFO: Sprites, Classes" puts "* INFO: Please specify the number of sprites to render." args . gtk . console . set_command "reset_with count: 100" end if args . state . tick_count == 0 args . state . stars = args . state . star_count . map { | i | Star . new args . grid } end args . state . stars . each ( & :move ) args . outputs . sprites << args . state . stars args . outputs . background_color = [ 0 , 0 , 0 ] args . outputs . primitives << args . gtk . current_framerate_primitives end
calls methods needed for game to run properly
calls methods needed for game to run properly
# sets console command when sample app initially opens # init # update # render
args