samples/04_physics_and_collisions/08_bouncing_on_collision/app/main.rb
def calc args
  args.state.pegs.each do |peg|
    peg.calc args
  end

  args.state.blocks.each do |block|
    block.calc args
  end

  args.state.ball.update args
  args.state.cannon.update args
end
#Calls all methods necessary for performing calculations
Calls all methods necessary for performing calculations
Calls all methods necessary for performing calculations
def calc args
  args.state.pegs.each do |peg|
    peg.calc args
  end
  args.state.blocks.each do |block|
    block.calc args
  end
  args.state.ball.update args
  args.state.cannon.update args
end
def calc args args . state . pegs . each do | peg | peg . calc args end args . state . blocks . each do | block | block . calc args end args . state . ball . update args args . state . cannon . update args end
Calls all methods necessary for performing calculations
Calls all methods necessary for performing calculations
args