A game apparatus stores, when an output value is equal to a boundary value
of a predetermined range, boundary angle data representing a boundary
angle corresponding to a tilt angle of an input device. The game
apparatus obtains, from an input device, data including a value changed
in accordance with a tilt angle of the input device so as to calculate
the tilt angle of the input device. Thereafter, when a tilt angle
calculated in a tilt calculation step is greater than the boundary angle
represented by the boundary angle data, the boundary angle data is
updated such that the tilt angle calculated in the tilt calculation step
becomes a new boundary angle. The output value is calculated based on a
ratio of the tilt angle calculated in the tilt calculation step to the
boundary angle represented by the boundary angle data.