
Tc           @   sU  d  d l  Z  d  d l Z e j j e j j e   Z d   Z e  j j d e d   d  d l	 Z	 e	 j
 j   d  d l Z d  d l Z d  d l Z d  d l Z e	 j
 j   d& Z d' Z d   Z e d  Z e d	  a g  a d
 a t d  Z d   Z d e j f d     YZ d e j f d     YZ d e j f d     YZ d e j f d     YZ d e j f d     YZ  d e j f d     YZ! d e j f d     YZ" d e j f d     YZ# d e j f d     YZ$ d e j f d      YZ% d! e j f d"     YZ& d#   Z' e( d$ k rQe j) j e d% e* e'   e j) j+   n  d S((   iNc         C   s   t  j j t |   S(   N(   t   ost   patht   joint   game_dir(   t   archivo(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   gamedir   s    i   s
   ../../Lib/i  i@   c         C   s   |  j    } g  } d } xn | D]f } t |  t |  | k rW | j |  d } n  | | d } | | d k r | j |  q q Wd j |  S(   s2   
    Sirve para cortar texto en varias lineas
    t    t    is   
(   t   splitt   lent   appendR   (   t   textt   lengtht   wordst   linest   linet   w(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   wrap*   s    	s   ../fonts/DejaVuSans.ttfs   ../../Topics/Topic_2/i    c         C   s   t  s] t j j |  d  } t j t |   } x | D] } t  j |  q7 Wt t   a	 n  t
 j d t t   d  } t  | d } t  | d } t j j |  d | d  } t  j |  | | f S(   Ns   vocabulario.csvi    i   t   termt   idt   Imageness   .png(   t   VOCABULARIOR    R   R   t   csvt
   DictReadert   fileR
   R	   t   CANT_PALABRASt   randomt   randintt   pop(   t	   topic_dirR   t   tablat   lineat   indicet   palabrat   uidt   palabra_png(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   obtener_palabra@   s    c           C   s   g  a  d a d  S(   Ni    (   R   R   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   reset_vocabularioT   s    t   DelayAnimationc           B   s#   e  Z d  Z d d  Z d   Z RS(   s   
    Animation which performs no actions. Useful for lining up appended
    and parallel animations so that things run at the right times.
    g      ?c         C   s.   t  |  _ t g   |  _ | |  _ t  |  _ d  S(   N(   t   Falset   absolutet   sett
   propertiest   durationt   loop(   t   selfR+   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   __init__`   s    		c         C   s   i  S(   N(    (   R-   t   spritet   progress(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   evaluatef   s    (   t   __name__t
   __module__t   __doc__R.   R1   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR&   [   s   t   Escenac           B   s8   e  Z e d   Z d   Z d   Z d   Z d   Z RS(   c         C   s  t  j j |  t  | |  _ d d d d g |  _ t  j d t d   j |  j	 j
  |  _ |  j j   |  _ d |  _ t j j |  j j  } | j d  |  j j j | d  |  j |  _ t |   |  _ t |   |  _ t |  |  |  _ t |   |  _ t |   |  _ t  j  j! d
 t  j" j# d |  t  j  j! d |  j j$ d |  t  j  j! d |  j%  t  j  j! d |  j& d |  t  j  j! d |  j'  d  S(   Nt   abajot   abajo2t   arribat   primert   filenames$   images/Peru_Machu_Picchu_Sunrise.jpgi    i   i   s   system.quitt   scenes   director.scene.enters   input.keyboard.down.escs   Tablero.score(   i   i    i    i   (   i    i    ((   t   spyralt   SceneR.   t   SIZEt   topict   layerst   ImageR   t   scaleR;   t   sizet   img_origt   copyt   imgt   puntajet   pygamet   Surfacet   convert_alphat   _surft   fillt   blitt
   backgroundt   Jugadort   jt   Lluviat   lt   Tablerot   tablerot   Terrazat   terrazat   Visualizadort   vt   eventt   registert   directorR   t   llovert   start_musict   endgamet   score(   R-   R?   t   n(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR.   k   s*    		c         C   s    t  j s t j j j   n  d  S(   N(   t   Introt   MUTERH   t   mixert   musict   play(   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR]      s    	c         C   s   |  j  j d |  j  j |  _ |  j t d k rY |  j j j d t  |  j j	 j
   n  y t j j |  j  Wn t k
 r n Xd  S(   Nid   t   ganamos(   RT   t   ganadast   perdidasRG   R   R;   RR   t	   finalizart   TrueRX   t   stop_all_animationsRa   t   gameviewt   update_scoret   AttributeError(   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR_      s    c         C   s   t  |  j j _ |  j j j   |  j j j   |  j j j d  |  j j j   |  j j j	   t
 j j d |  j  t |  d |  j  |  _ t
 j j d |  j j  d  S(   Ns	   GAME OVERs   input.keyboard.down.escs   Play again?s   input.keyboard.down.*(   R'   R;   RT   t   visibleRR   Rk   RX   t   set_textRP   t
   set_mirameR<   RY   t
   unregisterR^   t   Dialogot   the_question_clickt   the_questiont   procesar_tecla(   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR^      s    c         C   s&   |  j  j |  r" |  j  j   n  d  S(   N(   Ru   t   collide_pointt   goplay(   R-   t   pos(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRt      s    (   R2   R3   R   R.   R]   R_   R^   Rt   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR5   j   s
    		
	RU   c           B   s   e  Z d    Z d   Z RS(   c         C   s]   t  j j |  |  d |  _ d |  _ t  j d t d   |  _ | j d | j	 f |  _
 d  S(   Nt	   midbottomR6   R:   s   images/terraza.pngi   (   R<   t   SpriteR.   t   anchort   layerRA   R   t   imaget   widtht   heightRy   (   R-   R;   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR.      s
    		c         C   sG   t  j d t  j j d d d g d  d d |  j } |  j |  d  S(   Nt   xii    i   i   i   t   shift(   R<   t	   Animationt   easingt   IterateR   t   animate(   R-   t   m(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   temblar   s    $(   R2   R3   R.   R   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRU      s   		RS   c           B   sD   e  Z e d   Z d   Z d   Z d d  Z d   Z d   Z	 RS(   c         C   ss  t  j j |  |  t |  _ d |  _ d |  _ d |  _ d |  _ t  j	 j
 d  | |  _ t d  } t  j | d d  |  _ t |  j  \ |  _ |  _ |  j |  _ |  j j d  |  _ d |  _ |  j j d |  _ |  j j d	 |  _ |  j |  j d  t  j	 j d
 |  j d |  j t  j	 j d |  j d |  j t j  j! t d   |  _" t j  j! t d   |  _# d  S(   NR   R6   i    s   Tablero.scores   ../fonts/DejaVuSans.ttfi<   Rz   i   i   s   input.keyboard.down.*R;   s   Tablero.reset.animation.ends   sonidos/Randomize3.oggs   sonidos/Pickup_Coin.ogg(   i    i    i    ($   R<   R{   R.   R'   t   completot	   acertadasR}   Rg   Rh   RY   t   queueR?   R   t   Fontt   fontR$   R!   t   archivo_imgR   t   renderR~   R|   R;   R   R   R   t   yt   mostrarRZ   Rv   t   resetRH   Rc   t   Soundt   blup_sndt   hit_snd(   R-   R;   R?   t	   font_path(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR.      s*    							c         C   s   t  j j d  |  j d |  _ |  j |  _ x1 |  j |  j k r_ t |  j  \ |  _ |  _ q/ W|  j |  _	 d |  _
 |  j |  j |  j
  |  j j j   |  j j j   t  j j d |  j d |  j d  S(   Ns   Tablero.scorei   R   s   input.keyboard.down.*R;   (   R<   RY   R   Rg   R!   t   palabra_anteriorR$   R?   R   R   R   R   R;   RR   R   RX   RZ   Rv   (   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR      s    	c         C   s"   |  j  j |  |  _ | |  _ d  S(   N(   R   R   R~   R   (   R-   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRp      s    c         C   s}   d } d } x? | D]7 } | | k r@ | d | } | d } q | d } q W| t  |  k rl t |  _ n  |  j |  d  S(   Ni    R   R   i   u    _(   R	   Rj   R   Rp   (   R-   t   fraseR   t   letrat   totalt   estado(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR      s    c         C   s+   x$ |  j  D] } | |  j k r
 t Sq
 Wt S(   N(   R!   R   R'   Rj   (   R-   t   c(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   check_completos  s    c         C   sr  d | k  o d k  n s  d  St  |  } | |  j k rN |  j | |  _ n  | |  j k ry t j s |  j j   q n8 |  j d 7_ t j	 j
 d  t j s |  j j   n  |  j |  j |  j  |  j   rnt j	 j d |  j  |  j j j   |  j j j   |  j j j |  j j j d t  } |  j j j | d  t | d  } d | _ |  j |  n  d  S(	   Ni    i   i   s   Tablero.scores   input.keyboard.down.*i   i   R   (   t   chrR   R!   Ra   Rb   R   Re   Rh   R<   RY   R   R   R   R   Rr   Rv   R;   RR   Rk   RP   t   set_caminar_xR   Rj   t   explotarR&   t   propertyR   (   R-   t   keyt	   respuestat   tiempot   d(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRv   	  s.    			%	N(
   R2   R3   R   R.   R   Rp   t   NoneR   R   Rv   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRS      s    			RQ   c           B   sD   e  Z d    Z d   Z d   Z e d  Z d d  Z d   Z RS(   c         C   s  t  j j |  |  t  j t d d  |  _ d |  _ | j d t j	 d d  d |  _
 d |  _ t  j j   |  _ g  |  _ g  |  _ x t d d	  D] } t |  j d  } d
 | d } |  j j t  j d t d |    t | d  d d k r|  j j t  j d d   q |  j j t  j d t d |    q Wt  j d t  j j |  j d  d d t } |  j |  t  j d t d   |  _ g  |  _ d } |  j j |  j j   j  d | d f | | f   xL t d d  D]; } |  j j |  j j   j  | | d f | | f   qWt  j! j" d |  j# d |  j$ t  j! j" d |  j%  d |  _& t' j( j) t d   |  _* t' j( j) t d   |  _+ d  S(   Ni   i   t   centeri   i    i,  i   R9   i<   s   Asteroid-A-10-s   .pngR:   s   images/asteroid/i   RC   iK   R~   i   i   R,   s   images/explosion.pngi   i   s   Lluvia.y.animation.endR;   s   Lluvia.demora.animation.ends   sonidos/Explosion.oggs   sonidos/missile_alarm.ogg(   i   i   i   (   iK   iK   (,   R<   R{   R.   R   R   R   R|   R   R   R   R   R}   R[   t   get_tickt
   start_timet   asteroid_framest   target_framest   ranget   strt   zfillR
   RA   R   t   intR   R   R   Rj   R   t   explosion_fullt   explosion_framesRE   t   cropRY   RZ   Ri   R;   t   sonar_explosionRB   RH   Rc   R   t   explotar_sndt	   alarm_snd(   R-   R;   t   it   numbert   nameR   t   explosion_size(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR.   ,  sH    	$								c         C   s   |  j  j d t j d d  d |  _ |  j   |  j   |  j   t j d t j j	 |  j
 d  d d t } |  j |  |  j   d  S(	   Ni   i    iX  i,  R~   i   i   R,   (   R;   R   R   R   R   Rk   R<   R   R   R   R   Rj   R   R\   (   R-   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR   a  s    '


c         C   s   t  j s |  j j   n  t j j   |  j d } | d k rH d } n  t j d t j	 j
 d |  j j d  d d } |  j |  d  S(   Ng     r@i   R   i    iK   R+   i
   (   Ra   Rb   R   Re   R<   R[   R   R   R   R   t   CubicInR;   R   R   (   R-   t   tickt   p(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR\   k  s    				c         C   s)  |  j  j j   s%t j j d |  j  j j  |  j  j j d t |  j  j	   | s |  j  j
 j d  |  j   |  j  j j   |  j  j j   |  j  j   q%|  j  j |  j  _ |  j   |  j   t j j d |  j  t j j d |  j  t |  _ |  j  j
 j d  |  j  j j   n  d  S(   Ns   input.keyboard.down.*s   SCORE: s	   GAME OVERs   Lluvia.y.animation.ends   Lluvia.demora.animation.ends   YOU WIN!(   R;   RT   R   R<   RY   Rr   Rv   Rp   R   RG   RX   R   RV   R   RP   t   set_caerR^   RD   RN   Rk   Ri   R   R'   Ro   Rq   (   R-   Rf   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRi   w  s$    #


	i    c         C   s   t  j d t  j j |  j d  d  } | rn t  j d t  j j |  j | d  |  } | | } d | _ n  |  j   |  j |  t	 |  } d | _ |  j |  d  S(   NR~   i   i   g      @t   tictact   demora(
   R<   R   R   R   R   R   R   Rk   R   R&   (   R-   t   waitR`   R   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR     s    

	c         C   s   t  j s |  j j   n  d  S(   N(   Ra   Rb   R   Re   (   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR     s    	(	   R2   R3   R.   R   R\   R'   Ri   R   R   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRQ   *  s   	5	
	RW   c           B   s>   e  Z d    Z d   Z d d e d  Z d   Z d   Z RS(   c         C   sr   t  j j |  |  t  j t d   |  _ d |  _ t  j t d d  |  _	 |  j	 j
 |  _ d |  _ |  j   d  S(   Ns   images/golden-border.pngR6   i   i    i2   (   i    i    i    (   R<   R{   R.   RA   R   R~   R}   R   R   R   t   linesizet   line_heightt   margenR   (   R-   R;   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR.     s    		c         C   s   t  j d |  j |  j |  j |  j f  j d  } |  j j | d |  j d d f d d |  j j |  j |  d d	 d d d  S(
   NRC   i   t   positioni   i    R|   t   midleft(   i   i   i   (   i    i    (	   R<   RA   R   R   R   RL   R~   t
   draw_imaget   render_text(   R-   R   t   nueva(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRp     s    c         C   s  |  j    | s d |  _ n	 | |  _ | s y |  j j j |  _ Wq t k
 r t j d |  j	 |  j
 |  j |  j
 f  j d  |  _ q Xn	 | |  _ |  j j   } | j |  j |  j  d d d d |  j j   } t j d |  j	 |  j
 |  j |  j
 f  j d  } | j | d |  j
 d	 d f d d | j |  j |  j  d d d d t j d
 t j j | | g d  d d | } |  j |  d  S(   Ns   Please type the wordRC   i   R   i   i    R|   R   i   R~   i   R,   (   i   i   i   (   i   i    (   i   i   i   (   i    i    (   Rk   R   R;   RT   R   R#   Rn   R<   RA   R   R   R   RL   R~   RE   R   t   render_imageR   R   R   R   R   (   R-   t   txtRF   R,   t   image1t   image2R   t   a(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR     s.    
	)	0c         C   s   y9 t  j d |  j |  j |  j |  j |  j f  } WnI t j k
 r t  j d |  j |  j |  j |  j f  j d  } n X| S(   NR:   RC   i   (   i   i   i   (	   R<   RA   RB   R   R   R   RH   t   errorRL   (   R-   R~   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR     s    '#c   	      C   s   |  j  j d  d } |  j d |  j | } t | |  j   } t |  |  j } t j	 d |  j | f  } d } xM | D]E } | j
 d |  j  j |  d d | |  j f d d  | d	 } q~ W| S(
   Nt   Xi    i   RC   R~   R   R|   t   midtopi   (   R   t   get_sizeR   R   R   t
   splitlinesR	   R   R<   RA   R   R   (	   R-   R   t   ancho_promediot
   caracterest   lineast   alturat   bloquet   lnR   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR     s    N(	   R2   R3   R.   Rp   R   R'   R   R   R   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRW     s
   		 		RO   c           B   sV   e  Z d    Z d   Z d   Z d   Z d   Z d   Z e d  Z	 e d  Z
 RS(   c         C   sI  t  j j |  |  t  j d t d   |  _ d |  _ | j d |  _ | j	 d |  _
 d |  _ d |  _ d |  _ |  j j   j d	 d f t  |  _ |  j j   j d	 d f t  |  _ g  |  _ xF t d	 d
  D]5 } |  j j |  j j   j | d d f t   q Wg  |  _ xF t d	 d
  D]5 } |  j j |  j j   j | d d f t   q%Wg  |  _ xF t d	 d
  D]5 } |  j j |  j j   j | d d f t   qwWg  |  _ xF t d	 d
  D]5 } |  j j |  j j   j | d d f t   qWg  |  _ xF t d	 d  D]5 } |  j j |  j j   j | d d f t   qWg  |  _ xF t d	 d  D]5 } |  j j |  j j   j | d d f t   qmW|  j j |  j j   j d d f t   xR t t t d	 d    D]5 } |  j j |  j j   j | d d f t   qW|  j |  _ |  j   d |  _ d  S(   NR:   s   images/user2.pngt   nuevoi   i   iZ   R   R9   i    i   i@   i
   i   i	   i   i   i   i   i   i  i  i@  i  i   i    i   i@  i   i   (    R<   R{   R.   RA   R   t
   full_imageR   R   R   R   R   t	   velocidadR|   R}   RE   R   t   TILEt   northqt   southqt   eastR   R
   t   westt   southt   northt   firet   caert   reversedt   listt   quietot
   set_quietoRB   (   R-   R;   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR.     sT    				$$		*		*		*		*		*		*	""	*
c         C   s   |  j    |  j   d  S(   N(   Rk   R   (   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   frenar*  s    
c         C   s   d |  _  |  j |  _ d  S(   NR   (   R   R   R~   (   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR   .  s    	c         C   s   d |  _  |  j |  _ d  S(   Nt   mirando(   R   R   R~   (   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRq   2  s    	c         C   sB   |  j    t j d t j j |  j d  d  } |  j |  d  S(   NR~   i   i   (   Rk   R<   R   R   R   R   R   (   R-   t   z(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR   6  s    
'c      	   C   s   |  j  d k r |  j   n  d } |  j |  j } t j |  } | j d  t j d t j	 j
 |  d | d t } t j d t j	 j d  d	 |  j j d
 d | d t } | | @} d | _ d |  _  y |  j |  Wn t k
 r n Xd  S(   Nt	   caminandoi   iR~   R+   R,   R   id   R   i   t	   deambular(   R   (   R   Rk   R   R   t   collectionst   dequet   rotateR<   R   R   R   Rj   t   SineR;   R   R   R   t
   ValueError(   R-   R   t   framesR   t   bR   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   set_deambular;  s     	!:
		c         C   s  |  j  d k r |  j   n  |  j j | |  j f  } | |  j } |  j | k  r_ |  j } n	 |  j } t	 j
 d t	 j j | |  |  } t	 j
 d t	 j j |  j |  |  } t	 j
 d t	 j j |  j g d  d  } | | @}	 |	 | }	 | r+t	 j
 d t	 j j |  j d  d  }
 |	 |
 }	 n  d |	 _ y |  j |	  Wn= t k
 rd GHd G|  j GHd G| GHd	 G| GHd
 Gt GHn Xd |  _  | S(   NR   R~   R   g?i   t   traslados   ZERODIVISIONERROR!!!!s   self.xR   t   duracion(   s	   caminando(   R   Rk   Ry   t   distanceR   R   R   R   R   R<   R   R   R   t   LinearR   R   R   R   t   ZeroDivisionErrorR   (   R-   R   t   disparart	   distanciaR   t	   direccionR   R   R   R   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR   S  s:    		'	!

					c         C   sf  |  j  d k r |  j   n  |  j j | |  j f  } | |  j } |  j | k  rk |  j } |  j |  _	 n |  j
 } |  j |  _	 t j d t j j | |  |  } t j d t j j |  j |  |  } t j d t j j |  j	 g d  d  } | | @}	 |	 | }	 | rCt j d t j j |  j d  d  }
 |	 |
 }	 n  d |	 _ |  j |	  d |  _  | S(   NR   R~   R   g?i   R   (   s	   caminando(   R   Rk   Ry   R   R   R   R   R   R   R   R   R   R<   R   R   R   R   R   R   R   (   R-   R   R   R   R   R   R   R   R   R   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   set_caminar_yw  s0    			'	!

			(   R2   R3   R.   R   R   Rq   R   R   R'   R   R   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRO     s   	8					$Rs   c           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s  t  j j |  |  d |  _ t  j | j  d |  _ d |  _ d |  _ t  j	 d t
 d   |  _ t
 d  } t  j | d d  |  _ |  j j |  _ |  j |  } |  j j | d
 |  j d d f d d t  j j d |  t  j j d |  j  t  j j d |  j  d  S(   NR   i   i   R9   R:   s   images/Menu_1.pngs   ../fonts/DejaVuSans.ttfi   i    R   iR|   R   s   input.mouse.down.lefts   input.keyboard.down.returns   input.keyboard.down.y(   i    i    i    (   R<   R{   R.   R|   t   Vec2DRC   Ry   R   R}   RA   R   R~   R   R   R   R   Rp   R   RY   RZ   Rx   (   R-   R;   t   textot   callbackR   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR.     s    			c         C   sF   t  j j j d  t j j t |  j j	   t j j
 d t  d  S(   Ni   t   sugar(   RH   Rc   Rd   t   fadeoutR<   R[   t   replaceR5   R;   R?   t   runRj   (   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRx     s    c   	      C   s   | |  _  |  j j d  d } |  j d |  j | } t | |  j   } t |  |  j } t	 j
 d |  j | f  } d } xM | D]E } | j d |  j j |  d d | |  j f d d  | d	 } q Wd |  _ | S(
   NR   i    i   RC   R~   R   R|   R   i   (   t   _textR   R   R   R   R   R   R	   R   R<   RA   R   R   RB   (	   R-   R   R   R   R   R   R   R   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRp     s    		(   R2   R3   R.   Rx   Rp   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRs     s   		t   Textoc           B   s   e  Z d    Z d   Z RS(   c         C   s   t  j j |  |  d |  _ t  j | j  d |  _ d |  _ d |  _ t  j	 d t
 d   |  _ t
 d  } t  j | d d  |  _ |  j j |  _ |  j |  } |  j j | d
 |  j d d	 f d d d |  _ d  S(   NR   i   i   R9   R:   s   images/Menu_2.pngs   ../fonts/DejaVuSans.ttfi   i    R   R|   R   g?(   i    i    i    (   R<   R{   R.   R|   R   RC   Ry   R   R}   RA   R   R~   R   R   R   R   Rp   R   RB   (   R-   R;   R   R   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR.     s    			c   	      C   s   | |  _  |  j j d  d } |  j d |  j | } t | |  j   } t |  |  j } t	 j
 d |  j | f  } d } xM | D]E } | j d |  j j |  d d | |  j f d d  | d	 } q W| S(
   NR   i    i   RC   R~   R   R|   R   i   (   R  R   R   R   R   R   R   R	   R   R<   RA   R   R   (	   R-   R   R   R   R   R   R   R   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRp     s    	(   R2   R3   R.   Rp   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR    s   	t   Caminoc           B   s   e  Z d    Z d   Z RS(   c         C   s`   t  j j |  |  d |  _ d |  _ t  j d t d   |  _ t  j |  j	 j
  d |  _ d  S(   NRz   R7   R:   s   images/entrada.pngi   (   R<   R{   R.   R|   R}   RA   R   R~   R   R;   RC   Ry   (   R-   R;   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR.     s
    		c         C   sG   t  j d t  j j d d d g d  d d |  j } |  j |  d  S(   NR   ii    i   i   i   R   (   R<   R   R   R   R   R   (   R-   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR      s    $(   R2   R3   R.   R   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR    s   		Ra   c           B   sk   e  Z e Z e Z e e d   Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z d   Z RS(	   c         C   s1  t  j j |  t  t   | a | |  _ d d d d g |  _ t  j d t	 d   j
 |  j j  } | |  _ t |   |  _ d |  j _ t |   |  _ t  j j d t  j j d	 |  t  j j d
 |  j d	 |  t  j j d |  j d	 |  t j j j t	 d   t j j j d  | r-| t _ n  d  S(   NR6   R7   R8   R9   R:   s$   images/Peru_Machu_Picchu_Sunrise.jpgi    s   system.quitR;   s   input.keyboard.down.spaces   director.scene.enters   musica/alienblues.oggi(    R<   R=   R.   R>   R%   R   R?   R@   RA   R   RB   R;   RC   RN   R  t   caminoR   RU   RV   RY   RZ   R[   R   Rx   t   intro0RH   Rc   Rd   t   loadRe   Ra   Rl   (   R-   R?   Rl   RF   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR.     s$    		c         C   s<   | t  k r t j j j   n t j j j   | t _ d  S(   N(   Rj   RH   Rc   Rd   t   pauseRe   Ra   Rb   (   R-   t   value(    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   mute(  s    c         C   sC   t  j j j d  t j j t |  j   t j j	 d t
  d  S(   Ni   R  (   RH   Rc   Rd   R  R<   R[   R  R5   R?   R  Rj   (   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRx   0  s    c         C   sc   t  j d t  j j |  j j |  j j  d d } |  j j |  t  j	 j
 d |  j d |  d  S(   NR   R+   i   s   Camino.y.animation.endR;   (   R<   R   R   R   R	  R   R;   R   R   RY   RZ   t   intro1(   R-   R   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR
  5  s    3c         C   s   t  j j d |  j  t |   |  _ |  j d |  j _ d |  j _ |  j j	   t
 |  d  |  _ d |  j _ d |  j _ |  j j |  j j d  t  j j d |  j d |  d  S(	   Ns   Camino.y.animation.endi   is   Hello children of Perui_   is   s   Jugador.traslado.animation.endR;   (   R<   RY   Rr   R  RO   RP   R   R   R   Rq   R  t   mensajeR   R;   R   RZ   t   intro2(   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR  ;  s    c         C   s   t  j j d |  j  |  j j   t |  d  |  _ |  j d d |  j _ t	 d  |  _
 d |  j
 _ |  j j |  j
  t  j j d |  j d |  d  S(	   Ns   Jugador.traslado.animation.ends   There is no time to explaini   iF   i   R   s   Jugador.demora.animation.endR;   (   R<   RY   Rr   R  R  t   killR  R   R   R&   R   R   RP   R   RZ   t   intro3(   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR  I  s    c         C   sV   t  j j d |  j  |  j j |  j j |  j j  t  j j d |  j	 d |  d  S(   Ns   Jugador.demora.animation.ends   Jugador.traslado.animation.endR;   (
   R<   RY   Rr   R  RP   R   R;   R   RZ   t   intro4(   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR  U  s     c         C   s   t  j j d |  j  |  j j   t |  d  |  _ |  j d |  j _ t	 d  |  _
 d |  j
 _ |  j j |  j
  t  j j d |  j d |  d  S(   Ns   Jugador.traslado.animation.ends   An asteroid is coming!i   i   R   s   Jugador.demora.animation.endR;   (   R<   RY   Rr   R  R  R  R  R   R   R&   R   R   RP   R   RZ   t   intro5(   R-   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR  Z  s    c         C   s   t  j j d |  j  t  j d t  j j |  j j d  d d } |  j	 j
 |  t  j d t d   j |  j j  } t |   |  _ |  j j d d	 t t j j | j  } | j d  | j j | d  | |  j _ |  j j   d  S(   Ns   Jugador.demora.animation.endR   i    R+   i   R:   s$   images/Peru_Machu_Picchu_Sunrise.jpgs   Press space to begin.R,   i   i   (   i   i    i    i   (   i    i    (   R<   RY   Rr   R  R   R   R   R;   R   R	  R   RA   R   RB   RC   RW   RX   R   Rj   RH   RI   RJ   RK   RL   RM   RN   RP   R   (   R-   R   RF   R`   (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyR  f  s    -(   R2   R3   R'   Rb   Rl   R   R.   R  Rx   R
  R  R  R  R  R  (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyRa     s   							c           C   s   t  j j t    d  S(   N(   R<   R[   t   pushRa   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   mainz  s    t   __main__t
   fullscreen(   i  i  (   i@   i@   (,   t   sysR    R   t   abspatht   dirnamet   __file__R   R   t   insertRH   Rc   t   initR<   R   R   R   R>   R   R   R   R   R   R   R$   R%   R   R&   R=   R5   R{   RU   RS   RQ   RW   RO   Rs   R  R  Ra   R  R2   R[   R'   R  (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Games/ug1/runme.pyt   <module>   sH   			FiwO3*t	