samples/03_rendering_sprites/04_color_and_rotation/app/main.rb
# Sets default values for the car sprite
# Initialization ||= only happens in the first frame
Sets default values for the car sprite
Initialization ||= only happens in the first frame
Sets default values for the car sprite Initialization || = only happens in the first frame
def default args
  args.state.sprite.width    = 19
  args.state.sprite.height   = 10
  args.state.sprite.scale    = 4
  args.state.max_speed       = 5
  args.state.x             ||= 100
  args.state.y             ||= 100
  args.state.speed         ||= 1
  args.state.angle         ||= 0
end
def default args args . state . sprite . width = 19 args . state . sprite . height = 10 args . state . sprite . scale = 4 args . state . max_speed = 5 args . state . x ||= 100 args . state . y ||= 100 args . state . speed ||= 1 args . state . angle ||= 0 end
Sets default values for the car sprite
Initialization ||= only happens in the first frame
Sets default values for the car sprite Initialization || = only happens in the first frame
args