Dragging Objects
================

Goals
-----

- Use ``MOUSEBUTTONDOWN`` and ``MOUSEBUTTONUP`` to toggle the dragging state.
- Set box location to the mouse position only if dragging.

Extra:

- Snap box to a specific location or reset to previous location.
- "Throw" the box using ``pygame.mouse.get_rel()`` to influence the box's "speed"

Starter code
------------

:doc:`pygame-template` 

Video Tutorial
--------------

.. raw:: html

    <iframe width="560" height="315" src="https://www.youtube.com/embed/1dvqsxXMTUI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

What you need to do
-------------------

- Add the ability to drag a second box
- Create a mini game that will drop smaller boxes from the sky and you must collect the small boxes with the same coloured "container box".

Final Code
----------

.. literalinclude:: code/dragging_objects.py
    :linenos:
    :emphasize-lines: 36, 57-58, 68, 73-74