
ҲXc           @   s  d  Z  d d l Z d d l m Z d d l m Z d d l m Z d e e  k r` d   Z	 n  y d d l
 m Z Wn n Xd	 e f d
     YZ d e f d     YZ d e f d     YZ d e f d     YZ e Z e Z d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d   Z d f  d     YZ d   Z d e f d      YZ d!   Z e d"  Z e d#  Z e d$  Z  d S(%   s	  pygame module with basic game object classes

This module contains several simple classes to be used within games. There
are the main Sprite class and several Group classes that contain Sprites.
The use of these classes is entirely optional when using Pygame. The classes
are fairly lightweight and only provide a starting place for the code
that is common to most games.

The Sprite class is intended to be used as a base class for the different
types of objects in the game. There is also a base Group class that simply
stores sprites. A game could create new types of Group classes that operate
on specially customized Sprite instances they contain.

The basic Sprite class can draw the Sprites it contains to a Surface. The
Group.draw() method requires that each Sprite have a Surface.image attribute
and a Surface.rect. The Group.clear() method requires these same attributes
and can be used to erase all the Sprites with background. There are also
more advanced Groups: pygame.sprite.RenderUpdates() and
pygame.sprite.OrderedUpdates().

Lastly, this module contains several collision functions. These help find
sprites inside multiple groups that have intersecting bounding rectangles.
To find the collisions, the Sprites are required to have a Surface.rect
attribute assigned.

The groups are designed for high efficiency in removing and adding Sprites
to them. They also allow cheap testing to see if a Sprite already exists in
a Group. A given Sprite can exist in any number of groups. A game could use
some groups to control object rendering, and a completely separate set of
groups to control interaction or player movement. Instead of adding type
attributes or bools to a derived Sprite class, consider keeping the
Sprites inside organized Groups. This will allow for easier lookup later
in the game.

Sprites and Groups manage their relationships with the add() and remove()
methods. These methods can accept a single or multiple group arguments for
membership.  The default initializers for these classes also take a
single group or list of groups as argments for initial membership. It is safe
to repeatedly add and remove the same Sprite from a Group.

While it is possible to design sprite and group classes that don't derive
from the Sprite and AbstractGroup classes below, it is strongly recommended
that you extend those when you create a new Sprite or Group class.

Sprites are not thread safe, so lock them yourself if using threads.

iN(   t   Rect(   t	   get_ticks(   t   trutht   callablec         C   s   t  |  d  S(   Nt   __call__(   t   hasattr(   t   obj(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   <lambda>a   s    (   t   from_surfacet   Spritec           B   sh   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z RS(   s  simple base class for visible game objects

    pygame.sprite.Sprite(*groups): return Sprite

    The base class for visible game objects. Derived classes will want to
    override the Sprite.update() method and assign Sprite.image and Sprite.rect
    attributes.  The initializer can accept any number of Group instances that
    the Sprite will become a member of.

    When subclassing the Sprite class, be sure to call the base initializer
    before adding the Sprite to Groups.

    c         G   s#   i  |  _  | r |  j |   n  d  S(   N(   t
   _Sprite__gt   add(   t   selft   groups(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   __init__y   s    	c         G   si   |  j  j } xV | D]N } t | d  rT | |  sa | j |   |  j |  qa q |  j |   q Wd S(   s   add the sprite to groups

        Sprite.add(*groups): return None

        Any number of Group instances can be passed as arguments. The
        Sprite will be added to the Groups it is not already a member of.

        t   _spritegroupN(   R
   t   __contains__R   t   add_internalR   (   R   R   t   hast   group(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   ~   s    	c         G   si   |  j  j } xV | D]N } t | d  rT | |  ra | j |   |  j |  qa q |  j |   q Wd S(   s   remove the sprite from groups

        Sprite.remove(*groups): return None

        Any number of Group instances can be passed as arguments. The Sprite
        will be removed from the Groups it is currently a member of.

        R   N(   R
   R   R   t   remove_internalt   remove(   R   R   R   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR      s    	c         C   s   d |  j  | <d  S(   Ni    (   R
   (   R   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR      s    c         C   s   |  j  | =d  S(   N(   R
   (   R   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR      s    c         G   s   d S(   s  method to control sprite behavior

        Sprite.update(*args):

        The default implementation of this method does nothing; it's just a
        convenient "hook" that you can override. This method is called by
        Group.update() with whatever arguments you give it.

        There is no need to use this method if not using the convenience
        method by the same name in the Group class.

        N(    (   R   t   args(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   update   s    c         C   s2   x |  j  D] } | j |   q
 W|  j  j   d S(   sT  remove the Sprite from all Groups

        Sprite.kill(): return None

        The Sprite is removed from all the Groups that contain it. This won't
        change anything about the state of the Sprite. It is possible to
        continue to use the Sprite after this method has been called, including
        adding it to Groups.

        N(   R
   R   t   clear(   R   t   c(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   kill   s    c         C   s   t  |  j  S(   s   list of Groups that contain this Sprite

        Sprite.groups(): return group_list

        Returns a list of all the Groups that contain this Sprite.

        (   t   listR
   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR      s    c         C   s   t  |  j  S(   s   does the sprite belong to any groups

        Sprite.alive(): return bool

        Returns True when the Sprite belongs to one or more Groups.
        (   R   R
   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   alive   s    c         C   s   d |  j  j t |  j  f S(   Ns   <%s sprite(in %d groups)>(   t	   __class__t   __name__t   lenR
   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   __repr__   s    (   R   t
   __module__t   __doc__R   R   R   R   R   R   R   R   R   R    (    (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR	   j   s   								
		t   DirtySpritec           B   sM   e  Z d  Z d   Z d   Z d   Z e d   d   d d Z d   Z RS(	   s$  a more featureful subclass of Sprite with more attributes

    pygame.sprite.DirtySprite(*groups): return DirtySprite

    Extra DirtySprite attributes with their default values:

    dirty = 1
        If set to 1, it is repainted and then set to 0 again.
        If set to 2, it is always dirty (repainted each frame;
        flag is not reset).
        If set to 0, it is not dirty and therefore not repainted again.

    blendmode = 0
        It's the special_flags argument of Surface.blit; see the blendmodes in
        the Surface.blit documentation

    source_rect = None
        This is the source rect to use. Remember that it is relative to the top
        left corner (0, 0) of self.image.

    visible = 1
        Normally this is 1. If set to 0, it will not be repainted. (If you
        change visible to 1, you must set dirty to 1 for it to be erased from
        the screen.)

    _layer = 0
        A READ ONLY value, it is read when adding it to the LayeredUpdates
        group. For details see documentation of sprite.LayeredUpdates.

    c         G   sA   d |  _  d |  _ d |  _ d |  _ d  |  _ t j |  |  d  S(   Ni   i    (   t   dirtyt	   blendmodet   _visiblet   _layert   Nonet   source_rectR	   R   (   R   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR      s    					c         C   s(   | |  _  |  j d k  r$ d |  _ n  d S(   s9   set the visible value (0 or 1) and makes the sprite dirtyi   i   N(   R&   R$   (   R   t   val(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   _set_visible  s    	c         C   s   |  j  S(   s'   return the visible value of that sprite(   R&   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   _get_visible  s    c         C   s
   |  j    S(   N(   R,   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    c         C   s   |  j  |  S(   N(   R+   (   R   t   value(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    t   docso   you can make this sprite disappear without removing it from the group,
assign 0 for invisible and 1 for visiblec         C   s    d |  j  j t |  j    f S(   Ns   <%s DirtySprite(in %d groups)>(   R   R   R   R   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR      s    (	   R   R!   R"   R   R+   R,   t   propertyt   visibleR    (    (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR#      s   	
					t   AbstractGroupc           B   s   e  Z d  Z e Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   sT  base class for containers of sprites

    AbstractGroup does everything needed to behave as a normal group. You can
    easily subclass a new group class from this or the other groups below if
    you want to add more features.

    Any AbstractGroup-derived sprite groups act like sequences and support
    iteration, len, and so on.

    c         C   s   i  |  _  g  |  _ d  S(   N(   t
   spritedictt   lostsprites(   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   +  s    	c         C   s   t  |  j  S(   s}  get a list of sprites in the group

        Group.sprite(): return list

        Returns an object that can be looped over with a 'for' loop. (For now,
        it is always a list, but this could change in a future version of
        pygame.) Alternatively, you can get the same information by iterating
        directly over the sprite group, e.g. 'for sprite in group'.

        (   R   R2   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   sprites/  s    c         C   s   d |  j  | <d  S(   Ni    (   R2   (   R   t   sprite(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   <  s    c         C   s4   |  j  | } | r& |  j j |  n  |  j  | =d  S(   N(   R2   R3   t   append(   R   R5   t   r(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   ?  s    c         C   s   | |  j  k S(   N(   R2   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   has_internalE  s    c         C   s   |  j  |  j    S(   s   copy a group with all the same sprites

        Group.copy(): return Group

        Returns a copy of the group that is an instance of the same class
        and has the same sprites in it.

        (   R   R4   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   copyH  s    	c         C   s   t  |  j    S(   N(   t   iterR4   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   __iter__S  s    c         C   s   |  j  |  S(   N(   R   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   V  s    c         G   s   x | D] } t  | t  rK |  j |  s |  j |  | j |   q q y |  j |   Wq t t f k
 r t | d  r xo | j   D]2 } |  j |  s |  j |  | j |   q q Wq |  j |  s |  j |  | j |   q q Xq Wd S(   s   add sprite(s) to group

        Group.add(sprite, list, group, ...): return None

        Adds a sprite or sequence of sprites to a group.

        R   N(	   t
   isinstanceR	   R8   R   R   t	   TypeErrort   AttributeErrorR   R4   (   R   R4   R5   t   spr(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   Y  s     c         G   s   x | D] } t  | t  rK |  j |  r |  j |  | j |   q q y |  j |   Wq t t f k
 r t | d  r xo | j   D]2 } |  j |  r |  j |  | j |   q q Wq |  j |  r |  j |  | j |   q q Xq Wd S(   s   remove sprite(s) from group

        Group.remove(sprite, list, or group, ...): return None

        Removes a sprite or sequence of sprites from a group.

        R   N(	   R<   R	   R8   R   R   R=   R>   R   R4   (   R   R4   R5   R?   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   |  s     c         G   s   t  } x | D] } t | t  rA |  j |  r: t } q t  Sq y  |  j |   r\ t } n t  SWq t t f k
 r t | d  r xO | j	   D]" } |  j |  r t } q t  Sq Wq |  j |  r t } q t  Sq Xq W| S(   s;  ask if group has a sprite or sprites

        Group.has(sprite or group, ...): return bool

        Returns True if the given sprite or sprites are contained in the
        group. Alternatively, you can get the same information using the
        'in' operator, e.g. 'sprite in group', 'subgroup in group'.

        R   (
   t   FalseR<   R	   R8   t   TrueR   R=   R>   R   R4   (   R   R4   t   return_valueR5   R?   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s(    
				c         G   s(   x! |  j    D] } | j |   q Wd S(   s   call the update method of every member sprite

        Group.update(*args): return None

        Calls the update method of every member sprite. All arguments that
        were passed to this method are passed to the Sprite update function.

        N(   R4   R   (   R   R   t   s(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    	c         C   sO   |  j    } | j } x* | D]" } | | j | j  |  j | <q Wg  |  _ d S(   s   draw all sprites onto the surface

        Group.draw(surface): return None

        Draws all of the member sprites onto the given surface.

        N(   R4   t   blitt   imaget   rectR2   R3   (   R   t   surfaceR4   t   surface_blitR?   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   draw  s
    	 c         C   s   t  |  r` x |  j D] } | | |  q Wx |  j j   D] } | r= | | |  q= q= Wn` | j } x! |  j D] } | | | |  qs Wx0 |  j j   D] } | r | | | |  q q Wd S(   s}  erase the previous position of all sprites

        Group.clear(surface, bgd): return None

        Clears the area under every drawn sprite in the group. The bgd
        argument should be Surface which is the same dimensions as the
        screen surface. The bgd could also be a function which accepts
        the given surface and the area to be cleared as arguments.

        N(   R   R3   R2   t   valuesRD   (   R   RG   t   bgdR7   RH   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    	c         C   s5   x. |  j    D]  } |  j |  | j |   q Wd S(   sq   remove all sprites

        Group.empty(): return None

        Removes all the sprites from the group.

        N(   R4   R   (   R   RC   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   empty  s    c         C   s   t  |  j    S(   N(   R   R4   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   __nonzero__  s    c         C   s   t  |  j    S(   s   return number of sprites in group

        Group.len(group): return int

        Returns the number of sprites contained in the group.

        (   R   R4   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   __len__  s    c         C   s   d |  j  j t |   f S(   Ns   <%s(%d sprites)>(   R   R   R   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR      s    (   R   R!   R"   RA   R   R   R4   R   R   R8   R9   R;   R   R   R   R   R   RI   R   RL   RM   RN   R    (    (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR1     s(   
									#	 	(						
t   Groupc           B   s   e  Z d  Z d   Z RS(   s  container class for many Sprites

    pygame.sprite.Group(*sprites): return Group

    A simple container for Sprite objects. This class can be subclassed to
    create containers with more specific behaviors. The constructor takes any
    number of Sprite arguments to add to the Group. The group supports the
    following standard Python operations:

        in      test if a Sprite is contained
        len     the number of Sprites contained
        bool    test if any Sprites are contained
        iter    iterate through all the Sprites

    The Sprites in the Group are not ordered, so the Sprites are drawn and
    iterated over in no particular order.

    c         G   s   t  j |   |  j |   d  S(   N(   R1   R   R   (   R   R4   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   &  s    (   R   R!   R"   R   (    (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyRO     s   t   RenderUpdatesc           B   s   e  Z d  Z d   Z RS(   s   Group class that tracks dirty updates

    pygame.sprite.RenderUpdates(*sprites): return RenderUpdates

    This class is derived from pygame.sprite.Group(). It has an enhanced draw
    method that tracks the changed areas of the screen.

    c   	      C   s   |  j  } | j } |  j } g  |  _ | j } x |  j   D]{ } | | } | | j | j  } | r | j |  r | | j |   q | |  | |  n
 | |  | | | <q: W| S(   N(	   R2   RD   R3   R6   R4   RE   RF   t   colliderectt   union(	   R   RG   R2   RH   R$   t   dirty_appendRC   R7   t   newrect(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyRI   6  s     					


(   R   R!   R"   RI   (    (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyRP   -  s   t   OrderedUpdatesc           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   sz  RenderUpdates class that draws Sprites in order of addition

    pygame.sprite.OrderedUpdates(*spites): return OrderedUpdates

    This class derives from pygame.sprite.RenderUpdates().  It maintains
    the order in which the Sprites were added to the Group for rendering.
    This makes adding and removing Sprites from the Group a little
    slower than regular Groups.

    c         G   s   g  |  _  t j |  |  d  S(   N(   t   _spritelistRP   R   (   R   R4   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   U  s    	c         C   s   t  |  j  S(   N(   R   RV   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR4   Y  s    c         C   s$   t  j |  |  |  j j |  d  S(   N(   RP   R   RV   R6   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   \  s    c         C   s$   t  j |  |  |  j j |  d  S(   N(   RP   R   RV   R   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   `  s    (   R   R!   R"   R   R4   R   R   (    (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyRU   J  s
   
			t   LayeredUpdatesc           B   s   e  Z d  Z e d d d d  Z d   Z d d  Z d   Z d   Z	 d   Z
 d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s   LayeredUpdates Group handles layers, which are drawn like OrderedUpdates

    pygame.sprite.LayeredUpdates(*spites, **kwargs): return LayeredUpdates

    This group is fully compatible with pygame.sprite.Sprite.
    New in pygame 1.8.0

    i    c         O   sH   i  |  _  g  |  _ t j |   | j d d  |  _ |  j | |   d S(   s+  initialize an instance of LayeredUpdates with the given attributes

        You can set the default layer through kwargs using 'default_layer'
        and an integer for the layer. The default layer is 0.

        If the sprite you add has an attribute _layer, then that layer will be
        used. If **kwarg contains 'layer', then the passed sprites will be
        added to that layer (overriding the sprite._layer attribute). If
        neither the sprite nor **kwarg has a 'layer', then the default layer is
        used to add the sprites.

        t   default_layeri    N(   t   _spritelayersRV   R1   R   t   gett   _default_layerR   (   R   R4   t   kwargs(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   q  s
    		c   	      C   s<  |  j  |  j | <| d k rP y | j } Wqk t k
 rL |  j } | _ qk Xn t | d  rk | | _ n  |  j } |  j } | | | <t	 |  } d } } | d } xM | | k r | | | d } | | | | k r | d } q | d } q Wx. | | k  r'| | | | k r'| d 7} q W| j
 | |  d S(   sg   Do not use this method directly.

        It is used by the group to add a sprite internally.

        R'   i    i   i   N(   t
   _init_rectR2   R(   R'   R>   R[   R   RV   RY   R   t   insert(	   R   R5   t   layerR4   t   sprites_layerst   lengt   lowt   midt   high(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s,    		


#c         O   s4  | s
 d Sd | k r# | d } n d } x| D] } t | t  rw |  j |  s,|  j | |  | j |   q,q0 y |  j | |   Wq0 t t f k
 r+t | d  r xu | j	   D]5 } |  j |  s |  j | |  | j |   q q Wq,|  j |  s,|  j | |  | j |   q,q0 Xq0 Wd S(   s  add a sprite or sequence of sprites to a group

        LayeredUpdates.add(*sprites, **kwargs): return None

        If the sprite you add has an attribute _layer, then that layer will be
        used. If **kwarg contains 'layer', then the passed sprites will be
        added to that layer (overriding the sprite._layer attribute). If
        neither the sprite nor **kwarg has a 'layer', then the default layer is
        used to add the sprites.

        NR_   R   (
   R(   R<   R	   R8   R   R   R=   R>   R   R4   (   R   R4   R\   R_   R5   R?   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s*    c         C   s|   |  j  j |  |  j | } | |  j k	 r? |  j j |  n  t | d  rd |  j j | j  n  |  j | =|  j | =d S(   sV   Do not use this method directly.

        The group uses it to add a sprite.

        RF   N(	   RV   R   R2   R]   R3   R6   R   RF   RY   (   R   R5   R7   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    
c         C   s   t  |  j  S(   st   return a ordered list of sprites (first back, last top).

        LayeredUpdates.sprites(): return sprites

        (   R   RV   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR4     s    c   
      C   s   |  j  } | j } |  j } g  |  _ | j } |  j } x |  j   D] } | | } | | j | j  }	 | | k r | |	  n9 |	 j |  r | |	 j	 |   n | |	  | |  |	 | | <qC W| S(   s}   draw all sprites in the right order onto the passed surface

        LayeredUpdates.draw(surface): return Rect_list

        (
   R2   RD   R3   R6   R]   R4   RE   RF   RQ   RR   (
   R   RG   R2   RH   R$   RS   t	   init_rectR?   t   recRT   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyRI     s"    						


c         C   sH   |  j  } t | d  } | j |  } g  | D] } | | ^ q. } | S(   s   return a list with all sprites at that position

        LayeredUpdates.get_sprites_at(pos): return colliding_sprites

        Bottom sprites are listed first; the top ones are listed last.

        i    (   i    i    (   RV   R    t   collidelistall(   R   t   post   _spritesRF   t   colliding_idxt   it	   colliding(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   get_sprites_at
  s
    	c         C   s   |  j  | S(   s   return the sprite at the index idx from the groups sprites

        LayeredUpdates.get_sprite(idx): return sprite

        Raises IndexOutOfBounds if the idx is not within range.

        (   RV   (   R   t   idx(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt
   get_sprite  s    c         C   s    |  j  |  } |  j |   | S(   s   remove all sprites from a layer and return them as a list

        LayeredUpdates.remove_sprites_of_layer(layer_nr): return sprites

        (   t   get_sprites_from_layerR   (   R   t   layer_nrR4   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   remove_sprites_of_layer"  s    c         C   s   t  t |  j j     S(   si   return a list of unique defined layers defined.

        LayeredUpdates.layers(): return layers

        (   t   sortedt   setRY   RJ   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   layers-  s    c   	      C   s  |  j  } |  j } | j |  | j |  t |  } d } } | d } xM | | k r | | | d } | | | | k r | d } qO | d } qO Wx. | | k  r | | | | k r | d 7} q W| j | |  t | d  r | | _ n  | | | <d S(   s   change the layer of the sprite

        LayeredUpdates.change_layer(sprite, new_layer): return None

        The sprite must have been added to the renderer already. This is not
        checked.

        i    i   i   R_   N(   RV   RY   R   t   popR   R^   R   R_   (	   R   R5   t	   new_layerR4   R`   Ra   Rb   Rc   Rd   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   change_layer5  s$    			

#c         C   s   |  j  j | |  j  S(   s   return the layer that sprite is currently in

        If the sprite is not found, then it will return the default layer.

        (   RY   RZ   R[   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   get_layer_of_spriteY  s    c         C   s   |  j  |  j d S(   sT   return the top layer

        LayeredUpdates.get_top_layer(): return layer

        i(   RY   RV   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   get_top_layera  s    c         C   s   |  j  |  j d S(   sZ   return the bottom layer

        LayeredUpdates.get_bottom_layer(): return layer

        i    (   RY   RV   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   get_bottom_layeri  s    c         C   s   |  j  | |  j    d S(   s  bring the sprite to front layer

        LayeredUpdates.move_to_front(sprite): return None

        Brings the sprite to front by changing the sprite layer to the top-most
        layer. The sprite is added at the end of the list of sprites in that
        top-most layer.

        N(   Rx   Rz   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   move_to_frontq  s    
c         C   s   |  j  | |  j   d  d S(   s   move the sprite to the bottom layer

        LayeredUpdates.move_to_back(sprite): return None

        Moves the sprite to the bottom layer by moving it to a new layer below
        the current bottom layer.

        i   N(   Rx   R{   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   move_to_back}  s    	c         C   s   |  j  d S(   s[   return the topmost sprite

        LayeredUpdates.get_top_sprite(): return Sprite

        i(   RV   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   get_top_sprite  s    c         C   sa   g  } | j  } |  j } xB |  j D]7 } | | | k rE | |  q" | | | k r" Pq" q" W| S(   s2  return all sprites from a layer ordered as they where added

        LayeredUpdates.get_sprites_from_layer(layer): return sprites

        Returns all sprites from a layer. The sprites are ordered in the
        sequence that they where added. (The sprites are not removed from the
        layer.

        (   R6   RY   RV   (   R   R_   R4   t   sprites_appendt   sprite_layersR?   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyRp     s    
		c         C   sP   |  j  |  } x' |  j |  D] } |  j | |  q W|  j d | |  d S(   s   switch the sprites from layer1_nr to layer2_nr

        LayeredUpdates.switch_layer(layer1_nr, layer2_nr): return None

        The layers number must exist. This method does not check for the
        existence of the given layers.

        R_   N(   Rr   Rp   Rx   R   (   R   t	   layer1_nrt	   layer2_nrt   sprites1R?   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   switch_layer  s    	N(   R   R!   R"   R    R]   R   R(   R   R   R   R4   RI   Rm   Ro   Rr   Ru   Rx   Ry   Rz   R{   R|   R}   R~   Rp   R   (    (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyRW   e  s*   	$	.					
			$							t   LayeredDirtyc           B   sh   e  Z d  Z d   Z d
 d  Z d
 d  Z d   Z d   Z d
 d  Z	 d   Z
 d   Z d	   Z RS(   s,  LayeredDirty Group is for DirtySprites; subclasses LayeredUpdates

    pygame.sprite.LayeredDirty(*spites, **kwargs): return LayeredDirty

    This group requires pygame.sprite.DirtySprite or any sprite that
    has the following attributes:
        image, rect, dirty, visible, blendmode (see doc of DirtySprite).

    It uses the dirty flag technique and is therefore faster than
    pygame.sprite.RenderUpdates if you have many static sprites.  It
    also switches automatically between dirty rect updating and full
    screen drawing, so you do no have to worry which would be faster.

    As with the pygame.sprite.Group, you can specify some additional attributes
    through kwargs:
        _use_update: True/False   (default is False)
        _default_layer: default layer where the sprites without a layer are
            added
        _time_threshold: treshold time for switching between dirty rect mode
            and fullscreen mode; defaults to updating at 80 frames per second,
            which is equal to 1000.0 / 80.0

    New in pygame 1.8.0

    c         O   s   t  j |  | |  d |  _ t |  _ d d |  _ d |  _ xK | j   D]= \ } } | d k rH t	 |  |  r t
 |  | |  q qH qH Wd S(   s  initialize group.

        pygame.sprite.LayeredDirty(*spites, **kwargs): return LayeredDirty

        You can specify some additional attributes through kwargs:
            _use_update: True/False   (default is False)
            _default_layer: default layer where the sprites without a layer are
                added
            _time_threshold: treshold time for switching between dirty rect
                mode and fullscreen mode; defaults to updating at 80 frames per
                second, which is equal to 1000.0 / 80.0

        g     @@g      T@t   _use_updatet   _time_thresholdR[   N(   s   _use_updates   _time_thresholds   _default_layer(   RW   R   R(   t   _clipR@   R   R   t   _bgdt   itemsR   t   setattr(   R   R4   R\   t   keyR*   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    			c         C   s   t  | d  s t    n  t  | d  s6 t    n  t  | d  sQ t    n  t | t  sl t    n  | j d k r d | _ n  t j |  | |  d S(   sg   Do not use this method directly.

        It is used by the group to add a sprite internally.

        R$   R0   R%   i    i   N(   R   R>   R<   R#   R=   R$   RW   R   (   R   R5   R_   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    c      
   C   s  | j    } |  j } | d k r* | } n  | } |  j } |  j } |  j } | j }	 d }
 | j } t } | d k	 r | |  _	 n  |  j	 } |  j
 } | j |  t   } |  j r`xC| D];} d | j k  r | j r | | j j | j j  } n | | j  } | j } | j } | |  } x1 d | k  rU| | |  | | =| |  } q%W|	 | j |   | | | k	 r| | |  } | j } | j } | |  } x1 d | k  r| | |  | | =| |  } qW|	 | j |   qq q W| d k	 r(x! | D] } | | | |  qWn  x&| D]} d | j k r| j rM| j } | j d k	 rt | j j | j j  } n  | j } xo | j |  D][ } | | |  } | | j | | d | d | d | d | d | d f | j  qWqMq/| j r2| | j | j | j | j  | | <n  | j d k r/d | _ q/q/Wt |  }
 nm | d k	 r|| | d  n  x? | D]7 } | j r| | j | j | j | j  | | <qqW| |  g }
 t   } | | |  j k rt |  _ n	 t |  _ g  | (| j |  |
 S(   s  draw all sprites in the right order onto the given surface

        LayeredDirty.draw(surface, bgd=None): return Rect_list

        You can pass the background too. If a self.bgd is already set to some
        value that is not None, then the bgd argument has no effect.

        i    ii   i   i   N(   i    i    (   t   get_clipR   R(   RV   R2   R3   R6   RD   R    R   R]   t   set_clipR   R   R$   R)   RF   t   topleftt   sizet   collidelistt   union_ipt   clipR&   Rg   RE   R%   R   R   R@   RA   (   R   RG   RK   t
   _orig_clipR   t   _surfRi   t	   _old_rectt   _updatet   _update_appendt   _rett
   _surf_blitt   _rectR   Re   t
   start_timeR?   t   _union_rectt   _union_rect_collidelistt   _union_rect_union_ipRk   Rf   t	   _spr_rectt   _spr_rect_clipRn   R   t   end_time(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyRI      s    
																				
						c         C   s   | |  _  d S(   sO   use to set background

        Group.clear(surface, bgd): return None

        N(   R   (   R   RG   RK   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    c         C   sB   |  j  r( |  j j | j |  j    n |  j j t |   d S(   s   repaint the given area

        LayeredDirty.repaint_rect(screen_rect): return None

        screen_rect is in screen coordinates.

        N(   R   R3   R6   R   R    (   R   t   screen_rect(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   repaint_rect  s    	c         C   s=   | d k r' t j j   j   |  _ n	 | |  _ t |  _ d S(   s   clip the area where to draw; pass None (default) to reset the clip

        LayeredDirty.set_clip(screen_rect=None): return None

        N(   R(   t   pygame_sdl2t   displayt   get_surfacet   get_rectR   R@   R   (   R   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    	c         C   s   |  j  S(   s]   get the area where drawing will occur

        LayeredDirty.get_clip(): return Rect

        (   R   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    c         C   s2   t  j |  | |  | j d k r. d | _ n  d S(   s   change the layer of the sprite

        LayeredUpdates.change_layer(sprite, new_layer): return None

        The sprite must have been added to the renderer already. This is not
        checked.

        i    i   N(   RW   Rx   R$   (   R   R5   Rw   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyRx     s    	c         C   s   | |  _  d S(   sj  set the treshold in milliseconds

        set_timing_treshold(time_ms): return None

        Defaults to 1000.0 / 80.0. This means that the screen will be painted
        using the flip method rather than the update method if the update
        method is taking so long to update the screen that the frame rate falls
        below 80 frames per second.

        N(   R   (   R   t   time_ms(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   set_timing_treshold  s    N(   R   R!   R"   R   R(   R   RI   R   R   R   R   Rx   R   (    (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s   					t   GroupSinglec           B   s   e  Z d  Z d d  Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 e e	 e
 d d  Z d	   Z d
   Z d   Z RS(   s  A group container that holds a single most recent item.

    This class works just like a regular group, but it only keeps a single
    sprite in the group. Whatever sprite has been added to the group last will
    be the only sprite in the group.

    You can access its one sprite as the .sprite attribute.  Assigning to this
    attribute will properly remove the old sprite and then add the new one.

    c         C   s6   t  j |   d  |  _ | d  k	 r2 |  j |  n  d  S(   N(   R1   R   R(   t   _GroupSingle__spriteR   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    	c         C   s   t  |  j  S(   N(   R   R   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR9     s    c         C   s!   |  j  d  k	 r |  j  g Sg  Sd  S(   N(   R   R(   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR4     s    
c         C   s?   |  j  d  k	 r2 |  j  j |   |  j |  j   n  | |  _  d  S(   N(   R   R(   R   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    c         C   s   |  j  d  k	 S(   N(   R   R(   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyRM     s    c         C   s   |  j  S(   N(   R   (   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   _get_sprite  s    c         C   s   |  j  |  | j  |   | S(   N(   R   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   _set_sprite  s    s"   The sprite contained in this groupc         C   sA   | |  j  k r d  |  _  n  | |  j k r= t j |  |  n  d  S(   N(   R   R(   R2   R1   R   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    c         C   s   |  j  | k S(   N(   R   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR8     s    c         C   s   |  j  | k S(   N(   R   (   R   R5   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    N(   R   R!   R"   R(   R   R9   R4   R   RM   R   R   R/   R5   R   R8   R   (    (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s   
									c         C   s   |  j  j | j   S(   s  collision detection between two sprites, using rects.

    pygame.sprite.collide_rect(left, right): return bool

    Tests for collision between two sprites. Uses the pygame.Rect colliderect
    function to calculate the collision. It is intended to be passed as a
    collided callback function to the *collide functions. Sprites must have
    "rect" attributes.

    New in pygame 1.8.0

    (   RF   RQ   (   t   leftt   right(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   collide_rect  s    t   collide_rect_ratioc           B   s    e  Z d  Z d   Z d   Z RS(   sO  A callable class that checks for collisions using scaled rects

    The class checks for collisions between two sprites using a scaled version
    of the sprites' rects. Is created with a ratio; the instance is then
    intended to be passed as a collided callback function to the *collide
    functions.

    New in pygame 1.8.1

    c         C   s   | |  _  d S(   s   create a new collide_rect_ratio callable

        Ratio is expected to be a floating point value used to scale
        the underlying sprite rect before checking for collisions.

        N(   t   ratio(   R   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   "  s    c         C   s   |  j  } | j } | j } | j } | j | | | | | |  } | j } | j } | j } | j | | | | | |  } | j |  S(   se  detect collision between two sprites using scaled rects

        pygame.sprite.collide_rect_ratio(ratio)(left, right): return bool

        Tests for collision between two sprites. Uses the pygame.Rect
        colliderect function to calculate the collision after scaling the rects
        by the stored ratio. Sprites must have "rect" attributes.

        (   R   RF   t   widtht   heightt   inflateRQ   (   R   R   R   R   t   leftrectR   R   t	   rightrect(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   +  s    							(   R   R!   R"   R   R   (    (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s   
		c   	      C   s   |  j  j | j  j } |  j  j | j  j } | d | d } t |  d  rY |  j } n9 |  j  } d | j d | j d d } t |  d |  t | d  r | j } n9 | j  } d | j d | j d d } t | d |  | | | d k S(   s  detect collision between two sprites using circles

    pygame.sprite.collide_circle(left, right): return bool

    Tests for collision between two sprites by testing whether two circles
    centered on the sprites overlap. If the sprites have a "radius" attribute,
    then that radius is used to create the circle; otherwise, a circle is
    created that is big enough to completely enclose the sprite's rect as
    given by the "rect" attribute. This function is intended to be passed as
    a collided callback function to the *collide functions. Sprites must have a
    "rect" and an optional "radius" attribute.

    New in pygame 1.8.0

    i   t   radiusg      ?(   RF   t   centerxt   centeryR   R   R   R   R   (	   R   R   t	   xdistancet	   ydistancet   distancesquaredt
   leftradiusR   t   rightradiusR   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   collide_circleF  s    	 	 t   collide_circle_ratioc           B   s    e  Z d  Z d   Z d   Z RS(   sy  detect collision between two sprites using scaled circles

    This callable class checks for collisions between two sprites using a
    scaled version of a sprite's radius. It is created with a ratio as the
    argument to the constructor. The instance is then intended to be passed as
    a collided callback function to the *collide functions.

    New in pygame 1.8.1

    c         C   s   | |  _  d S(   s9  creates a new collide_circle_ratio callable instance

        The given ratio is expected to be a floating point value used to scale
        the underlying sprite radius before checking for collisions.

        When the ratio is ratio=1.0, then it behaves exactly like the
        collide_circle method.

        N(   R   (   R   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   |  s    
c         C   s  |  j  } | j j | j j } | j j | j j } | d | d } t | d  rf | j | } n= | j } | d | j d | j d d } t | d |  t | d  r | j | }	 n= | j }
 | d |
 j d |
 j d d }	 t | d |	  | | |	 d k S(   s  detect collision between two sprites using scaled circles

        pygame.sprite.collide_circle_radio(ratio)(left, right): return bool

        Tests for collision between two sprites by testing whether two circles
        centered on the sprites overlap after scaling the circle's radius by
        the stored ratio. If the sprites have a "radius" attribute, that is
        used to create the circle; otherwise, a circle is created that is big
        enough to completely enclose the sprite's rect as given by the "rect"
        attribute. Intended to be passed as a collided callback function to the
        *collide functions. Sprites must have a "rect" and an optional "radius"
        attribute.

        i   R   g      ?(	   R   RF   R   R   R   R   R   R   R   (   R   R   R   R   R   R   R   R   R   R   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s    		$	$(   R   R!   R"   R   R   (    (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR   p  s   
	c         C   s   | j  d |  j  d } | j  d |  j  d } y |  j } Wn  t k
 r_ t |  j  } n Xy | j } Wn  t k
 r t | j  } n X| j | | | f  S(   s  collision detection between two sprites, using masks.

    pygame.sprite.collide_mask(SpriteLeft, SpriteRight): bool

    Tests for collision between two sprites by testing if their bitmasks
    overlap. If the sprites have a "mask" attribute, that is used as the mask;
    otherwise, a mask is created from the sprite image. Intended to be passed
    as a collided callback function to the *collide functions. Sprites must
    have a "rect" and an optional "mask" attribute.

    New in pygame 1.8.0

    i    i   (   RF   t   maskR>   R   RE   t   overlap(   R   R   t   xoffsett   yoffsett   leftmaskt	   rightmask(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   collide_mask  s    c         C   s
  | r g  } | j  } | r[ x | j   D], } | |  |  r( | j   | |  q( q( WnI |  j j } x: | j   D], } | | j  rt | j   | |  qt qt W| S| r g  | D] } | |  |  r | ^ q S|  j j } g  | D] } | | j  r | ^ q Sd S(   s-  find Sprites in a Group that intersect another Sprite

    pygame.sprite.spritecollide(sprite, group, dokill, collided=None):
        return Sprite_list

    Return a list containing all Sprites in a Group that intersect with another
    Sprite. Intersection is determined by comparing the Sprite.rect attribute
    of each Sprite.

    The dokill argument is a bool. If set to True, all Sprites that collide
    will be removed from the Group.

    The collided argument is a callback function used to calculate if two
    sprites are colliding. it should take two sprites as values, and return a
    bool value indicating if they are colliding. If collided is not passed, all
    sprites must have a "rect" value, which is a rectangle of the sprite area,
    which will be used to calculate the collision.

    N(   R6   R4   R   RF   RQ   (   R5   R   t   dokillt   collidedt   crashedR6   RC   t   spritecollide(    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyR     s$    	

&c   	      C   s   i  } t  } | r^ x |  j   D]8 } | | | | |  } | r | | | <| j   q q Wn9 x6 |  D]. } | | | | |  } | re | | | <qe qe W| S(   sw  detect collision between a group and another group

    pygame.sprite.groupcollide(groupa, groupb, dokilla, dokillb):
        return dict

    Given two groups, this will find the intersections between all sprites in
    each group. It returns a dictionary of all sprites in the first group that
    collide. The value for each item in the dictionary is a list of the sprites
    in the second group it collides with. The two dokill arguments control if
    the sprites from either group will be automatically removed from all
    groups. Collided is a callback function used to calculate if two sprites
    are colliding. it should take two sprites as values, and return a bool
    value indicating if they are colliding. If collided is not passed, all
    sprites must have a "rect" value, which is a rectangle of the sprite area
    that will be used to calculate the collision.

    (   R   R4   R   (	   t   groupat   groupbt   dokillat   dokillbR   R   t   SCRC   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   groupcollide  s    
c         C   sa   | r- xT | D] } | |  |  r | Sq Wn0 |  j  j } x! | D] } | | j   r@ | Sq@ Wd S(   s  finds any sprites in a group that collide with the given sprite

    pygame.sprite.spritecollideany(sprite, group): return sprite

    Given a sprite and a group of sprites, this will return return any single
    sprite that collides with with the given sprite. If there are no
    collisions, then this returns None.

    If you don't need all the features of the spritecollide function, this
    function will be a bit quicker.

    Collided is a callback function used to calculate if two sprites are
    colliding. It should take two sprites as values and return a bool value
    indicating if they are colliding. If collided is not passed, then all
    sprites must have a "rect" value, which is a rectangle of the sprite area,
    which will be used to calculate the collision.

    N(   RF   RQ   R(   (   R5   R   R   RC   R   (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   spritecollideany  s    (!   R"   R   R    t   pygame_sdl2.timeR   t   operatorR   t   dirt   __builtins__R   t   pygame_sdl2.maskR   t   objectR	   R#   R1   RO   t   RenderPlaint   RenderClearRP   RU   RW   R   R   R   R   R   R   R   R(   R   R   R   (    (    (    s?   c:\mingw\msys\1.0\newbuild\install\python\pygame_sdl2\sprite.pyt   <module>C   s>   s? P @	0	*@	.!