Skip to content

Fix the Update Interpolation section on Event Loop page in Programming Guide #2596

Closed
@pushfoo

Description

@pushfoo

What's Broken?

  1. Typo breaking the syntax
  2. The example doesn't have a link to it or an example of how to run it
  3. Multiple typos + broken syntax on https://api.arcade.academy/en/latest/programming_guide/event_loop.html
    The page source is https://github.com/pythonarcade/arcade/blob/development/doc/programming_guide/event_loop.rst

Image

Source:

Update Interpolation
^^^^^^^^^^^^^^^^^^^^
Because fixed updates work on the accumulation of time this may not sync with
the ``on_draw`` or ``on_update`` events. In extreme cases this can cause a visible stuttering to
objects moved within ``on_fixed_update``. To prevent this, ``GLOBAL_FIXED_CLOCK`` provides
the ``accumulated`` and ``fraction``properties. By storing the last frame's position information it is possible
to use ``fraction`` to interpolate towards the next calculated positions. For a visual representation of
this effect look at ``arcade.examples.fixed_update_interpolation``.

Proposed Quick Fix

Note

Since fixes to the update / clock backends are actively being discussed, we'll leave adding a "proper" example thumbnail page till later.

  • s/``fraction``properties/``fraction`` properties/ (add a space)

  • Add temp link to GitHub instead of just a literal:

    For a visual representation of this, run the  `fixed_update_interpolation <https://github.com/pythonarcade/arcade/blob/development/arcade/examples/fixed_update_interpolation.py>`_ example as follows:
    
    .. code-block:: shell
       
       python -m arcade.examples.fixed_update_interpolation
    
  • Elaborate on why / what you should pay attention below the code, covering these points:
    * It will run very slowly at first
    * Watch carefully and pay attention to the right-most yellow circle
    * It will not move smoothly

  • Add method cross-refs for on_draw, on_update, and on_fixed_update by filling in the $EVENT_METHOD name as follows:

    :py:meth:`~Window.$EVENT_METHOD`
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions