samples/06_save_load/01_save_load_game/app/main.rb
def default
    state.engine_tick_count ||= 0
    state.active_module     ||= :room
    state.fire_progress     ||= 0
    state.fire_ready_in     ||= 10
    state.previous_fire     ||= :dead
    state.fire              ||= :dead
  end
# Sets default values.
# The ||= ensures that a variable's value is only set to the value following the = sign
# if the value has not already been set before. Intialization happens only in the first frame.
Sets default values.
The ||= ensures that a variable's value is only set to the value following the = sign
if the value has not already been set before. Intialization happens only in the first frame.
Sets default values . The || = ensures that a variable ' s value is only set to the value following the = sign if the value has not already been set before . Intialization happens only in the first frame .
def default
    state.engine_tick_count ||= 0
    state.active_module     ||= :room
    state.fire_progress     ||= 0
    state.fire_ready_in     ||= 10
    state.previous_fire     ||= :dead
    state.fire              ||= :dead
  end
def default state . engine_tick_count ||= 0 state . active_module ||= :room state . fire_progress ||= 0 state . fire_ready_in ||= 10 state . previous_fire ||= :dead state . fire ||= :dead end
Sets default values.
Sets default values .