o
    tVgf                  	   @   s  d Z ddlZddlZdZdZdZeddZdZ	e
  ejeZej Zdag aG dd	 d	Zd
d Ze  dZdZerej D ],ZejejkrNdZejejkrYej aejejkrpejej krgdZejej!krpe  qDe"d tD ]-Z#tdurze#j$%te#j&e  W n e'y   e(dej) dw ej*+ede#j$e	 qxej,  e-dZej.de/e0 d de1t  es?e2  dS )aK   pg.examples.go_over_there
This simple tech demo is showcasing the use of Vector2.move_towards()
using multiple circles to represent Vectors. Each circle will have a
random position and speed once the demo starts.

Mouse Controls:
* Use the mouse to click on a new target position

Keyboard Controls:
* Press R to restart the demo
    Ng      ?   i@  i  iX  c                   @   s   e Zd Zdd ZdS )Ballc                 C   s   || _ || _d S )N)positionspeed)selfr   r    r   Q/home/ubuntu/.local/lib/python3.10/site-packages/pygame/examples/go_over_there.py__init__   s   
zBall.__init__N)__name__
__module____qualname__r	   r   r   r   r   r      s    r   c               	   C   sb   d a g attD ]&} ttdtt	j
tdtt	j}ttt}t||}t| qd S )Nr   )target_positionballsrange	MAX_BALLSpgVector2randomrandintintSCREEN_SIZExyuniform	MIN_SPEED	MAX_SPEEDr   append)r   posr   br   r   r   reset$   s    
r   TF)      A   zVersion z[ doesn't have Vector.move_towards_ip function.
                    Please update to >=2.1.3)v         <   zfps:    z, ball count: )3__doc__pygamer   r   r   r   r   r   r   CIRCLE_RADIUSinitdisplayset_modescreentimeClockclockr   r   r   r   
delta_timerunningeventgettypeQUITMOUSEBUTTONUPmouseget_posKEYUPkeyK_ESCAPEK_rfillor   move_towards_ipr   AttributeErrorRuntimeError__version__drawcirclefliptickset_captionroundget_fpslenquitr   r   r   r   <module>   s`    




"