Código:
;---------------------------------------------------------------------------------------------------------------------
-Pacman by manufer--------------------------------------------------------------------------
Graphics 800,600,16,2.
Setbuffer backbuffer().
Creando un timer----
Frametimer=createtimer(60).
Carga de gráficos---
Logotipo=loadimage (GFX/logotipo, bmp).
Pantalla=loadimage (GFX/pantalla, bmp).
Maskimage pantalla,0,0,0.
Pacman=loadanimimage (GFX/sprites, bmp,32,32,0,32).
Maskimage Pacman,0,0,0.
Bola=loadimage (GFX/bola, bmp).
Maskimage bola,0,0,0.
Gran_bola=loadimage (GFX/gran_bola, bmp).
Maskimage gran_bola,0,0,0.
Nullimage=loadimage (GFX/null, bmp).
Frutas=loadanimimage (GFX/frutas, bmp,32,32,0,16).
Maskimage frutas,0,0,0.
Maskimage nullimage,255,255,255.
Shadow=loadanimimage (GFX/fantasma, bmp,32,32,0,4, rojo.
Maskimage shadow,0,0,0.
Spedy=loadanimimage (GFX/fantasma, bmp,32,32,0,4, rosa.
Maskimage speedy,0,0,0.
Bashful=loadanimimage (GFX/fantasma, bmp,32,32,0,4, azul.
Maskimage bashful,0,0,0.
Pokey=loadanimimage (GFX/fantasma, bmp,32,32,0,4, amarillo.
Maskimage pokey,0,0,0.
Color 250,250,250.
Carga de sonidos---
Andar=loadsound(sonidos/andando.wav).
Lopsound andar.
Dead=loadsound(sonidos/pacman_dead.wav).
Come_fruta=loadsound(sonidos/come_fruta.wav).
Pip=loadsound(sonidos/pacman_pip.wav).
Newlevel=loadsound(sonidos/comienza_nivel.wav).
Come=loadsound(sonidos/come_bola.wav).
Soundvolume come.5.
Azules=loadsound(sonidos/fantasmas_azules, wav).
Soundvolume azules.5.
Lopsound azules.
Azules2=loadsound(sonidos/fantasmas_azules2.wav).
Lopsound azules2.
Declaración de variables---
Skipframe1=0.
Frame_pacman=2.
Velocidad#=1.
Temp_velocidad#=0.
Xpacman#=0.
Ypacman#=0.
Dirección_pacman=4.
Pacman_status=1 ; 0=muerto, 1=vivo.
Level#=0.
Vidas=3.
Total_bolas=244.
Status_fantasma=1.
Contador_fantasmas#=0.
Dim status_fantasmas(4).
Puntos=0.
Dim bolas(460).
Dim granbolas(4).
Dim eyes(4).
Record=0.
Dim posx(10).
Posx(1)=192 : posx(2)=228 : posx(3)=280 : posx(4)=333 : posx(5)=385 : posx(6)=438 : posx(7)=490 : posx(=542.
Posx(9)=595 : posx(10)=628.
Dim Posy(10).
Posy(10)=519 : Posy(9)=465 : Posy(=410 : Posy(7)=357 : Posy(6)=302 : Posy(5)=248 : Posy(4)=192 : Posy(3)=139.
Posy(2)=86 : Posy(1)=12.
Sedrnd millisecs().
Flash=0.
Tips-------
Dim tip$(30).
Consejo=Rand(10).
Tip(1)=shadow (rojo) es el fantasma más rápido, si lo llevas pegado te costara deshacerte de él.
Tip(2)=speedy (rosa) es el más listo de todos, buscara hacerte una emboscada.
Tip(3)=bashful (cyan) es el más lento, pero no lo subestimes.
Tip(4)=pokey (naranja) es el tonto del grupo, incluso a veces tomara caminos evasivos.
Tip(5)=cuando Pacman come bolas, su velocidad se ve reducida, toma caminos despejados para escapar de los fantasmas.
Tip(6)=los carriles de teletrasnportación reducen la velocidad de los fantasmas, si los usas los dejaras atrás.
Tip(7)=la zona inferior de la pantalla es la más peligrosa, puedes caer en una emboscada fácilmente.
Tip(=a los 10.000 puntos conseguirás una vida extra.
Tip(9)=las bolas pequeñas dan 10 puntos, las grandes 50 puntos, además de convertir los fantasmas en comestibles.
Tip(10)=el tiempo que los fantasmas están de color azul, se irá acortando conforme pases niveles.
Tip(11)=las frutas que salen en el centro de la pantalla dan suculosos puntos, podrás comer 2 por nivel, pero si pierdes una vida mientras la fruta esta activa la perderas.
Tip(12)=cuando comas un fantasma cerca de su casa, ten mucho cuidado ya que se regenerara muy pronto y podrá darte caza.
Tip(13)=cada nivel aumentara el ritmo de juego, siendo extremadamente desafiante a partir del nivel 8.
Tip(14)=el nombre original en Japón que es donde salió el juego, es puck-man, pero debido a su similitud con fuck-man lo cambiaron por pac-man.
Tip(15)=el juego fue lanzado el 21 de mayo de 1980 y se vendieron 293.822 unidades, desbancando a space Invaders que hasta entonces era el rey de los salones recreativos.
Tip(16)=en el juego original, la ultima pantalla jugable es la 255, por un error de programación no contemplaron la posibilidad de pasar tantas pantallas y el byte encargado se desborda provocando errores gráficos.
Dim nivel_jugador$(11).
Nivel_jugador(1)=pringado del Pacman;hasta 2000.
Nivel_jugador(2)=jugador mediocre;hasta 5000.
Nivel_jugador(3)=aficionado;hasta 8000.
Nivel_jugador(4)=el típico jugador medio;hasta 12000.
Nivel_jugador(5)=espabilado en el Pacman;hasta 14000.
Nivel_jugador(6)=mareador de fantasmas;hasta 18000.
Nivel_jugador(7)=tragabolas avanzado;hasta 22000.
Nivel_jugador(=chuleando a esos fantasmas.;hasta 25000.
Nivel_jugador(9)=el crack del Pacman;hasta 30000.
Nivel_jugador(10)=el amo ;hasta 50000.
Nivel_jugador(11)=dios del Pacman.
Nivel_jugador_actual$=
--fantasmas-.
X_shadow#=posx(5) : y_shadow#=Posy(4) : frame_shadow=1 : velocidad_shadow#=1.2 :temp_velocidad_shadow#=0: dirección_shadow=4.
X_spedy#=posx(5) : y_spedy#=Posy(4) : frame_spedy=1 : velocidad_spedy#=1.1 :temp_velocidad_spedy#=0: dirección_spedy=1.
X_bashful#=posx(5) : y_bashful#=Posy(4) : frame_bashful=1 : velocidad_bashful#=1.1 :temp_velocidad_bashful#=0: dirección_bashful=1.
X_pokey#=posx(5) : y_pokey#=Posy(4) : frame_pokey=1 : velocidad_pokey#=1.1 :temp_velocidad_pokey#=0: dirección_pokey=1.
Filein=openfile (data, dat).
Record=readint(filein).
Closefile (filein).
Font20=loadfont(arcade normal,14,false,false,false).
Setfont font20.
Menu.
Menú----------------------------------------------------------------------------------------
Color 200,200,200.
X_pacman=1000.
X_text=600.
Dirección_pacman=4.
Dirección_spedy=4.
Dirección_shadow=4.
Dirección_bashful=4.
Dirección_pokey=4.
Vidas=3.
Vida_extra=0.
Puntos=0.
Level=0.
For a=1 todo 4.
Status_fantasmas(a)=1.
Next.
While not keydown(31).
Cls.
If keydown(1) then end.
X_text=x_text-2.
X_pacman=x_pacman-1.
If x_text<-1500 then x_text=1000 : consejo=Rand(10).
If x_pacman=-180 then x_pacman=800.
Skipframe1=skipframe1+1.
Skipframe_fantasma=skipframe_fantasma+1.
If Skipframe1>20 then Skipframe1=1.
If Skipframe_fantasma>30 then Skipframe_fantasma=0.
Contador=contador+1.
If contador>79 then contador=0.
If contador<50 then flash=1 else flash=0.
Gosub animación.
Nivel_jugador_actual=nivel_jugador(1).
If récord>5000 then nivel_jugador_actual=nivel_jugador(2).
If récord>7500 then nivel_jugador_actual=nivel_jugador(3).
If récord>9000 then nivel_jugador_actual=nivel_jugador(4).
If récord>12000 then nivel_jugador_actual=nivel_jugador(5).
If récord>14000 then nivel_jugador_actual=nivel_jugador(6).
If récord>18000 then nivel_jugador_actual=nivel_jugador(7).
If récord>22000 then nivel_jugador_actual=nivel_jugador(.
If récord>25000 then nivel_jugador_actual=nivel_jugador(9).
If récord>30000 then nivel_jugador_actual=nivel_jugador(10).
If récord>50000 then nivel_jugador_actual=nivel_jugador(11).
Drawimage logotipo,150,60.
Drawimage Pacman,x_pacman,250, frame_pacman.
Drawimage shadow,x_pacman+100,250, frame_shadow.
Drawimage speedy,x_pacman+125,250, frame_spedy.
Drawimage bashful,x_pacman+150,250, frame_bashful.
Drawimage pokey,x_pacman+175,250, frame_pokey.
Drawimage shadow,70,350, frame_shadow : text 130,360,shadow.
Drawimage speedy,70,390, frame_spedy : text 130,400,speedy.
Drawimage bashful,70,430, frame_bashful : text 130,440,bashful.
Drawimage pokey,70,470, frame_pokey : text 130,480,pokey.
Text 370,360,hi-score +récord.
Text 370,400, nivel_jugador_actual.
If flash=1 then text 270,200,pres s todo start.
Text 110,560,Manuel Fernández - Manuferhi@gmail. Com.
Text x_text,20, tip(consejo).
Waittimer(frametimer).
Flip.
Wend.
Newlevel.
Comienza el nivel (reset)------------------------------------------------------------------------
Stopchannel(andando).
Cls.
Stopchannel(fantasmas_azules).
Stopchannel(fantasmas_azules2).
Velocidad=1.3+level/10.
Velocidad_shadow=1.2+level/10.
Velocidad_spedy=1.15+level/10.
Velocidad_bashful=1.1+level/10.
Velocidad_pokey=1.1+level/10.
Contador_velocidad=50.
Level=level+1.
Total_bolas=244.
Fruta_level=level.
Fruta_activa=1.
Sedrnd millisecs().
For a=1 todo 460.
Bolas(a)=copyimage (bola), regénero las bolas pequeñas.
Next.
For a=1 todo 4.
Granbolas(a)=copyimage (gran_bola).
Next.
Playsound newlevel.
Drawimage pantalla,182,1,0.
Color 255,255,0 : text posx(5), Posy(6)+8,ready.
Flip.
Delay 3500.
If level=1 then fruta_level=1 :puntos_fruta=100.
If level=2 then fruta_level=2 :puntos_fruta=300.
If level=3 or level=4 then fruta_level=3 :puntos_fruta=500.
If level=5 or level=6 then fruta_level=4 :puntos_fruta=700.
If level=7 or level=8 then fruta_level=5 :puntos_fruta=1000.
If level=9 or level=10 then fruta_level=6 :puntos_fruta=2000.
If level=11 or level=12 then fruta_level=7 :puntos_fruta=3000.
If level=>13 then fruta_level=0 :puntos_fruta=5000.
Newlive.
Pacman_status=1.
Dirección_pacman=4.
Contador_fantasmas=0.
Status_fantasma=1.
Xpacman=posx(5)+26 : ypacman=Posy(;posición inicial Pacman.
X_shadow#=posx(5)+26 : y_shadow#=Posy(4) ;posición inicial shadow.
X_spedy#=posx(5)+26 : y_spedy#=Posy(5) ;posición inicial speedy.
X_bashful#=posx(5)-10 : y_bashful#=Posy(5) ;posición inicial bashful.
X_pokey#=posx(5)+62 : y_pokey#=Posy(5) ;posición inicial pokey.
Dirección_shadow=4.
Dirección_spedy=3.
Dirección_bashful=1.
Dirección_pokey=1.
Contador_fantasmas=0.
For n=1 todo 4.
Status_fantasmas(n)=1.
Eyes(n)=0.
Next.
Contador_fruta=0.
Stopchannel(fantasmas_azules).
Stopchannel(andando).
Andando=playsound(andar).
Comienza el bucle------------------------------------------------------------------------------------
While not keydown(1).
Waitkey.
Cls.
Contador_velocidad=contador_velocidad+1.
Velocidades.
If contador_velocidad<35 then temp_velocidad=velocidad*.9 else temp_velocidad=velocidad.
If temp_velocidad>2.5 then temp_velocidad=2.5.
If status_fantasmas(1)=1 then temp_velocidad_shadow=velocidad_shadow.
If status_fantasmas(1)=2 then temp_velocidad_shadow=velocidad_shadow*2.
If status_fantasmas(1)=0 then temp_velocidad_shadow=velocidad_shadow*.6.
If status_fantasmas(2)=1 then temp_velocidad_spedy=velocidad_spedy.
If status_fantasmas(2)=2 then temp_velocidad_spedy=velocidad_spedy*2.
If status_fantasmas(2)=0 then temp_velocidad_spedy=velocidad_spedy*.6.
If status_fantasmas(3)=1 then temp_velocidad_bashful=velocidad_bashful.
If status_fantasmas(3)=2 then temp_velocidad_bashful=velocidad_bashful*2.
If status_fantasmas(3)=0 then temp_velocidad_bashful=velocidad_bashful*.6.
If status_fantasmas(4)=1 then temp_velocidad_pokey=velocidad_pokey.
If status_fantasmas(4)=2 then temp_velocidad_pokey=velocidad_pokey*2.
If status_fantasmas(4)=0 then temp_velocidad_pokey=velocidad_pokey*.6.
If temp_velocidad_shadow>2.5 then temp_velocidad_shadow=2.5.
If temp_velocidad_spedy>2.5 then temp_velocidad_spedy=2.5.
If temp_velocidad_bashful>2.5 then temp_velocidad_bashful=2.5.
If temp_velocidad_pokey>2.5 then temp_velocidad_pokey=2.5.
If abs(x_shadow-posx(1))<40 and abs(y_shadow-Posy(5))<5 then temp_velocidad_shadow=temp_velocidad_shadow*.6.
If abs(x_spedy-posx(1))<40 and abs(y_spedy-Posy(5))<5 then temp_velocidad_spedy=temp_velocidad_spedy*.6.
If abs(x_bashful-posx(1))<40 and abs(y_bashful-Posy(5))<5 then temp_velocidad_bashful=temp_velocidad_bashful*.6.
If abs(x_pokey-posx(1))<40 and abs(y_pokey-Posy(5))<5 then temp_velocidad_pokey=temp_velocidad_pokey*.6.
If abs(x_shadow-posx(10))<40 and abs(y_shadow-Posy(5))<5 then temp_velocidad_shadow=temp_velocidad_shadow*.6.
If abs(x_spedy-posx(10))<40 and abs(y_spedy-Posy(5))<5 then temp_velocidad_spedy=temp_velocidad_spedy*.6.
If abs(x_bashful-posx(10))<40 and abs(y_bashful-Posy(5))<5 then temp_velocidad_bashful=temp_velocidad_bashful*.6.
If abs(x_pokey-posx(10))<40 and abs(y_pokey-Posy(5))<5 then temp_velocidad_pokey=temp_velocidad_pokey*.6.
Skipframe1=skipframe1+1.
Skipframe_fantasma=skipframe_fantasma+1.
If Skipframe1>20 then Skipframe1=1.
If Skipframe_fantasma>30 then Skipframe_fantasma=0.
Gosub animación.
If puntos>10000 and vida_extra=0 then vidas=vidas+1 : vida_extra=1.
If eyes(1)=0 and eyes(2)=0 and eyes(3)=0 and eyes(4)=0 then stopchannel(fantasmas_azules2).
Detección de colisiones.
Pacman_shadow=ImagesCollide (shadow,x_shadow, y_shadow,36, Pacman,xpacman, ypacman,14).
If pacman_shadow=1 and status_fantasmas(1)=1 then pacman_status=0.
If pacman_shadow=1 and status_fantasmas(1)=0 then.
Eyes(1)=1 : velocidad_eyes=3 : status_fantasmas(1)=2 :display_puntos_fantasmas=1.
Temp_x=xpacman : temp_y=ypacman.
Temp_frame=temp_frame+1.
If temp_frame=27 then puntos=puntos+200.
If temp_frame=28 then puntos=puntos+400.
If temp_frame=29 then puntos=puntos+800.
If temp_frame=30 then puntos=puntos+1600.
Stopchannel(fantasmas_azules2).
Fantasmas_azules2=playsound(azules2).
Playsound(come_fruta).
Endif.
Pacman_spedy=ImagesCollide (speedy,x_spedy, y_spedy,36, Pacman,xpacman, ypacman,14).
If pacman_spedy=1 and status_fantasmas(2)=1 then pacman_status=0.
If pacman_spedy=1 and status_fantasmas(2)=0 then.
Eyes(2)=1 : velocidad_eyes=3 : status_fantasmas(2)=2 :display_puntos_fantasmas=1.
Temp_x=xpacman : temp_y=ypacman.
Temp_frame=temp_frame+1.
If temp_frame=27 then puntos=puntos+200.
If temp_frame=28 then puntos=puntos+400.
If temp_frame=29 then puntos=puntos+800.
If temp_frame=30 then puntos=puntos+1600.
Stopchannel(fantasmas_azules2).
Fantasmas_azules2=playsound(azules2).
Playsound(come_fruta).
Endif.
Pacman_bashful=ImagesCollide (bashful,x_bashful, y_bashful,36, Pacman,xpacman, ypacman,14).
If pacman_bashful=1 and status_fantasmas(3)=1 then pacman_status=0.
If pacman_bashful=1 and status_fantasmas(3)=0 then.
Eyes(3)=1 : velocidad_eyes=3 : status_fantasmas(3)=2 :display_puntos_fantasmas=1.
Temp_x=xpacman : temp_y=ypacman.
Temp_frame=temp_frame+1.
If temp_frame=27 then puntos=puntos+200.
If temp_frame=28 then puntos=puntos+400.
If temp_frame=29 then puntos=puntos+800.
If temp_frame=30 then puntos=puntos+1600.
Stopchannel(fantasmas_azules2).
Fantasmas_azules2=playsound(azules2).
Playsound(come_fruta).
Endif.
Pacman_pokey=ImagesCollide (pokey,x_pokey, y_pokey,36, Pacman,xpacman, ypacman,14).
If pacman_pokey=1 and status_fantasmas(4)=1 then pacman_status=0.
If pacman_pokey=1 and status_fantasmas(4)=0 then.
Eyes(4)=1 : velocidad_eyes=3 : status_fantasmas(4)=2 :display_puntos_fantasmas=1.
Temp_x=xpacman : temp_y=ypacman.
Temp_frame=temp_frame+1.
If temp_frame=27 then puntos=puntos+200.
If temp_frame=28 then puntos=puntos+400.
If temp_frame=29 then puntos=puntos+800.
If temp_frame=30 then puntos=puntos+1600.
Stopchannel(fantasmas_azules2).
Fantasmas_azules2=playsound(azules2).
Playsound(come_fruta).
Endif.
If pacman_status=0 then stopchannel andando.
If status_fantasma=0 then contador_fantasmas=contador_fantasmas+velocidad.
If contador_fantasmas>800 then.
Contador_fantasmas=0.
For n=1 todo 4.
If eyes(n)=0 then status_fantasmas(n)=1.
Next.
Status_fantasma=1.
Stopchannel(andando) : stopchannel(fantasmas_azules) :andando=playsound(andar) topchannel(fantasmas_azules2).
Endif.
If contador_fruta>2000 then contador_fruta=0.
Contador_fruta=contador_fruta+velocidad.
If total_bolas=<0 then goto newlevel.
If display_puntos>0 then display_puntos=display_puntos+1.
If display_puntos>150 then display_puntos=0.
If display_puntos_fantasmas>0 then display_puntos_fantasmas=display_puntos_fantasmas+1.
If display_puntos_fantasmas>150 then display_puntos_fantasmas=0.
Detección de teclas---
-Horientación de los fantasmas.
Dirección_inversa_shadow=dirección_shadow+2.
Dirección_inversa_spedy=dirección_spedy+2.
Dirección_inversa_bashful=dirección_bashful+2.
Dirección_inversa_pokey=dirección_pokey+2.
If dirección_inversa_shadow>4 then dirección_inversa_shadow=dirección_inversa_shadow-4.
If dirección_inversa_spedy>4 then dirección_inversa_spedy=dirección_inversa_spedy-4.
If dirección_inversa_bashful>4 then dirección_inversa_bashful=dirección_inversa_bashful-4.
If dirección_inversa_pokey>4 then dirección_inversa_pokey=dirección_inversa_pokey-4.
If xpacman>x_shadow then.
If ypacman<y_shadow then horientación_shadow=5 else horientación_shadow=6.
Endif.
If xpacman>x_spedy then.
If ypacman<y_spedy then horientación_spedy=5 else horientación_spedy=6.
Endif.
If xpacman>x_bashful then.
If ypacman<y_bashful then horientación_bashful=5 else horientación_bashful=6.
Endif.
If xpacman>x_pokey then.
If ypacman<y_pokey then horientación_pokey=5 else horientación_pokey=6.
Endif.
If xpacman<x_shadow then.
If ypacman<y_shadow then horientación_shadow=8 else horientación_shadow=7.
Endif.
If xpacman<x_spedy then.
If ypacman<y_spedy then horientación_spedy=8 else horientación_spedy=7.
Endif.
If xpacman<x_bashful then.
If ypacman<y_bashful then horientación_bashful=8 else horientación_bashful=7.
Endif.
If xpacman<x_pokey then.
If ypacman<y_pokey then horientación_pokey=8 else horientación_pokey=7.
Endif.
If abs(xpacman-x_shadow)<4 then.
If ypacman<y_shadow then horientación_shadow=1 else horientación_shadow=3.
Endif.
If abs(xpacman-x_spedy)<4 then.
If ypacman<y_spedy then horientación_spedy=1 else horientación_spedy=3.
Endif.
If abs(xpacman-x_bashful)<4 then.
If ypacman<y_bashful then horientación_bashful=1 else horientación_bashful=3.
Endif.
If abs(xpacman-x_pokey)<4 then.
If ypacman<y_pokey then horientación_pokey=1 else horientación_pokey=3.
Endif.
If abs(ypacman-y_shadow)<4 then.
If xpacman<x_shadow then horientación_shadow=4 else horientación_shadow=2.
Endif.
If abs(ypacman-y_spedy)<4 then.
If xpacman<x_spedy then horientación_spedy=4 else horientación_spedy=2.
Endif.
If abs(ypacman-y_bashful)<4 then.
If xpacman<x_bashful then horientación_bashful=4 else horientación_bashful=2.
Endif.
If abs(ypacman-y_pokey)<4 then.
If xpacman<x_pokey then horientación_pokey=4 else horientación_pokey=2.
Endif.
If bloqueo>0 then bloqueo=bloqueo-1.
If bloqueo2>0 then bloqueo2=bloqueo2-1.
If bloqueo3>0 then bloqueo3=bloqueo3-1.
If bloqueo4>0 then bloqueo4=bloqueo4-1.
Ejes.
Casa de los fantasmas----
If sale_bashful<>1 then sale_bashful=Rand(80-level*.
If sale_bashful=1 then sale_pokey=Rand(80-level*.
If abs(x_bashful-posx(5)+10)<2 and abs(y_bashful-Posy(5)+15)<2 then.
Dirección_bashful=3.
Endif.
If abs(x_bashful-posx(5)+10)<2 and abs(y_bashful-Posy(5))<2 then.
If sale_bashful=1 then dirección_bashful=2.
Endif.
If abs(x_bashful-posx(5)+10)<2 and abs(y_bashful-Posy(5)-15)<2 then.
Dirección_bashful=1.
Endif.
If abs(x_pokey-posx(5)-62)<2 and abs(y_pokey-Posy(5)+15)<2 then.
Dirección_pokey=3.
Endif.
If abs(x_pokey-posx(5)-62)<2 and abs(y_pokey-Posy(5))<2 then.
If sale_pokey=1 then dirección_pokey=4.
Endif.
If abs(x_pokey-posx(5)-62)<2 and abs(y_pokey-Posy(5)-15)<2 then.
Dirección_pokey=1.
Endif.
Fila 1----------------------------------------------
If (abs(xpacman-posx(1))<2 or abs(xpacman-posx(6))<2) and (abs(ypacman-Posy(1))<2 or abs(ypacman-Posy(7))<2 or abs(ypacman-Posy(9))<2) then.
Dirección_pacman=0.
If keydown(205) then dirección_pacman=2.
If keydown(20 then dirección_pacman=3.
Endif.
If (abs(x_shadow-posx(1))<2 or abs(x_shadow-posx(6))<2) and (abs(y_shadow-Posy(1))<2 or abs(y_shadow-Posy(7))<2 or abs(y_shadow-Posy(9))<2) then.
If dirección_shadow=1 then dirección_shadow=2.
If dirección_shadow=4 then dirección_shadow=3.
Endif.
If (abs(x_spedy-posx(1))<2 or abs(x_spedy-posx(6))<2) and (abs(y_spedy-Posy(1))<2 or abs(y_spedy-Posy(7))<2 or abs(y_spedy-Posy(9))<2) then.
If dirección_spedy=1 then dirección_spedy=2.
If dirección_spedy=4 then dirección_spedy=3.
Endif.
If (abs(x_bashful-posx(1))<2 or abs(x_bashful-posx(6))<2) and (abs(y_bashful-Posy(1))<2 or abs(y_bashful-Posy(7))<2 or abs(y_bashful-Posy(9))<2) then.
If dirección_bashful=1 then dirección_bashful=2.
If dirección_bashful=4 then dirección_bashful=3.
Endif.
If (abs(x_pokey-posx(1))<2 or abs(x_pokey-posx(6))<2) and (abs(y_pokey-Posy(1))<2 or abs(y_pokey-Posy(7))<2 or abs(y_pokey-Posy(9))<2) then.
If dirección_pokey=1 then dirección_pokey=2.
If dirección_pokey=4 then dirección_pokey=3.
Endif.
If (abs(xpacman-posx(3))<2 or abs(xpacman-posx()<2) and abs(ypacman-Posy(1))<2 then.
If dirección_pacman=1 then dirección_pacman=0.
If keydown(205) then dirección_pacman=2.
If keydown(20 then dirección_pacman=3.
If keydown(203) then dirección_pacman=4.
Endif.
If (abs(x_shadow-posx(3))<2 or abs(x_shadow-posx()<2) and abs(y_shadow-Posy(1))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=7 then horientación_shadow=4.
If horientación_shadow=6 then.
If sorteo=1 then horientación_shadow=2 else horientación_shadow=3.
Endif.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If status_fantasmas(1)=0 then dirección_shadow=dirección_pacman.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(2,4).
While dirección_shadow=1 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=3.
Endif.
Endif.
If (abs(x_spedy-posx(3))<2 or abs(x_spedy-posx()<2) and abs(y_spedy-Posy(1))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=7 then horientación_spedy=4.
If horientación_spedy=6 then.
If sorteo=1 then horientación_spedy=2 else horientación_spedy=3.
Endif.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If status_fantasmas(2)=0 then dirección_spedy=dirección_pacman.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(2,4).
While dirección_spedy=1 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=3.
Endif.
Endif.
If (abs(x_bashful-posx(3))<2 or abs(x_bashful-posx()<2) and abs(y_bashful-Posy(1))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=7 then horientación_bashful=4.
If horientación_bashful=6 then.
If sorteo=1 then horientación_bashful=2 else horientación_bashful=3.
Endif.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If status_fantasmas(4)=0 then dirección_bashful=dirección_pacman.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(2,4).
While dirección_bashful=1 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=3.
Endif.
Endif.
If (abs(x_pokey-posx(3))<2 or abs(x_pokey-posx()<2) and abs(y_pokey-Posy(1))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=7 then horientación_pokey=4.
If horientación_pokey=6 then.
If sorteo=1 then horientación_pokey=2 else horientación_pokey=3.
Endif.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If status_fantasmas(4)=0 then dirección_pokey=dirección_pacman.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(2,4).
While dirección_pokey=1 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=3.
Endif.
Endif.
If (abs(xpacman-posx(5))<2 or abs(xpacman-posx(10))<2) and (abs(ypacman-Posy(1))<2 or abs(ypacman-Posy(7))<2 or abs(ypacman-Posy(9))<2) then.
Dirección_pacman=0.
If keydown(20 then dirección_pacman=3.
If keydown(203) then dirección_pacman=4.
Endif.
If (abs(x_shadow-posx(5))<2 or abs(x_shadow-posx(10))<2) and (abs(y_shadow-Posy(1))<2 or abs(y_shadow-Posy(7))<2 or abs(y_shadow-Posy(9))<2) then.
If dirección_shadow=2 then dirección_shadow=3.
If dirección_shadow=1 then dirección_shadow=4.
Endif.
If (abs(x_spedy-posx(5))<2 or abs(x_spedy-posx(10))<2) and (abs(y_spedy-Posy(1))<2 or abs(y_spedy-Posy(7))<2 or abs(y_spedy-Posy(9))<2) then.
If dirección_spedy=2 then dirección_spedy=3.
If dirección_spedy=1 then dirección_spedy=4.
Endif.
If (abs(x_bashful-posx(5))<2 or abs(x_bashful-posx(10))<2) and (abs(y_bashful-Posy(1))<2 or abs(y_bashful-Posy(7))<2 or abs(y_bashful-Posy(9))<2) then.
If dirección_bashful=2 then dirección_bashful=3.
If dirección_bashful=1 then dirección_bashful=4.
Endif.
If (abs(x_pokey-posx(5))<2 or abs(x_pokey-posx(10))<2) and (abs(y_pokey-Posy(1))<2 or abs(y_pokey-Posy(7))<2 or abs(y_pokey-Posy(9))<2) then.
If dirección_pokey=2 then dirección_pokey=3.
If dirección_pokey=1 then dirección_pokey=4.
Endif.
Fila 2----------------------------------------------
If abs(xpacman-posx(1))<2 and abs(ypacman-Posy(2))<2 then.
If dirección_pacman=4 then dirección_pacman=0.
If keydown(205) then dirección_pacman=2.
If keydown(20 then dirección_pacman=3.
If keydown(200) then dirección_pacman=1.
Endif.
If abs(x_shadow-posx(1))<2 and abs(y_shadow-Posy(2))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=6 then.
If sorteo=1 then horientación_shadow=2 else horientación_shadow=3.
Endif.
If horientación_shadow=5 then.
If sorteo=1 then horientación_shadow=2 else horientación_shadow=1.
Endif.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=4 then dirección_shadow=2.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(3).
If status_fantasmas(1)=2 then dirección_shadow=2.
Endif.
Endif.
If abs(x_spedy-posx(1))<2 and abs(y_spedy-Posy(2))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=6 then.
If sorteo=1 then horientación_spedy=2 else horientación_spedy=3.
Endif.
If horientación_spedy=5 then.
If sorteo=1 then horientación_spedy=2 else horientación_spedy=1.
Endif.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=4 then dirección_spedy=2.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(3).
If status_fantasmas(2)=2 then dirección_spedy=2.
Endif.
Endif.
If abs(x_bashful-posx(1))<2 and abs(y_bashful-Posy(2))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=6 then.
If sorteo=1 then horientación_bashful=2 else horientación_bashful=3.
Endif.
If horientación_bashful=5 then.
If sorteo=1 then horientación_bashful=2 else horientación_bashful=1.
Endif.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=4 then dirección_bashful=2.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(3).
If status_fantasmas(3)=2 then dirección_bashful=2.
Endif.
Endif.
If abs(x_pokey-posx(1))<2 and abs(y_pokey-Posy(2))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=6 then.
If sorteo=1 then horientación_pokey=2 else horientación_pokey=3.
Endif.
If horientación_pokey=5 then.
If sorteo=1 then horientación_pokey=2 else horientación_pokey=1.
Endif.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=4 then dirección_pokey=2.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(3).
If status_fantasmas(4)=2 then dirección_pokey=2.
Endif.
Endif.
If (abs(xpacman-posx(3))<2 or abs(xpacman-posx()<2) and (abs(ypacman-Posy(2))<2 or abs(ypacman-Posy(5))<2 or abs(ypacman-Posy(7))<2) then.
If keydown(200) then dirección_pacman=1.
If keydown(205) then dirección_pacman=2.
If keydown(20 then dirección_pacman=3.
If keydown(203) then dirección_pacman=4.
Endif.
If (abs(x_shadow-posx(3))<2 or abs(x_shadow-posx()<2) and (abs(y_shadow-Posy(2))<2 or abs(y_shadow-Posy(5))<2 or abs(y_shadow-Posy(7))<2) then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=8 then horientación_shadow=1.
If horientación_shadow=6 then.
If sorteo=1 then horientación_shadow=2 else horientación_shadow=3.
Endif.
If horientación_shadow=5 then horientación_shadow=2.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If horientación_shadow>4 then.
If sorteo=1 then dirección_shadow=horientación_shadow-4 else dirección_shadow=horientación_shadow-6.
Endif.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(4).
While dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=0 then dirección_shadow=dirección_pacman.
If status_fantasmas(1)=2 then.
If abs(x_shadow-posx(3))<2 then dirección_shadow=2.
If abs(x_shadow-posx()<2 then dirección_shadow=4.
Endif.
Endif.
Endif.
If (abs(x_spedy-posx(3))<2 or abs(x_spedy-posx()<2) and (abs(y_spedy-Posy(2))<2 or abs(y_spedy-Posy(5))<2 or abs(y_spedy-Posy(7))<2) then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=8 then horientación_spedy=1.
If horientación_spedy=6 then.
If sorteo=1 then horientación_spedy=2 else horientación_spedy=3.
Endif.
If horientación_spedy=5 then horientación_spedy=2.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If horientación_spedy>4 then.
If sorteo=1 then dirección_spedy=horientación_spedy-4 else dirección_spedy=horientación_spedy-6.
Endif.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(4).
While dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=0 then dirección_spedy=dirección_pacman.
If status_fantasmas(2)=2 then.
If abs(x_spedy-posx(3))<2 then dirección_spedy=2.
If abs(x_spedy-posx()<2 then dirección_spedy=4.
Endif.
Endif.
Endif.
If (abs(x_bashful-posx(3))<2 or abs(x_bashful-posx()<2) and (abs(y_bashful-Posy(2))<2 or abs(y_bashful-Posy(5))<2 or abs(y_bashful-Posy(7))<2) then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=8 then horientación_bashful=1.
If horientación_bashful=6 then.
If sorteo=1 then horientación_bashful=2 else horientación_bashful=3.
Endif.
If horientación_bashful=5 then horientación_bashful=2.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If horientación_bashful>4 then.
If sorteo=1 then dirección_bashful=horientación_bashful-4 else dirección_bashful=horientación_bashful-6.
Endif.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(4).
While dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=0 then dirección_bashful=dirección_pacman.
If status_fantasmas(3)=2 then.
If abs(x_bashful-posx(3))<2 then dirección_bashful=2.
If abs(x_bashful-posx()<2 then dirección_bashful=4.
Endif.
Endif.
Endif.
If (abs(x_pokey-posx(3))<2 or abs(x_pokey-posx()<2) and (abs(y_pokey-Posy(2))<2 or abs(y_pokey-Posy(5))<2 or abs(y_pokey-Posy(7))<2) then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=8 then horientación_pokey=1.
If horientación_pokey=6 then.
If sorteo=1 then horientación_pokey=2 else horientación_pokey=3.
Endif.
If horientación_pokey=5 then horientación_pokey=2.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If horientación_pokey>4 then.
If sorteo=1 then dirección_pokey=horientación_pokey-4 else dirección_pokey=horientación_pokey-6.
Endif.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(4).
While dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=0 then dirección_pokey=dirección_pacman.
If status_fantasmas(4)=2 then.
If abs(x_pokey-posx(3))<2 then dirección_pokey=2.
If abs(x_pokey-posx()<2 then dirección_pokey=4.
Endif.
Endif.
Endif.
If (abs(xpacman-posx(4))<2 or abs(xpacman-posx(7))<2) and (abs(ypacman-Posy(2))<2 or abs(ypacman-Posy()<2) then.
If dirección_pacman=1 then dirección_pacman=0.
If keydown(205) then dirección_pacman=2.
If keydown(20 then dirección_pacman=3.
If keydown(203) then dirección_pacman=4.
Endif.
If (abs(x_shadow-posx(4))<2 or abs(x_shadow-posx(7))<2) and (abs(y_shadow-Posy(2))<2 or abs(y_shadow-Posy()<2) then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=5 then horientación_shadow=2.
If horientación_shadow=6 then horientación_shadow=2.
If horientación_shadow=7 then horientación_shadow=4.
If horientación_shadow=8 then horientación_shadow=4.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(2,4).
While dirección_shadow=1 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(2,4).
Wend.
If status_fantasmas(1)=2 then.
If abs(y_shadow-Posy(2))<2 then dirección_shadow=3 else dirección_shadow=2.
Endif.
Endif.
Endif.
If (abs(x_spedy-posx(4))<2 or abs(x_spedy-posx(7))<2) and (abs(y_spedy-Posy(2))<2 or abs(y_spedy-Posy()<2) then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=5 then horientación_spedy=2.
If horientación_spedy=6 then horientación_spedy=2.
If horientación_spedy=7 then horientación_spedy=4.
If horientación_spedy=8 then horientación_spedy=4.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(2,4).
While dirección_spedy=1 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(2,4).
Wend.
If status_fantasmas(2)=2 then.
If abs(y_spedy-Posy(2))<2 then dirección_spedy=3 else dirección_spedy=2.
Endif.
Endif.
Endif.
If (abs(x_bashful-posx(4))<2 or abs(x_bashful-posx(7))<2) and (abs(y_bashful-Posy(2))<2 or abs(y_bashful-Posy()<2) then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=5 then horientación_bashful=2.
If horientación_bashful=6 then horientación_bashful=2.
If horientación_bashful=7 then horientación_bashful=4.
If horientación_bashful=8 then horientación_bashful=4.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(2,4).
While dirección_bashful=1 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(2,4).
Wend.
If status_fantasmas(3)=2 then.
If abs(y_bashful-Posy(2))<2 then dirección_bashful=3 else dirección_bashful=2.
Endif.
Endif.
Endif.
If (abs(x_pokey-posx(4))<2 or abs(x_pokey-posx(7))<2) and (abs(y_pokey-Posy(2))<2 or abs(y_pokey-Posy()<2) then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=5 then horientación_pokey=2.
If horientación_pokey=6 then horientación_pokey=2.
If horientación_pokey=7 then horientación_pokey=4.
If horientación_pokey=8 then horientación_pokey=4.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(2,4).
While dirección_pokey=1 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(2,4).
Wend.
If status_fantasmas(4)=2 then.
If abs(y_pokey-Posy(2))<2 then dirección_pokey=3 else dirección_pokey=2.
Endif.
Endif.
Endif.
If (abs(xpacman-posx(5))<2 or abs(xpacman-posx(6))<2) and (abs(ypacman-Posy(2))<2 or abs(ypacman-Posy()<2 or abs(ypacman-Posy()<2) then.
If dirección_pacman=3 then dirección_pacman=0.
If keydown(205) then dirección_pacman=2.
If keydown(200) then dirección_pacman=1.
If keydown(203) then dirección_pacman=4.
Endif.
If (abs(x_shadow-posx(5))<2 or abs(x_shadow-posx(6))<2) and (abs(y_shadow-Posy(2))<2 or abs(y_shadow-Posy()<2 or abs(y_shadow-Posy()<2) then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=8 then horientación_shadow=1.
If horientación_shadow=5 then horientación_shadow=2.
If horientación_shadow=6 then horientación_shadow=2.
If horientación_shadow=7 then horientación_shadow=1.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(4).
While dirección_shadow=3 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=1.
Endif.
Endif.
If (abs(x_spedy-posx(5))<2 or abs(x_spedy-posx(6))<2) and (abs(y_spedy-Posy(2))<2 or abs(y_spedy-Posy()<2 or abs(y_spedy-Posy()<2) then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=8 then horientación_spedy=1.
If horientación_spedy=5 then horientación_spedy=2.
If horientación_spedy=6 then horientación_spedy=2.
If horientación_spedy=7 then horientación_spedy=1.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(4).
While dirección_spedy=3 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=1.
Endif.
Endif.
If (abs(x_bashful-posx(5))<2 or abs(x_bashful-posx(6))<2) and (abs(y_bashful-Posy(2))<2 or abs(y_bashful-Posy()<2 or abs(y_bashful-Posy()<2) then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=8 then horientación_bashful=1.
If horientación_bashful=5 then horientación_bashful=2.
If horientación_bashful=6 then horientación_bashful=2.
If horientación_bashful=7 then horientación_bashful=1.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(4).
While dirección_bashful=3 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=1.
Endif.
Endif.
If (abs(x_pokey-posx(5))<2 or abs(x_pokey-posx(6))<2) and (abs(y_pokey-Posy(2))<2 or abs(y_pokey-Posy()<2 or abs(y_pokey-Posy()<2) then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=8 then horientación_pokey=1.
If horientación_pokey=5 then horientación_pokey=2.
If horientación_pokey=6 then horientación_pokey=2.
If horientación_pokey=7 then horientación_pokey=1.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(4).
While dirección_pokey=3 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=1.
Endif.
Endif.
If abs(xpacman-posx(10))<2 and abs(ypacman-Posy(2))<2 then.
If dirección_pacman=2 then dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(20 then dirección_pacman=3.
If keydown(203) then dirección_pacman=4.
Endif.
If abs(x_shadow-posx(10))<2 and abs(y_shadow-Posy(2))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=2 then horientación_shadow=3.
If horientación_shadow=7 then horientación_shadow=Rand(3,4).
If horientación_shadow=8 then.
If sorteo=1 then horientación_shadow=1 else horientación_shadow=4.
Endif.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(4).
While dirección_shadow=2 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=3.
Endif.
Endif.
If abs(x_spedy-posx(10))<2 and abs(y_spedy-Posy(2))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=2 then horientación_spedy=3.
If horientación_spedy=7 then horientación_spedy=Rand(3,4).
If horientación_spedy=8 then.
If sorteo=1 then horientación_spedy=1 else horientación_spedy=4.
Endif.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(4).
While dirección_spedy=2 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=3.
Endif.
Endif.
If abs(x_bashful-posx(10))<2 and abs(y_bashful-Posy(2))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=2 then horientación_bashful=3.
If horientación_bashful=7 then horientación_bashful=Rand(3,4).
If horientación_bashful=8 then.
If sorteo=1 then horientación_bashful=1 else horientación_bashful=4.
Endif.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(4).
While dirección_bashful=2 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=3.
Endif.
Endif.
If abs(x_pokey-posx(10))<2 and abs(y_pokey-Posy(2))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=2 then horientación_pokey=3.
If horientación_pokey=7 then horientación_pokey=Rand(3,4).
If horientación_pokey=8 then.
If sorteo=1 then horientación_pokey=1 else horientación_pokey=4.
Endif.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(4).
While dirección_pokey=2 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=3.
Endif.
Endif.
Fila 3----------------------------------------------
If abs(xpacman-posx(1))<2 and (abs(ypacman-Posy(3))<2 or abs(ypacman-Posy(10))<2 or abs(ypacman-Posy()<2) then.
Dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(205) then dirección_pacman=2.
Endif.
If abs(x_shadow-posx(1))<2 and (abs(y_shadow-Posy(3))<2 or abs(y_shadow-Posy(10))<2 or abs(y_shadow-Posy()<2) then.
If dirección_shadow=3 then dirección_shadow=2.
If dirección_shadow=4 then dirección_shadow=1.
Endif.
If abs(x_spedy-posx(1))<2 and (abs(y_spedy-Posy(3))<2 or abs(y_spedy-Posy(10))<2 or abs(y_spedy-Posy()<2) then.
If dirección_spedy=3 then dirección_spedy=2.
If dirección_spedy=4 then dirección_spedy=1.
Endif.
If abs(x_bashful-posx(1))<2 and (abs(y_bashful-Posy(3))<2 or abs(y_bashful-Posy(10))<2 or abs(y_bashful-Posy()<2) then.
If dirección_bashful=3 then dirección_bashful=2.
If dirección_bashful=4 then dirección_bashful=1.
Endif.
If abs(x_pokey-posx(1))<2 and (abs(y_pokey-Posy(3))<2 or abs(y_pokey-Posy(10))<2 or abs(y_pokey-Posy()<2) then.
If dirección_pokey=3 then dirección_pokey=2.
If dirección_pokey=4 then dirección_pokey=1.
Endif.
If abs(xpacman-posx(3))<2 and abs(ypacman-Posy(3))<2 then.
If dirección_pacman=2 then dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(20 then dirección_pacman=3.
If keydown(203) then dirección_pacman=4.
Endif.
If abs(x_shadow-posx(3))<2 and abs(y_shadow-Posy(3))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=8 then horientación_shadow=1.
If horientación_shadow=7 then horientación_shadow=3.
If horientación_shadow=6 then horientación_shadow=3.
If horientación_shadow=5 then horientación_shadow=1.
If horientación_shadow=2 then horientación_shadow=1.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(4).
While dirección_shadow=2 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=1.
Endif.
Endif.
If abs(x_spedy-posx(3))<2 and abs(y_spedy-Posy(3))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=8 then horientación_spedy=1.
If horientación_spedy=7 then horientación_spedy=3.
If horientación_spedy=6 then horientación_spedy=3.
If horientación_spedy=5 then horientación_spedy=1.
If horientación_spedy=2 then horientación_spedy=1.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(4).
While dirección_spedy=2 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=1.
Endif.
Endif.
If abs(x_bashful-posx(3))<2 and abs(y_bashful-Posy(3))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=8 then horientación_bashful=1.
If horientación_bashful=7 then horientación_bashful=3.
If horientación_bashful=6 then horientación_bashful=3.
If horientación_bashful=5 then horientación_bashful=1.
If horientación_bashful=2 then horientación_bashful=1.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(4).
While dirección_bashful=2 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=1.
Endif.
Endif.
If abs(x_pokey-posx(3))<2 and abs(y_pokey-Posy(3))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=8 then horientación_pokey=1.
If horientación_pokey=7 then horientación_pokey=3.
If horientación_pokey=6 then horientación_pokey=3.
If horientación_pokey=5 then horientación_pokey=1.
If horientación_pokey=2 then horientación_pokey=1.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(4).
While dirección_pokey=2 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=1.
Endif.
Endif.
If abs(xpacman-posx(4))<2 and abs(ypacman-Posy(3))<2 then.
Dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(205) then dirección_pacman=2.
Endif.
If abs(x_shadow-posx(4))<2 and abs(y_shadow-Posy(3))<2 then.
If dirección_shadow=3 then dirección_shadow=2.
If dirección_shadow=4 then dirección_shadow=1.
Endif.
If abs(x_spedy-posx(4))<2 and abs(y_spedy-Posy(3))<2 then.
If dirección_spedy=3 then dirección_spedy=2.
If dirección_spedy=4 then dirección_spedy=1.
Endif.
If abs(x_bashful-posx(4))<2 and abs(y_bashful-Posy(3))<2 then.
If dirección_bashful=3 then dirección_bashful=2.
If dirección_bashful=4 then dirección_bashful=1.
Endif.
If abs(x_pokey-posx(4))<2 and abs(y_pokey-Posy(3))<2 then.
If dirección_pokey=3 then dirección_pokey=2.
If dirección_pokey=4 then dirección_pokey=1.
Endif.
If abs(xpacman-posx(5))<2 and abs(ypacman-Posy(3))<2 then.
Dirección_pacman=0.
If keydown(20 then dirección_pacman=3.
If keydown(203) then dirección_pacman=4.
Endif.
If abs(x_shadow-posx(5))<2 and abs(y_shadow-Posy(3))<2 then.
If dirección_shadow=2 then dirección_shadow=3.
If dirección_shadow=1 then dirección_shadow=4.
Endif.
If abs(x_spedy-posx(5))<2 and abs(y_spedy-Posy(3))<2 then.
If dirección_spedy=2 then dirección_spedy=3.
If dirección_spedy=1 then dirección_spedy=4.
Endif.
If abs(x_bashful-posx(5))<2 and abs(y_bashful-Posy(3))<2 then.
If dirección_bashful=2 then dirección_bashful=3.
If dirección_bashful=1 then dirección_bashful=4.
Endif.
If abs(x_pokey-posx(5))<2 and abs(y_pokey-Posy(3))<2 then.
If dirección_pokey=2 then dirección_pokey=3.
If dirección_pokey=1 then dirección_pokey=4.
Endif.
If abs(xpacman-posx(6))<2 and abs(ypacman-Posy(3))<2 then.
Dirección_pacman=0.
If keydown(20 then dirección_pacman=3.
If keydown(205) then dirección_pacman=2.
Endif.
If abs(x_shadow-posx(6))<2 and abs(y_shadow-Posy(3))<2 then.
If dirección_shadow=1 then dirección_shadow=2.
If dirección_shadow=4 then dirección_shadow=3.
Endif.
If abs(x_spedy-posx(6))<2 and abs(y_spedy-Posy(3))<2 then.
If dirección_spedy=1 then dirección_spedy=2.
If dirección_spedy=4 then dirección_spedy=3.
Endif.
If abs(x_bashful-posx(6))<2 and abs(y_bashful-Posy(3))<2 then.
If dirección_bashful=1 then dirección_bashful=2.
If dirección_bashful=4 then dirección_bashful=3.
Endif.
If abs(x_pokey-posx(6))<2 and abs(y_pokey-Posy(3))<2 then.
If dirección_pokey=1 then dirección_pokey=2.
If dirección_pokey=4 then dirección_pokey=3.
Endif.
If abs(xpacman-posx(7))<2 and abs(ypacman-Posy(3))<2 then.
Dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(203) then dirección_pacman=4.
Endif.
If abs(x_shadow-posx(7))<2 and abs(y_shadow-Posy(3))<2 then.
If dirección_shadow=2 then dirección_shadow=1.
If dirección_shadow=3 then dirección_shadow=4.
Endif.
If abs(x_spedy-posx(7))<2 and abs(y_spedy-Posy(3))<2 then.
If dirección_spedy=2 then dirección_spedy=1.
If dirección_spedy=3 then dirección_spedy=4.
Endif.
If abs(x_bashful-posx(7))<2 and abs(y_bashful-Posy(3))<2 then.
If dirección_bashful=2 then dirección_bashful=1.
If dirección_bashful=3 then dirección_bashful=4.
Endif.
If abs(x_pokey-posx(7))<2 and abs(y_pokey-Posy(3))<2 then.
If dirección_pokey=2 then dirección_pokey=1.
If dirección_pokey=3 then dirección_pokey=4.
Endif.
If abs(xpacman-posx()<2 and abs(ypacman-Posy(3))<2 then.
If dirección_pacman=4 then dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(20 then dirección_pacman=3.
If keydown(205) then dirección_pacman=2.
Endif.
If abs(x_shadow-posx()<2 and abs(y_shadow-Posy(3))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=8 then horientación_shadow=Rand(2,3).
If horientación_shadow=7 then horientación_shadow=3.
If horientación_shadow=6 then horientación_shadow=3.
If horientación_shadow=5 then horientación_shadow=Rand(1,2).
If horientación_shadow=4 then horientación_shadow=3.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(3).
While dirección_shadow=4 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(3).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=3.
Endif.
Endif.
If abs(x_spedy-posx()<2 and abs(y_spedy-Posy(3))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=8 then horientación_spedy=Rand(2,3).
If horientación_spedy=7 then horientación_spedy=3.
If horientación_spedy=6 then horientación_spedy=3.
If horientación_spedy=5 then horientación_spedy=Rand(1,2).
If horientación_spedy=4 then horientación_spedy=3.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(3).
While dirección_spedy=4 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(3).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=3.
Endif.
Endif.
If abs(x_bashful-posx()<2 and abs(y_bashful-Posy(3))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=8 then horientación_bashful=Rand(2,3).
If horientación_bashful=7 then horientación_bashful=3.
If horientación_bashful=6 then horientación_bashful=3.
If horientación_bashful=5 then horientación_bashful=Rand(1,2).
If horientación_bashful=4 then horientación_bashful=3.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(3).
While dirección_bashful=4 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(3).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=3.
Endif.
Endif.
If abs(x_pokey-posx()<2 and abs(y_pokey-Posy(3))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=8 then horientación_pokey=Rand(2,3).
If horientación_pokey=7 then horientación_pokey=3.
If horientación_pokey=6 then horientación_pokey=3.
If horientación_pokey=5 then horientación_pokey=Rand(1,2).
If horientación_pokey=4 then horientación_pokey=3.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(3).
While dirección_pokey=4 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(3).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=3.
Endif.
Endif.
If abs(xpacman-posx(10))<2 and (abs(ypacman-Posy(3))<2 or abs(ypacman-Posy(10))<2 or abs(ypacman-Posy()<2) then.
Dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(203) then dirección_pacman=4.
Endif.
If abs(x_shadow-posx(10))<2 and (abs(y_shadow-Posy(3))<2 or abs(y_shadow-Posy(10))<2 or abs(y_shadow-Posy()<2) then.
If dirección_shadow=2 then dirección_shadow=1.
If dirección_shadow=3 then dirección_shadow=4.
Endif.
If abs(x_spedy-posx(10))<2 and (abs(y_spedy-Posy(3))<2 or abs(y_spedy-Posy(10))<2 or abs(y_spedy-Posy()<2) then.
If dirección_spedy=2 then dirección_spedy=1.
If dirección_spedy=3 then dirección_spedy=4.
Endif.
If abs(x_bashful-posx(10))<2 and (abs(y_bashful-Posy(3))<2 or abs(y_bashful-Posy(10))<2 or abs(y_bashful-Posy()<2) then.
If dirección_bashful=2 then dirección_bashful=1.
If dirección_bashful=3 then dirección_bashful=4.
Endif.
If abs(x_pokey-posx(10))<2 and (abs(y_pokey-Posy(3))<2 or abs(y_pokey-Posy(10))<2 or abs(y_pokey-Posy()<2) then.
If dirección_pokey=2 then dirección_pokey=1.
If dirección_pokey=3 then dirección_pokey=4.
Endif.
Fila 4----------------------------------------------
If abs(xpacman-posx(4))<2 and abs(ypacman-Posy(4))<2 then.
Dirección_pacman=0.
If keydown(20 then dirección_pacman=3.
If keydown(205) then dirección_pacman=2.
Endif.
If abs(x_shadow-posx(4))<2 and abs(y_shadow-Posy(4))<2 then.
If dirección_shadow=1 then dirección_shadow=2.
If dirección_shadow=4 then dirección_shadow=3.
Endif.
If abs(x_spedy-posx(4))<2 and abs(y_spedy-Posy(4))<2 then.
If dirección_spedy=1 then dirección_spedy=2.
If dirección_spedy=4 then dirección_spedy=3.
Endif.
If abs(x_bashful-posx(4))<2 and abs(y_bashful-Posy(4))<2 then.
If dirección_bashful=1 then dirección_bashful=2.
If dirección_bashful=4 then dirección_bashful=3.
Endif.
If abs(x_pokey-posx(4))<2 and abs(y_pokey-Posy(4))<2 then.
If dirección_pokey=1 then dirección_pokey=2.
If dirección_pokey=4 then dirección_pokey=3.
Endif.
If (abs(xpacman-posx(5))<2 or abs(xpacman-posx(6))<2) and abs(ypacman-Posy(4))<2 then.
If dirección_pacman=3 then dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(205) then dirección_pacman=2.
If keydown(203) then dirección_pacman=4.
Endif.
If abs(x_shadow-posx(5))<2 and abs(y_shadow-Posy(4))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=6 then horientación_shadow=2.
If horientación_shadow=5 then horientación_shadow=2.
If horientación_shadow=7 then horientación_shadow=4.
If horientación_shadow=8 then horientación_shadow=1.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(4).
While dirección_shadow=3 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=2.
Endif.
Endif.
If abs(x_spedy-posx(5))<2 and abs(y_spedy-Posy(4))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=6 then horientación_spedy=2.
If horientación_spedy=5 then horientación_spedy=2.
If horientación_spedy=7 then horientación_spedy=4.
If horientación_spedy=8 then horientación_spedy=1.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(4).
While dirección_spedy=3 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=2.
Endif.
Endif.
If abs(x_bashful-posx(5))<2 and abs(y_bashful-Posy(4))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=6 then horientación_bashful=2.
If horientación_bashful=5 then horientación_bashful=2.
If horientación_bashful=7 then horientación_bashful=4.
If horientación_bashful=8 then horientación_bashful=1.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(4).
While dirección_bashful=3 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=2.
Endif.
Endif.
If abs(x_pokey-posx(5))<2 and abs(y_pokey-Posy(4))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=6 then horientación_pokey=2.
If horientación_pokey=5 then horientación_pokey=2.
If horientación_pokey=7 then horientación_pokey=4.
If horientación_pokey=8 then horientación_pokey=1.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(4).
While dirección_pokey=3 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=2.
Endif.
Endif.
If abs(x_shadow-posx(5)-27)<2 and abs(y_shadow-Posy(4))<2 then.
If status_fantasmas(1)=2 then dirección_shadow=3.
If status_fantasmas(1)=1 then.
If horientación_shadow=6 then dirección_shadow=2.
If horientación_shadow=5 then dirección_shadow=2.
If horientación_shadow=7 then dirección_shadow=4.
If horientación_shadow=8 then dirección_shadow=4.
If horientación_shadow=1 then dirección_shadow=2.
If horientación_shadow=2 then dirección_shadow=2.
If horientación_shadow=3 then dirección_shadow=4.
If horientación_shadow=4 then dirección_shadow=2.
Endif.
Endif.
If abs(x_spedy-posx(5)-27)<2 and abs(y_spedy-Posy(4))<2 then.
If status_fantasmas(2)=2 then dirección_spedy=3.
If status_fantasmas(2)=1 then.
If horientación_spedy=6 then dirección_spedy=2.
If horientación_spedy=5 then dirección_spedy=2.
If horientación_spedy=7 then dirección_spedy=4.
If horientación_spedy=8 then dirección_spedy=4.
If horientación_spedy=1 then dirección_spedy=2.
If horientación_spedy=2 then dirección_spedy=2.
If horientación_spedy=3 then dirección_spedy=4.
If horientación_spedy=4 then dirección_spedy=2.
Endif.
Endif.
If abs(x_bashful-posx(5)-27)<2 and abs(y_bashful-Posy(4))<2 then.
If status_fantasmas(3)=2 then dirección_bashful=3.
If status_fantasmas(3)=1 then.
If horientación_bashful=6 then dirección_bashful=2.
If horientación_bashful=5 then dirección_bashful=2.
If horientación_bashful=7 then dirección_bashful=4.
If horientación_bashful=8 then dirección_bashful=4.
If horientación_bashful=1 then dirección_bashful=2.
If horientación_bashful=2 then dirección_bashful=2.
If horientación_bashful=3 then dirección_bashful=4.
If horientación_bashful=4 then dirección_bashful=2.
Endif.
Endif.
If abs(x_pokey-posx(5)-27)<2 and abs(y_pokey-Posy(4))<2 then.
If status_fantasmas(4)=2 then dirección_pokey=3.
If status_fantasmas(4)=1 then.
If horientación_pokey=6 then dirección_pokey=2.
If horientación_pokey=5 then dirección_pokey=2.
If horientación_pokey=7 then dirección_pokey=4.
If horientación_pokey=8 then dirección_pokey=4.
If horientación_pokey=1 then dirección_pokey=2.
If horientación_pokey=2 then dirección_pokey=2.
If horientación_pokey=3 then dirección_pokey=4.
If horientación_pokey=4 then dirección_pokey=2.
Endif.
Endif.
If abs(x_shadow-posx(5)-27)<2 and abs(y_shadow-Posy(5))<2 then.
Status_fantasmas(1)=1.
Dirección_shadow=1.
Eyes(1)=0.
Endif.
If abs(x_spedy-posx(5)-27)<2 and abs(y_spedy-Posy(5))<2 then.
Status_fantasmas(2)=1.
Dirección_spedy=1.
Eyes(2)=0.
Endif.
If abs(x_bashful-posx(5)-27)<2 and abs(y_bashful-Posy(5))<2 then.
Status_fantasmas(3)=1.
Dirección_bashful=1.
Eyes(3)=0.
Endif.
If abs(x_pokey-posx(5)-27)<2 and abs(y_pokey-Posy(5))<2 then.
Status_fantasmas(4)=1.
Dirección_pokey=1.
Eyes(4)=0.
Endif.
If abs(x_shadow-posx(6))<2 and abs(y_shadow-Posy(4))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=6 then horientación_shadow=2.
If horientación_shadow=5 then horientación_shadow=1.
If horientación_shadow=7 then horientación_shadow=4.
If horientación_shadow=8 then horientación_shadow=4.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(4).
While dirección_shadow=3 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=4.
Endif.
Endif.
If abs(x_spedy-posx(6))<2 and abs(y_spedy-Posy(4))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=6 then horientación_spedy=2.
If horientación_spedy=5 then horientación_spedy=1.
If horientación_spedy=7 then horientación_spedy=4.
If horientación_spedy=8 then horientación_spedy=4.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(4).
While dirección_spedy=3 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=4.
Endif.
Endif.
If abs(x_bashful-posx(6))<2 and abs(y_bashful-Posy(4))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=6 then horientación_bashful=2.
If horientación_bashful=5 then horientación_bashful=1.
If horientación_bashful=7 then horientación_bashful=4.
If horientación_bashful=8 then horientación_bashful=4.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(4).
While dirección_bashful=3 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=4.
Endif.
Endif.
If abs(x_pokey-posx(6))<2 and abs(y_pokey-Posy(4))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=6 then horientación_pokey=2.
If horientación_pokey=5 then horientación_pokey=1.
If horientación_pokey=7 then horientación_pokey=4.
If horientación_pokey=8 then horientación_pokey=4.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(4).
While dirección_pokey=3 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=4.
Endif.
Endif.
If abs(xpacman-posx(7))<2 and abs(ypacman-Posy(4))<2 then.
Dirección_pacman=0.
If keydown(20 then dirección_pacman=3.
If keydown(203) then dirección_pacman=4.
Endif.
If abs(x_shadow-posx(7))<2 and abs(y_shadow-Posy(4))<2 then.
If dirección_shadow=2 then dirección_shadow=3.
If dirección_shadow=1 then dirección_shadow=4.
Endif.
If abs(x_spedy-posx(7))<2 and abs(y_spedy-Posy(4))<2 then.
If dirección_spedy=2 then dirección_spedy=3.
If dirección_spedy=1 then dirección_spedy=4.
Endif.
If abs(x_bashful-posx(7))<2 and abs(y_bashful-Posy(4))<2 then.
If dirección_bashful=2 then dirección_bashful=3.
If dirección_bashful=1 then dirección_bashful=4.
Endif.
If abs(x_pokey-posx(7))<2 and abs(y_pokey-Posy(4))<2 then.
If dirección_pokey=2 then dirección_pokey=3.
If dirección_pokey=1 then dirección_pokey=4.
Endif.
Fila 5----------------------------------------------
If abs(xpacman-posx(4))<2 and abs(ypacman-Posy(5))<2 then.
If dirección_pacman=2 then dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(20 then dirección_pacman=3.
If keydown(203) then dirección_pacman=4.
Endif.
If abs(x_shadow-posx(4))<2 and abs(y_shadow-Posy(5))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=7 then horientación_shadow=Rand(3,4).
If horientación_shadow=8 then.
If sorteo=1 then horientación_shadow=1 else horientación_shadow=4.
Endif.
If horientación_shadow=5 then horientación_shadow=1.
If horientación_shadow=6 then horientación_shadow=3.
If horientación_shadow=2 or horientación_shadow=4 then.
If sorteo=1 then horientación_shadow=3 else horientación_shadow=1.
Endif.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(4).
While dirección_shadow=2 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=1.
Endif.
Endif.
If abs(x_spedy-posx(4))<2 and abs(y_spedy-Posy(5))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=7 then horientación_spedy=Rand(3,4).
If horientación_spedy=8 then.
If sorteo=1 then horientación_spedy=1 else horientación_spedy=4.
Endif.
If horientación_spedy=5 then horientación_spedy=1.
If horientación_spedy=6 then horientación_spedy=3.
If horientación_spedy=2 or horientación_spedy=4 then.
If sorteo=1 then horientación_spedy=3 else horientación_spedy=1.
Endif.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(4).
While dirección_spedy=2 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=1.
Endif.
Endif.
If abs(x_bashful-posx(4))<2 and abs(y_bashful-Posy(5))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=7 then horientación_bashful=Rand(3,4).
If horientación_bashful=8 then.
If sorteo=1 then horientación_bashful=1 else horientación_bashful=4.
Endif.
If horientación_bashful=5 then horientación_bashful=1.
If horientación_bashful=6 then horientación_bashful=3.
If horientación_bashful=2 or horientación_bashful=4 then.
If sorteo=1 then horientación_bashful=3 else horientación_bashful=1.
Endif.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(4).
While dirección_bashful=2 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=1.
Endif.
Endif.
If abs(x_pokey-posx(4))<2 and abs(y_pokey-Posy(5))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=7 then horientación_pokey=Rand(3,4).
If horientación_pokey=8 then.
If sorteo=1 then horientación_pokey=1 else horientación_pokey=4.
Endif.
If horientación_pokey=5 then horientación_pokey=1.
If horientación_pokey=6 then horientación_pokey=3.
If horientación_pokey=2 or horientación_pokey=4 then.
If sorteo=1 then horientación_pokey=3 else horientación_pokey=1.
Endif.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(4).
While dirección_pokey=2 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=1.
Endif.
Endif.
If abs(xpacman-posx(7))<2 and abs(ypacman-Posy(5))<2 then.
If dirección_pacman=4 then dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(20 then dirección_pacman=3.
If keydown(205) then dirección_pacman=2.
Endif.
If abs(x_shadow-posx(7))<2 and abs(y_shadow-Posy(5))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=5 then horientación_shadow=Rand(1,2).
If horientación_shadow=6 then horientación_shadow=Rand(2,3).
If horientación_shadow=8 then horientación_shadow=1.
If horientación_shadow=7 then horientación_shadow=3.
If horientación_shadow=4 or horientación_shadow=2 then.
If sorteo=1 then horientación_shadow=3 else horientación_shadow=1.
Endif.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(3).
While dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(3).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=1.
Endif.
Endif.
If abs(x_spedy-posx(7))<2 and abs(y_spedy-Posy(5))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=5 then horientación_spedy=Rand(1,2).
If horientación_spedy=6 then horientación_spedy=Rand(2,3).
If horientación_spedy=8 then horientación_spedy=1.
If horientación_spedy=7 then horientación_spedy=3.
If horientación_spedy=4 or horientación_spedy=2 then.
If sorteo=1 then horientación_spedy=3 else horientación_spedy=1.
Endif.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(3).
While dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(3).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=1.
Endif.
Endif.
If abs(x_bashful-posx(7))<2 and abs(y_bashful-Posy(5))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=5 then horientación_bashful=Rand(1,2).
If horientación_bashful=6 then horientación_bashful=Rand(2,3).
If horientación_bashful=8 then horientación_bashful=1.
If horientación_bashful=7 then horientación_bashful=3.
If horientación_bashful=4 or horientación_bashful=2 then.
If sorteo=1 then horientación_bashful=3 else horientación_bashful=1.
Endif.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(3).
While dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(3).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=1.
Endif.
Endif.
If abs(x_pokey-posx(7))<2 and abs(y_pokey-Posy(5))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=5 then horientación_pokey=Rand(1,2).
If horientación_pokey=6 then horientación_pokey=Rand(2,3).
If horientación_pokey=8 then horientación_pokey=1.
If horientación_pokey=7 then horientación_pokey=3.
If horientación_pokey=4 or horientación_pokey=2 then.
If sorteo=1 then horientación_pokey=3 else horientación_pokey=1.
Endif.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(3).
While dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(3).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=1.
Endif.
Endif.
If abs(xpacman-posx(1)+20)<2 and abs(ypacman-Posy(5))<2 then.
If dirección_pacman=4 then xpacman=posx(10).
Endif.
If abs(x_shadow-posx(1)+20)<2 and abs(y_shadow-Posy(5))<2 then.
Temp_velocidad_shadow=temp_velocidad_shadow/2.
If dirección_shadow=4 then x_shadow=posx(10).
Endif.
If abs(x_spedy-posx(1)+20)<2 and abs(y_spedy-Posy(5))<2 then.
Temp_velocidad_spedy=temp_velocidad_spedy/2.
If dirección_spedy=4 then x_spedy=posx(10).
Endif.
If abs(x_bashful-posx(1)+20)<2 and abs(y_bashful-Posy(5))<2 then.
Temp_velocidad_bashful=temp_velocidad_bashful/2.
If dirección_bashful=4 then x_bashful=posx(10).
Endif.
If abs(x_pokey-posx(1)+20)<2 and abs(y_pokey-Posy(5))<2 then.
Temp_velocidad_pokey=temp_velocidad_pokey/2.
If dirección_pokey=4 then x_pokey=posx(10).
Endif.
If abs(xpacman-posx(10)-20)<2 and abs(ypacman-Posy(5))<2 then.
If dirección_pacman=2 then xpacman=posx(1).
Endif.
If abs(x_shadow-posx(10)-20)<2 and abs(y_shadow-Posy(5))<2 then.
Temp_velocidad_shadow=temp_velocidad_shadow/2.
If dirección_shadow=2 then x_shadow=posx(1).
Endif.
If abs(x_spedy-posx(10)-20)<2 and abs(y_spedy-Posy(5))<2 then.
Temp_velocidad_spedy=temp_velocidad_spedy/2.
If dirección_spedy=2 then x_spedy=posx(1).
Endif.
If abs(x_bashful-posx(10)-20)<2 and abs(y_bashful-Posy(5))<2 then.
Temp_velocidad_bashful=temp_velocidad_bashful/2.
If dirección_bashful=2 then x_bashful=posx(1).
Endif.
If abs(x_pokey-posx(10)-20)<2 and abs(y_pokey-Posy(5))<2 then.
Temp_velocidad_pokey=temp_velocidad_pokey/2.
If dirección_pokey=2 then x_pokey=posx(1).
Endif.
Fila 6----------------------------------------------
If abs(xpacman-posx(4))<2 and abs(ypacman-Posy(6))<2 then.
If dirección_pacman=4 then dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(20 then dirección_pacman=3.
If keydown(205) then dirección_pacman=2.
Endif.
If abs(x_shadow-posx(4))<2 and abs(y_shadow-Posy(6))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=5 then horientación_shadow=Rand(1,2).
If horientación_shadow=6 then horientación_shadow=Rand(2,3).
If horientación_shadow=8 then horientación_shadow=1.
If horientación_shadow=7 then horientación_shadow=3.
If horientación_shadow=4 or horientación_shadow=2 then.
If sorteo=1 then horientación_shadow=3 else horientación_shadow=1.
Endif.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(3).
While dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(3).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=1.
Endif.
Endif.
If abs(x_spedy-posx(4))<2 and abs(y_spedy-Posy(6))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=5 then horientación_spedy=Rand(1,2).
If horientación_spedy=6 then horientación_spedy=Rand(2,3).
If horientación_spedy=8 then horientación_spedy=1.
If horientación_spedy=7 then horientación_spedy=3.
If horientación_spedy=4 or horientación_spedy=2 then.
If sorteo=1 then horientación_spedy=3 else horientación_spedy=1.
Endif.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(3).
While dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(3).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=1.
Endif.
Endif.
If abs(x_bashful-posx(4))<2 and abs(y_bashful-Posy(6))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=5 then horientación_bashful=Rand(1,2).
If horientación_bashful=6 then horientación_bashful=Rand(2,3).
If horientación_bashful=8 then horientación_bashful=1.
If horientación_bashful=7 then horientación_bashful=3.
If horientación_bashful=4 or horientación_bashful=2 then.
If sorteo=1 then horientación_bashful=3 else horientación_bashful=1.
Endif.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(3).
While dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(3).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=1.
Endif.
Endif.
If abs(x_pokey-posx(4))<2 and abs(y_pokey-Posy(6))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=5 then horientación_pokey=Rand(1,2).
If horientación_pokey=6 then horientación_pokey=Rand(2,3).
If horientación_pokey=8 then horientación_pokey=1.
If horientación_pokey=7 then horientación_pokey=3.
If horientación_pokey=4 or horientación_pokey=2 then.
If sorteo=1 then horientación_pokey=3 else horientación_pokey=1.
Endif.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(3).
While dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(3).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=1.
Endif.
Endif.
If abs(xpacman-posx(7))<2 and abs(ypacman-Posy(6))<2 then.
If dirección_pacman=2 then dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(20 then dirección_pacman=3.
If keydown(203) then dirección_pacman=4.
Endif.
If abs(x_shadow-posx(7))<2 and abs(y_shadow-Posy(6))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=5 then horientación_shadow=1.
If horientación_shadow=7 then horientación_shadow=Rand(3,4).
If horientación_shadow=8 then horientación_shadow=Rand(4).
If horientación_shadow=6 then horientación_shadow=3.
If horientación_shadow=4 or horientación_shadow=2 then.
If sorteo=1 then horientación_shadow=3 else horientación_shadow=1.
Endif.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(4).
While dirección_shadow=2 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=1.
Endif.
Endif.
If abs(x_spedy-posx(7))<2 and abs(y_spedy-Posy(6))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=5 then horientación_spedy=1.
If horientación_spedy=7 then horientación_spedy=Rand(3,4).
If horientación_spedy=8 then horientación_spedy=Rand(4).
If horientación_spedy=6 then horientación_spedy=3.
If horientación_spedy=4 or horientación_spedy=2 then.
If sorteo=1 then horientación_spedy=3 else horientación_spedy=1.
Endif.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(4).
While dirección_spedy=2 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=1.
Endif.
Endif.
If abs(x_bashful-posx(7))<2 and abs(y_bashful-Posy(6))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=5 then horientación_bashful=1.
If horientación_bashful=7 then horientación_bashful=Rand(3,4).
If horientación_bashful=8 then horientación_bashful=Rand(4).
If horientación_bashful=6 then horientación_bashful=3.
If horientación_bashful=4 or horientación_bashful=2 then.
If sorteo=1 then horientación_bashful=3 else horientación_bashful=1.
Endif.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(4).
While dirección_bashful=2 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=1.
Endif.
Endif.
If abs(x_pokey-posx(7))<2 and abs(y_pokey-Posy(6))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=5 then horientación_pokey=1.
If horientación_pokey=7 then horientación_pokey=Rand(3,4).
If horientación_pokey=8 then horientación_pokey=Rand(4).
If horientación_pokey=6 then horientación_pokey=3.
If horientación_pokey=4 or horientación_pokey=2 then.
If sorteo=1 then horientación_pokey=3 else horientación_pokey=1.
Endif.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(4).
While dirección_pokey=2 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=1.
Endif.
Endif.
Fila 7----------------------------------------------
If abs(xpacman-posx(4))<2 and abs(ypacman-Posy(7))<2 then.
If dirección_pacman=3 then dirección_pacman=0.
If keydown(205) then dirección_pacman=2.
If keydown(200) then dirección_pacman=1.
If keydown(203) then dirección_pacman=4.
Endif.
If abs(x_shadow-posx(4))<2 and abs(y_shadow-Posy(7))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=5 then horientación_shadow=Rand(2).
If horientación_shadow=6 then horientación_shadow=Rand(2).
If horientación_shadow=7 then horientación_shadow=4.
If horientación_shadow=8 then horientación_shadow=Rand(4).
If horientación_shadow=3 then.
If sorteo=1 then horientación_shadow=2 else horientación_shadow=4.
Endif.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=3 then.
If sorteo=1 then horientación_shadow=4 else horientación_shadow=2.
Endif.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(4).
If dirección_shadow=3 then dirección_shadow=Rand(4).
While dirección_shadow=3 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=1.
Endif.
Endif.
If abs(x_spedy-posx(4))<2 and abs(y_spedy-Posy(7))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=5 then horientación_spedy=Rand(2).
If horientación_spedy=6 then horientación_spedy=Rand(2).
If horientación_spedy=7 then horientación_spedy=4.
If horientación_spedy=8 then horientación_spedy=Rand(4).
If horientación_spedy=3 then.
If sorteo=1 then horientación_spedy=2 else horientación_spedy=4.
Endif.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=3 then.
If sorteo=1 then horientación_spedy=4 else horientación_spedy=2.
Endif.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(4).
If dirección_spedy=3 then dirección_spedy=Rand(4).
While dirección_spedy=3 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=1.
Endif.
Endif.
If abs(x_bashful-posx(4))<2 and abs(y_bashful-Posy(7))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=5 then horientación_bashful=Rand(2).
If horientación_bashful=6 then horientación_bashful=Rand(2).
If horientación_bashful=7 then horientación_bashful=4.
If horientación_bashful=8 then horientación_bashful=Rand(4).
If horientación_bashful=3 then.
If sorteo=1 then horientación_bashful=2 else horientación_bashful=4.
Endif.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=3 then.
If sorteo=1 then horientación_bashful=4 else horientación_bashful=2.
Endif.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(4).
If dirección_bashful=3 then dirección_bashful=Rand(4).
While dirección_bashful=3 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=1.
Endif.
Endif.
If abs(x_pokey-posx(4))<2 and abs(y_pokey-Posy(7))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=5 then horientación_pokey=Rand(2).
If horientación_pokey=6 then horientación_pokey=Rand(2).
If horientación_pokey=7 then horientación_pokey=4.
If horientación_pokey=8 then horientación_pokey=Rand(4).
If horientación_pokey=3 then.
If sorteo=1 then horientación_pokey=2 else horientación_pokey=4.
Endif.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=3 then.
If sorteo=1 then horientación_pokey=4 else horientación_pokey=2.
Endif.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(4).
If dirección_pokey=3 then dirección_pokey=Rand(4).
While dirección_pokey=3 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=1.
Endif.
Endif.
If abs(xpacman-posx(7))<2 and abs(ypacman-Posy(7))<2 then.
If dirección_pacman=3 then dirección_pacman=0.
If keydown(205) then dirección_pacman=2.
If keydown(200) then dirección_pacman=1.
If keydown(203) then dirección_pacman=4.
Endif.
If abs(x_shadow-posx(7))<2 and abs(y_shadow-Posy(7))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=5 then horientación_shadow=Rand(2).
If horientación_shadow=6 then horientación_shadow=2.
If horientación_shadow=7 then horientación_shadow=4.
If horientación_shadow=8 then horientación_shadow=1.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(4).
While dirección_shadow=3 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=1.
Endif.
Endif.
If abs(x_spedy-posx(7))<2 and abs(y_spedy-Posy(7))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=5 then horientación_spedy=Rand(2).
If horientación_spedy=6 then horientación_spedy=2.
If horientación_spedy=7 then horientación_spedy=4.
If horientación_spedy=8 then horientación_spedy=1.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(4).
While dirección_spedy=3 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=1.
Endif.
Endif.
If abs(x_bashful-posx(7))<2 and abs(y_bashful-Posy(7))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=5 then horientación_bashful=Rand(2).
If horientación_bashful=6 then horientación_bashful=2.
If horientación_bashful=7 then horientación_bashful=4.
If horientación_bashful=8 then horientación_bashful=1.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(4).
While dirección_bashful=3 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=1.
Endif.
Endif.
If abs(x_pokey-posx(7))<2 and abs(y_pokey-Posy(7))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=5 then horientación_pokey=Rand(2).
If horientación_pokey=6 then horientación_pokey=2.
If horientación_pokey=7 then horientación_pokey=4.
If horientación_pokey=8 then horientación_pokey=1.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(4).
While dirección_pokey=3 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=1.
Endif.
Endif.
Fila 8----------------------------------------------
If abs(xpacman-posx(2))<2 and abs(ypacman-Posy()<2 then.
Dirección_pacman=0.
If keydown(203) then dirección_pacman=4.
If keydown(20 then dirección_pacman=3.
Endif.
If abs(x_shadow-posx(2))<2 and abs(y_shadow-Posy()<2 then.
If dirección_shadow=2 then dirección_shadow=3.
If dirección_shadow=1 then dirección_shadow=4.
Endif.
If abs(x_spedy-posx(2))<2 and abs(y_spedy-Posy()<2 then.
If dirección_spedy=2 then dirección_spedy=3.
If dirección_spedy=1 then dirección_spedy=4.
Endif.
If abs(x_bashful-posx(2))<2 and abs(y_bashful-Posy()<2 then.
If dirección_bashful=2 then dirección_bashful=3.
If dirección_bashful=1 then dirección_bashful=4.
Endif.
If abs(x_pokey-posx(2))<2 and abs(y_pokey-Posy()<2 then.
If dirección_pokey=2 then dirección_pokey=3.
If dirección_pokey=1 then dirección_pokey=4.
Endif.
If abs(xpacman-posx(3))<2 and abs(ypacman-Posy()<2 then.
If dirección_pacman=4 then dirección_pacman=0.
If keydown(205) then dirección_pacman=2.
If keydown(200) then dirección_pacman=1.
If keydown(20 then dirección_pacman=3.
Endif.
If abs(x_shadow-posx(3))<2 and abs(y_shadow-Posy()<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=5 then horientación_shadow=Rand(2).
If horientación_shadow=6 then horientación_shadow=Rand(2,3).
If horientación_shadow=8 then horientación_shadow=1.
If horientación_shadow=7 then horientación_shadow=3.
If horientación_shadow=4 or horientación_shadow=2 then.
If sorteo=1 then horientación_shadow=3 else horientación_shadow=1.
Endif.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(3).
While dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(3).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=1.
Endif.
Endif.
If abs(x_spedy-posx(3))<2 and abs(y_spedy-Posy()<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=5 then horientación_spedy=Rand(2).
If horientación_spedy=6 then horientación_spedy=Rand(2,3).
If horientación_spedy=8 then horientación_spedy=1.
If horientación_spedy=7 then horientación_spedy=3.
If horientación_spedy=4 or horientación_spedy=2 then.
If sorteo=1 then horientación_spedy=3 else horientación_spedy=1.
Endif.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(3).
While dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(3).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=1.
Endif.
Endif.
If abs(x_bashful-posx(3))<2 and abs(y_bashful-Posy()<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=5 then horientación_bashful=Rand(2).
If horientación_bashful=6 then horientación_bashful=Rand(2,3).
If horientación_bashful=8 then horientación_bashful=1.
If horientación_bashful=7 then horientación_bashful=3.
If horientación_bashful=4 or horientación_bashful=2 then.
If sorteo=1 then horientación_bashful=3 else horientación_bashful=1.
Endif.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(3).
While dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(3).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=1.
Endif.
Endif.
If abs(x_pokey-posx(3))<2 and abs(y_pokey-Posy()<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=5 then horientación_pokey=Rand(2).
If horientación_pokey=6 then horientación_pokey=Rand(2,3).
If horientación_pokey=8 then horientación_pokey=1.
If horientación_pokey=7 then horientación_pokey=3.
If horientación_pokey=4 or horientación_pokey=2 then.
If sorteo=1 then horientación_pokey=3 else horientación_pokey=1.
Endif.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(3).
While dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(3).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=1.
Endif.
Endif.
If abs(xpacman-posx()<2 and abs(ypacman-Posy()<2 then.
If dirección_pacman=2 then dirección_pacman=0.
If keydown(203) then dirección_pacman=4.
If keydown(20 then dirección_pacman=3.
If keydown(200) then dirección_pacman=1.
Endif.
If abs(x_shadow-posx()<2 and abs(y_shadow-Posy()<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=5 or horientación_shadow=8 then horientación_shadow=1.
If horientación_shadow=6 or horientación_shadow=7 then horientación_shadow=3.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(3,4).
While dirección_shadow=2 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=1.
Endif.
Endif.
If abs(x_spedy-posx()<2 and abs(y_spedy-Posy()<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=5 or horientación_spedy=8 then horientación_spedy=1.
If horientación_spedy=6 or horientación_spedy=7 then horientación_spedy=3.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(3,4).
While dirección_spedy=2 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=1.
Endif.
Endif.
If abs(x_bashful-posx()<2 and abs(y_bashful-Posy()<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=5 or horientación_bashful=8 then horientación_bashful=1.
If horientación_bashful=6 or horientación_bashful=7 then horientación_bashful=3.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(3,4).
While dirección_bashful=2 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=1.
Endif.
Endif.
If abs(x_pokey-posx()<2 and abs(y_pokey-Posy()<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=5 or horientación_pokey=8 then horientación_pokey=1.
If horientación_pokey=6 or horientación_pokey=7 then horientación_pokey=3.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(3,4).
While dirección_pokey=2 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=1.
Endif.
Endif.
If abs(xpacman-posx(9))<2 and abs(ypacman-Posy()<2 then.
Dirección_pacman=0.
If keydown(205) then dirección_pacman=2.
If keydown(20 then dirección_pacman=3.
Endif.
If abs(x_shadow-posx(9))<2 and abs(y_shadow-Posy()<2 then.
If dirección_shadow=4 then dirección_shadow=3.
If dirección_shadow=1 then dirección_shadow=2.
Endif.
If abs(x_spedy-posx(9))<2 and abs(y_spedy-Posy()<2 then.
If dirección_spedy=4 then dirección_spedy=3.
If dirección_spedy=1 then dirección_spedy=2.
Endif.
If abs(x_bashful-posx(9))<2 and abs(y_bashful-Posy()<2 then.
If dirección_bashful=4 then dirección_bashful=3.
If dirección_bashful=1 then dirección_bashful=2.
Endif.
If abs(x_pokey-posx(9))<2 and abs(y_pokey-Posy()<2 then.
If dirección_pokey=4 then dirección_pokey=3.
If dirección_pokey=1 then dirección_pokey=2.
Endif.
Fila 9----------------------------------------------
If (abs(xpacman-posx(2))<2 or abs(xpacman-posx(9))<2) and abs(ypacman-Posy(9))<2 then.
If dirección_pacman=3 then dirección_pacman=0.
If keydown(205) then dirección_pacman=2.
If keydown(200) then dirección_pacman=1.
If keydown(203) then dirección_pacman=4.
Endif.
If (abs(x_shadow-posx(2))<2 or abs(x_shadow-posx(9))<2) and abs(y_shadow-Posy(9))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=3 then horientación_shadow=4.
If horientación_shadow=6 then horientación_shadow=4.
If horientación_shadow=5 then horientación_shadow=Rand(2).
If horientación_shadow=7 then horientación_shadow=4.
If horientación_shadow=8 then horientación_shadow=1.
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(2).
While dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(2).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=1.
Endif.
Endif.
If (abs(x_spedy-posx(2))<2 or abs(x_spedy-posx(9))<2) and abs(y_spedy-Posy(9))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=3 then horientación_spedy=4.
If horientación_spedy=6 then horientación_spedy=4.
If horientación_spedy=5 then horientación_spedy=Rand(2).
If horientación_spedy=7 then horientación_spedy=4.
If horientación_spedy=8 then horientación_spedy=1.
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(2).
While dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(2).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=1.
Endif.
Endif.
If (abs(x_bashful-posx(2))<2 or abs(x_bashful-posx(9))<2) and abs(y_bashful-Posy(9))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=3 then horientación_bashful=4.
If horientación_bashful=6 then horientación_bashful=4.
If horientación_bashful=5 then horientación_bashful=Rand(2).
If horientación_bashful=7 then horientación_bashful=4.
If horientación_bashful=8 then horientación_bashful=1.
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(2).
While dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(2).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=1.
Endif.
Endif.
If (abs(x_pokey-posx(2))<2 or abs(x_pokey-posx(9))<2) and abs(y_pokey-Posy(9))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=3 then horientación_pokey=4.
If horientación_pokey=6 then horientación_pokey=4.
If horientación_pokey=5 then horientación_pokey=Rand(2).
If horientación_pokey=7 then horientación_pokey=4.
If horientación_pokey=8 then horientación_pokey=1.
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(2).
While dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(2).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=1.
Endif.
Endif.
If (abs(xpacman-posx(3))<2 or abs(xpacman-posx(7))<2) and abs(ypacman-Posy(9))<2 then.
Dirección_pacman=0.
If keydown(200) then dirección_pacman=1.
If keydown(203) then dirección_pacman=4.
Endif.
If (abs(x_shadow-posx(3))<2 or abs(x_shadow-posx(7))<2) and abs(y_shadow-Posy(9))<2 then.
If dirección_shadow=2 then dirección_shadow=1.
If dirección_shadow=3 then dirección_shadow=4.
Endif.
If (abs(x_spedy-posx(3))<2 or abs(x_spedy-posx(7))<2) and abs(y_spedy-Posy(9))<2 then.
If dirección_spedy=2 then dirección_spedy=1.
If dirección_spedy=3 then dirección_spedy=4.
Endif.
If (abs(x_bashful-posx(3))<2 or abs(x_bashful-posx(7))<2) and abs(y_bashful-Posy(9))<2 then.
If dirección_bashful=2 then dirección_bashful=1.
If dirección_bashful=3 then dirección_bashful=4.
Endif.
If (abs(x_pokey-posx(3))<2 or abs(x_pokey-posx(7))<2) and abs(y_pokey-Posy(9))<2 then.
If dirección_pokey=2 then dirección_pokey=1.
If dirección_pokey=3 then dirección_pokey=4.
Endif.
If (abs(xpacman-posx(4))<2 or abs(xpacman-posx()<2) and abs(ypacman-Posy(9))<2 then.
Dirección_pacman=0.
If keydown(205) then dirección_pacman=2.
If keydown(200) then dirección_pacman=1.
Endif.
If (abs(x_shadow-posx(4))<2 or abs(x_shadow-posx()<2) and abs(y_shadow-Posy(9))<2 then.
If dirección_shadow=4 then dirección_shadow=1.
If dirección_shadow=3 then dirección_shadow=2.
Endif.
If (abs(x_spedy-posx(4))<2 or abs(x_spedy-posx()<2) and abs(y_spedy-Posy(9))<2 then.
If dirección_spedy=4 then dirección_spedy=1.
If dirección_spedy=3 then dirección_spedy=2.
Endif.
If (abs(x_bashful-posx(4))<2 or abs(x_bashful-posx()<2) and abs(y_bashful-Posy(9))<2 then.
If dirección_bashful=4 then dirección_bashful=1.
If dirección_bashful=3 then dirección_bashful=2.
Endif.
If (abs(x_pokey-posx(4))<2 or abs(x_pokey-posx()<2) and abs(y_pokey-Posy(9))<2 then.
If dirección_pokey=4 then dirección_pokey=1.
If dirección_pokey=3 then dirección_pokey=2.
Endif.
Fila 10----------------------------------------------
If (abs(xpacman-posx(5))<2 or abs(xpacman-posx(6))<2) and abs(ypacman-Posy(10))<2 then.
If dirección_pacman=3 then dirección_pacman=0.
If keydown(205) then dirección_pacman=2.
If keydown(200) then dirección_pacman=1.
If keydown(203) then dirección_pacman=4.
Endif.
If (abs(x_shadow-posx(5))<2 or abs(x_shadow-posx(6))<2) and abs(y_shadow-Posy(10))<2 then.
If bloqueo=0 then.
Bloqueo=bloqueo+20.
Sorteo=Rand(2).
Dirección_shadow=0.
If horientación_shadow=5 then horientación_shadow=Rand(4).
If horientación_shadow=8 then horientación_shadow=Rand(4).
If horientación_shadow<5 then dirección_shadow=horientación_shadow.
If dirección_shadow=dirección_inversa_shadow then dirección_shadow=Rand(4).
While dirección_shadow=3 or dirección_shadow=dirección_inversa_shadow.
Dirección_shadow=Rand(4).
Wend.
If status_fantasmas(1)=2 then dirección_shadow=1.
Endif.
Endif.
If (abs(x_spedy-posx(5))<2 or abs(x_spedy-posx(6))<2) and abs(y_spedy-Posy(10))<2 then.
If bloqueo2=0 then.
Bloqueo2=bloqueo2+20.
Sorteo=Rand(2).
Dirección_spedy=0.
If horientación_spedy=5 then horientación_spedy=Rand(4).
If horientación_spedy=8 then horientación_spedy=Rand(4).
If horientación_spedy<5 then dirección_spedy=horientación_spedy.
If dirección_spedy=dirección_inversa_spedy then dirección_spedy=Rand(4).
While dirección_spedy=3 or dirección_spedy=dirección_inversa_spedy.
Dirección_spedy=Rand(4).
Wend.
If status_fantasmas(2)=2 then dirección_spedy=1.
Endif.
Endif.
If (abs(x_bashful-posx(5))<2 or abs(x_bashful-posx(6))<2) and abs(y_bashful-Posy(10))<2 then.
If bloqueo3=0 then.
Bloqueo3=bloqueo3+20.
Sorteo=Rand(2).
Dirección_bashful=0.
If horientación_bashful=5 then horientación_bashful=Rand(4).
If horientación_bashful=8 then horientación_bashful=Rand(4).
If horientación_bashful<5 then dirección_bashful=horientación_bashful.
If dirección_bashful=dirección_inversa_bashful then dirección_bashful=Rand(4).
While dirección_bashful=3 or dirección_bashful=dirección_inversa_bashful.
Dirección_bashful=Rand(4).
Wend.
If status_fantasmas(3)=2 then dirección_bashful=1.
Endif.
Endif.
If (abs(x_pokey-posx(5))<2 or abs(x_pokey-posx(6))<2) and abs(y_pokey-Posy(10))<2 then.
If bloqueo4=0 then.
Bloqueo4=bloqueo4+20.
Sorteo=Rand(2).
Dirección_pokey=0.
If horientación_pokey=5 then horientación_pokey=Rand(4).
If horientación_pokey=8 then horientación_pokey=Rand(4).
If horientación_pokey<5 then dirección_pokey=horientación_pokey.
If dirección_pokey=dirección_inversa_pokey then dirección_pokey=Rand(4).
While dirección_pokey=3 or dirección_pokey=dirección_inversa_pokey.
Dirección_pokey=Rand(4).
Wend.
If status_fantasmas(4)=2 then dirección_pokey=1.
Endif.
Endif.
Fin de los ejes-.
Desplazamientos.
If pacman_status=1 then.
If dirección_pacman=1 and keydown(20 then dirección_pacman=3.
If dirección_pacman=2 and keydown(203) then dirección_pacman=4.
If dirección_pacman=3 and keydown(200) then dirección_pacman=1.
If dirección_pacman=4 and keydown(205) then dirección_pacman=2.
If dirección_pacman=1 then ypacman=ypacman-temp_velocidad.
If dirección_pacman=2 then xpacman=xpacman+temp_velocidad.
If dirección_pacman=3 then ypacman=ypacman+temp_velocidad.
If dirección_pacman=4 then xpacman=xpacman-temp_velocidad.
If dirección_shadow=1 then y_shadow=y_shadow-temp_velocidad_shadow.
If dirección_shadow=2 then x_shadow=x_shadow+temp_velocidad_shadow.
If dirección_shadow=3 then y_shadow=y_shadow+temp_velocidad_shadow.
If dirección_shadow=4 then x_shadow=x_shadow-temp_velocidad_shadow.
If dirección_spedy=1 then y_spedy=y_spedy-temp_velocidad_spedy.
If dirección_spedy=2 then x_spedy=x_spedy+temp_velocidad_spedy.
If dirección_spedy=3 then y_spedy=y_spedy+temp_velocidad_spedy.
If dirección_spedy=4 then x_spedy=x_spedy-temp_velocidad_spedy.
If dirección_bashful=1 then y_bashful=y_bashful-temp_velocidad_bashful.
If dirección_bashful=2 then x_bashful=x_bashful+temp_velocidad_bashful.
If dirección_bashful=3 then y_bashful=y_bashful+temp_velocidad_bashful.
If dirección_bashful=4 then x_bashful=x_bashful-temp_velocidad_bashful.
If dirección_pokey=1 then y_pokey=y_pokey-temp_velocidad_pokey.
If dirección_pokey=2 then x_pokey=x_pokey+temp_velocidad_pokey.
If dirección_pokey=3 then y_pokey=y_pokey+temp_velocidad_pokey.
If dirección_pokey=4 then x_pokey=x_pokey-temp_velocidad_pokey.
Endif.
Pantalla.
Impresión en pantalla.
Drawimage pantalla,182,1,0.
Dibujando bolas---------------------------------------------------------------------------------------------
For z=1 todo 26.
If z<>13 and z<>14 then.
Drawimage bolas(z), posx(1)+(z*17.35)-8, Posy(1)+10.
If ImagesCollide (bolas(z), posx(1)+(z*17.35)-8, Posy(1)+10,0, Pacman,xpacman, ypacman,14) then.
Bolas(z)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 26 bolas.
For z=1 todo 26.
Drawimage bolas(z+26), posx(1)+(z*17.35)-8, Posy(2)+10.
If ImagesCollide (bolas(z+26), posx(1)+(z*17.35)-8, Posy(2)+10,0, Pacman,xpacman, ypacman,14) then.
Bolas(z+26)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Next ;llevo 50 bolas.
For z=1 todo 26.
If z<>7 and z<>8 and z<>13 and z<>14 and z<>19 and z<>20 then.
Drawimage bolas(z+52), posx(1)+(z*17.35)-8, Posy(3)+10.
If ImagesCollide (bolas(z+52), posx(1)+(z*17.35)-8, Posy(3)+10,0, Pacman,xpacman, ypacman,14) then.
Bolas(z+52)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 70 bolas.
For z=1 todo 26.
If z<>13 and z<>14 then.
Drawimage bolas(z+7, posx(1)+(z*17.35)-8, Posy(7)+10.
If ImagesCollide (bolas(z+7, posx(1)+(z*17.35)-8, Posy(7)+10,0, Pacman,xpacman, ypacman,14) then.
Bolas(z+7 =copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 94 bolas.
For z=1 todo 26.
If z<>1 and z<>4 and z<>5 and z<>22 and z<>23 and z<>26 and z<>13 and z<>14 then.
Drawimage bolas(z+104), posx(1)+(z*17.35)-8, Posy(+10.
If ImagesCollide (bolas(z+104), posx(1)+(z*17.35)-8, Posy(+10,0, Pacman,xpacman, ypacman,14) then.
Bolas(z+104)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 112 bolas.
For z=1 todo 26.
If z<>7 and z<>8 and z<>13 and z<>14 and z<>19 and z<>20 then.
Drawimage bolas(z+130), posx(1)+(z*17.35)-8, Posy(9)+10.
If ImagesCollide (bolas(z+130), posx(1)+(z*17.35)-8, Posy(9)+10,0, Pacman,xpacman, ypacman,14) then.
Bolas(z+130)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 132 bolas.
For z=1 todo 26.
Drawimage bolas(z+156), posx(1)+(z*17.35)-8, Posy(10)+10.
If ImagesCollide (bolas(z+156), posx(1)+(z*17.35)-8, Posy(10)+10,0, Pacman,xpacman, ypacman,14) then.
Bolas(z+156)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Next ;llevo 156 bolas.
Bolas grandes.
Drawimage granbolas(1), posx(1)+9, Posy(1)+10+(2*18.17).
If ImagesCollide (granbolas(1), posx(1)+9, Posy(1)+10+(2*18.17),0, Pacman,xpacman, ypacman,14) then.
Granbolas(1)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+50.
Stopchannel(fantasmas_azules).
Playsound come : status_fantasma=0 : fantasmas_azules=playsound(azules) : stopchannel(andando).
Contador_velocidad=0.
Contador_fantasmas=0.
Temp_frame=26.
If status_fantasmas(1)=1 then dirección_shadow=dirección_inversa_shadow.
If status_fantasmas(2)=1 then dirección_spedy=dirección_inversa_spedy.
If status_fantasmas(3)=1 then dirección_bashful=dirección_inversa_bashful.
If status_fantasmas(4)=1 then dirección_pokey=dirección_inversa_pokey.
For n=1 todo 4.
If status_fantasmas(n)=1 then status_fantasmas(n)=0.
Next.
Endif.
Drawimage granbolas(2), posx(10)+7, Posy(1)+10+(2*18.17).
If ImagesCollide (granbolas(2), posx(10)+9, Posy(1)+10+(2*18.17),0, Pacman,xpacman, ypacman,14) then.
Granbolas(2)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+50.
Stopchannel(fantasmas_azules).
Playsound come : status_fantasma=0 : fantasmas_azules=playsound(azules) : stopchannel(andando).
Contador_velocidad=0.
Contador_fantasmas=0.
Temp_frame=26.
If status_fantasmas(1)=1 then dirección_shadow=dirección_inversa_shadow.
If status_fantasmas(2)=1 then dirección_spedy=dirección_inversa_spedy.
If status_fantasmas(3)=1 then dirección_bashful=dirección_inversa_bashful.
If status_fantasmas(4)=1 then dirección_pokey=dirección_inversa_pokey.
For n=1 todo 4.
If status_fantasmas(n)=1 then status_fantasmas(n)=0.
Next.
Endif.
Drawimage granbolas(3), posx(1)+(1*17.35)-8, Posy(+10.
If ImagesCollide (granbolas(3), posx(1)+(1*17.35)-8, Posy(+10,0, Pacman,xpacman, ypacman,14) then.
Granbolas(3)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+50.
Stopchannel(fantasmas_azules).
Playsound come : status_fantasma=0 : fantasmas_azules=playsound(azules) : stopchannel(andando).
Contador_velocidad=0.
Contador_fantasmas=0.
Temp_frame=26.
If status_fantasmas(1)=1 then dirección_shadow=dirección_inversa_shadow.
If status_fantasmas(2)=1 then dirección_spedy=dirección_inversa_spedy.
If status_fantasmas(3)=1 then dirección_bashful=dirección_inversa_bashful.
If status_fantasmas(4)=1 then dirección_pokey=dirección_inversa_pokey.
For n=1 todo 4.
If status_fantasmas(n)=1 then status_fantasmas(n)=0.
Next.
Endif.
Drawimage granbolas(4), posx(10)+8, Posy(+10.
If ImagesCollide (granbolas(4), posx(10)+8, Posy(+10,0, Pacman,xpacman, ypacman,14) then.
Granbolas(4)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+50.
Stopchannel(fantasmas_azules).
Playsound come : status_fantasma=0 : fantasmas_azules=playsound(azules) : stopchannel(andando).
Contador_velocidad=0.
Contador_fantasmas=0.
Temp_frame=26.
If status_fantasmas(1)=1 then dirección_shadow=dirección_inversa_shadow.
If status_fantasmas(2)=1 then dirección_spedy=dirección_inversa_spedy.
If status_fantasmas(3)=1 then dirección_bashful=dirección_inversa_bashful.
If status_fantasmas(4)=1 then dirección_pokey=dirección_inversa_pokey.
For n=1 todo 4.
If status_fantasmas(n)=1 then status_fantasmas(n)=0.
Next.
Endif.
For z=1 todo 27;comienza el eje Y.
If z=1 or z=3 or z=5 or z=6 or z=20 or z=21 or z=26 or z=27 then.
Drawimage bolas(z+182), posx(1)+9, Posy(1)+10+(z*18.17).
If ImagesCollide (bolas(z+182), posx(1)+9, Posy(1)+10+(z*18.17),0, Pacman,xpacman, ypacman,14) then.
Bolas(z+182)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 164 bolas.
For z=1 todo 27.
If z=24 or z=23 then.
Drawimage bolas(z+209), posx(2)+9, Posy(1)+10+(z*18.17).
If ImagesCollide (bolas(z+209), posx(2)+9, Posy(1)+10+(z*18.17),0, Pacman,xpacman, ypacman,14) then.
Bolas(z+209)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 166 bolas.
For z=1 todo 27.
If z=1 or z=2 or z=3 or z=5 or z=6 or (z>7 and z<19) or z=20 or z=21 or z=23 or z=24 then.
Drawimage bolas(z+236), posx(3)+8, Posy(1)+10+(z*18.17).
If ImagesCollide (bolas(z+236), posx(3)+8, Posy(1)+10+(z*18.17),0, Pacman,xpacman, ypacman,14) then.
Bolas(z+236)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 186 bolas.
For z=1 todo 27.
If z=24 or z=23 or z=5 or z=6 then.
Drawimage bolas(z+263), posx(4)+7, Posy(1)+10+(z*18.17).
If ImagesCollide (bolas(z+263), posx(4)+6, Posy(1)+10+(z*18.17),0, Pacman,xpacman, ypacman,14) then.
Bolas(z+263)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 190 bolas.
For z=1 todo 27.
If z=1 or z=2 or z=3 or z=26 or z=27 or z=20 or z=21 then.
Drawimage bolas(z+290), posx(5)+7, Posy(1)+10+(z*18.17).
If ImagesCollide (bolas(z+290), posx(5)+6, Posy(1)+10+(z*18.17),0, Pacman,xpacman, ypacman,14) then.
Bolas(z+290)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 197 bolas.
For z=1 todo 27.
If z=1 or z=2 or z=3 or z=26 or z=27 or z=20 or z=21 then.
Drawimage bolas(z+317), posx(6)+6, Posy(1)+10+(z*18.17).
If ImagesCollide (bolas(z+317), posx(6)+5, Posy(1)+10+(z*18.17),0, Pacman,xpacman, ypacman,14) then.
Bolas(z+317)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 204 bolas.
For z=1 todo 27.
If z=24 or z=23 or z=5 or z=6 then.
Drawimage bolas(z+344), posx(7)+6, Posy(1)+10+(z*18.17).
If ImagesCollide (bolas(z+344), posx(7)+5, Posy(1)+10+(z*18.17),0, Pacman,xpacman, ypacman,14) then.
Bolas(z+344)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 208 bolas.
For z=1 todo 27.
If z=1 or z=2 or z=3 or z=5 or z=6 or (z>7 and z<19) or z=20 or z=21 or z=23 or z=24 then.
Drawimage bolas(z+371), posx(+6, Posy(1)+10+(z*18.17).
If ImagesCollide (bolas(z+371), posx(+5, Posy(1)+10+(z*18.17),0, Pacman,xpacman, ypacman,14) then.
Bolas(z+371)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 228 bolas.
For z=1 todo 27.
If z=24 or z=23 then.
Drawimage bolas(z+39, posx(9)+5, Posy(1)+10+(z*18.17).
If ImagesCollide (bolas(z+39, posx(9)+5, Posy(1)+10+(z*18.17),0, Pacman,xpacman, ypacman,14) then.
Bolas(z+39 =copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 230 bolas.
For z=1 todo 27.
If z=1 or z=3 or z=5 or z=6 or z=20 or z=21 or z=26 or z=27 then.
Drawimage bolas(z+425), posx(10)+7, Posy(1)+10+(z*18.17).
If ImagesCollide (bolas(z+425), posx(10)+5, Posy(1)+10+(z*18.17),0, Pacman,xpacman, ypacman,14) then.
Bolas(z+425)=copyimage (nullimage) :total_bolas=total_bolas-1 : puntos=puntos+10.
Playsound come.
Contador_velocidad=0.
Endif.
Endif.
Next ;llevo 240 bolas.
Frutas---------------------------
If (fruta_activa=1 or fruta_activa=2) and contador_fruta>1000 then.
Drawimage frutas, posx(5)+26, Posy(6), fruta_level.
If ImagesCollide (frutas, posx(5)+26, Posy(6),0, Pacman,xpacman, ypacman,14) then.
Puntos=puntos+puntos_fruta.
Fruta_activa=fruta_activa+1.
Contador_fruta=0.
Playsound come_fruta.
Display_puntos=1.
Endif.
Endif.
Osd.
If vidas>0 then drawimage Pacman,xpacman, ypacman, frame_pacman.
If Skipframe_muerte<60 and vidas>0 then.
Drawimage shadow,x_shadow, y_shadow, frame_shadow.
Drawimage speedy,x_spedy, y_spedy, frame_spedy.
Drawimage bashful,x_bashful, y_bashful, frame_bashful.
Drawimage pokey,x_pokey, y_pokey, frame_pokey.
Endif.
If display_puntos>0 then.
Drawimage frutas, posx(5)+26, Posy(6), fruta_level+8.
Endif.
If display_puntos_fantasmas>0 then.
Drawimage Pacman, temp_x, temp_y, temp_frame.
If display_puntos_fantasmas=10 then delay 700.
Endif.
For z=1 todo level.
If z=1 or z=2 then x=z.
If z=3 or z=4 then x=3.
If z=5 or z=6 then x=4.
If z=7 or z=8 then x=5.
If z=9 or z=10 then x=6.
If z=11 or z=12 then x=7.
If z>12 then x=0.
Drawimage frutas, posx(10)-z*32, Posy(10)+40,x.
Next.
For z=2 todo vidas.
If vidas>1 then drawimage Pacman, posx(1)+z*32-75, Posy(10)+45,15.
Next.
Score.
If puntos>récord then récord=puntos.
Color 200,200,200.
Text 90,10,score,true.
Text 90,40, puntos,true.
Text 90,80,hi-score,true.
Text 90,110, récord,true.
Text 100, Posy(10),level, true.
Text 90, Posy(10)+25,int(level),true.
Flushkeys().
If vidas=0 then.
Fileout=writefile (data, dat).
Writeint(fileout, récord).
Closefile (fileout).
Color 255,255,0 topchannel(andando): text posx(5)-32, Posy(6)+8,game over :flip : delay 1000 :waitkey() : goto menú.
Endif.
Waittimer(frametimer).
Flip.
Wend.
Fin del bucle-------
End.
Animación.
Animación del Pacman.
Skipframe_pacman=skipframe1/7.
If Skipframe_fantasma>15 and dirección_shadow=4 then frame_shadow=4.
If Skipframe_fantasma>15 and dirección_shadow=1 then frame_shadow=0.
If Skipframe_fantasma>15 and dirección_shadow=2 then frame_shadow=6.
If Skipframe_fantasma>15 and dirección_shadow=3 then frame_shadow=2.
If Skipframe_fantasma<15 and dirección_shadow=4 then frame_shadow=5.
If Skipframe_fantasma<15 and dirección_shadow=1 then frame_shadow=1.
If Skipframe_fantasma<15 and dirección_shadow=2 then frame_shadow=7.
If Skipframe_fantasma<15 and dirección_shadow=3 then frame_shadow=3.
If Skipframe_fantasma<15 and status_fantasmas(1)=0 then frame_shadow=32.
If Skipframe_fantasma>15 and status_fantasmas(1)=0 then frame_shadow=33.
If Skipframe_fantasma<15 and status_fantasmas(1)=0 and contador_fantasmas>600 then frame_shadow=33.
If Skipframe_fantasma>15 and status_fantasmas(1)=0 and contador_fantasmas>600 then frame_shadow=34.
If eyes(1)=1 and dirección_shadow=1 then frame_shadow=40.
If eyes(1)=1 and dirección_shadow=3 then frame_shadow=41.
If eyes(1)=1 and dirección_shadow=4 then frame_shadow=42.
If eyes(1)=1 and dirección_shadow=2 then frame_shadow=43.
If Skipframe_fantasma>15 and dirección_spedy=4 then frame_spedy=4+8.
If Skipframe_fantasma>15 and dirección_spedy=1 then frame_spedy=0+8.
If Skipframe_fantasma>15 and dirección_spedy=2 then frame_spedy=6+8.
If Skipframe_fantasma>15 and dirección_spedy=3 then frame_spedy=2+8.
If Skipframe_fantasma<15 and dirección_spedy=4 then frame_spedy=5+8.
If Skipframe_fantasma<15 and dirección_spedy=1 then frame_spedy=1+8.
If Skipframe_fantasma<15 and dirección_spedy=2 then frame_spedy=7+8.
If Skipframe_fantasma<15 and dirección_spedy=3 then frame_spedy=3+8.
If Skipframe_fantasma<15 and status_fantasmas(2)=0 then frame_spedy=32.
If Skipframe_fantasma>15 and status_fantasmas(2)=0 then frame_spedy=33.
If Skipframe_fantasma<15 and status_fantasmas(2)=0 and contador_fantasmas>600 then frame_spedy=33.
If Skipframe_fantasma>15 and status_fantasmas(2)=0 and contador_fantasmas>600 then frame_spedy=34.
If eyes(2)=1 and dirección_spedy=1 then frame_spedy=40.
If eyes(2)=1 and dirección_spedy=3 then frame_spedy=41.
If eyes(2)=1 and dirección_spedy=4 then frame_spedy=42.
If eyes(2)=1 and dirección_spedy=2 then frame_spedy=43.
If Skipframe_fantasma>15 and dirección_bashful=4 then frame_bashful=4+16.
If Skipframe_fantasma>15 and dirección_bashful=1 then frame_bashful=0+16.
If Skipframe_fantasma>15 and dirección_bashful=2 then frame_bashful=6+16.
If Skipframe_fantasma>15 and dirección_bashful=3 then frame_bashful=2+16.
If Skipframe_fantasma<15 and dirección_bashful=4 then frame_bashful=5+16.
If Skipframe_fantasma<15 and dirección_bashful=1 then frame_bashful=1+16.
If Skipframe_fantasma<15 and dirección_bashful=2 then frame_bashful=7+16.
If Skipframe_fantasma<15 and dirección_bashful=3 then frame_bashful=3+16.
If Skipframe_fantasma<15 and status_fantasmas(3)=0 then frame_bashful=32.
If Skipframe_fantasma>15 and status_fantasmas(3)=0 then frame_bashful=33.
If Skipframe_fantasma<15 and status_fantasmas(3)=0 and contador_fantasmas>600 then frame_bashful=33.
If Skipframe_fantasma>15 and status_fantasmas(3)=0 and contador_fantasmas>600 then frame_bashful=34.
If eyes(3)=1 and dirección_bashful=1 then frame_bashful=40.
If eyes(3)=1 and dirección_bashful=3 then frame_bashful=41.
If eyes(3)=1 and dirección_bashful=4 then frame_bashful=42.
If eyes(3)=1 and dirección_bashful=2 then frame_bashful=43.
If Skipframe_fantasma>15 and dirección_pokey=4 then frame_pokey=4+24.
If Skipframe_fantasma>15 and dirección_pokey=1 then frame_pokey=0+24.
If Skipframe_fantasma>15 and dirección_pokey=2 then frame_pokey=6+24.
If Skipframe_fantasma>15 and dirección_pokey=3 then frame_pokey=2+24.
If Skipframe_fantasma<15 and dirección_pokey=4 then frame_pokey=5+24.
If Skipframe_fantasma<15 and dirección_pokey=1 then frame_pokey=1+24.
If Skipframe_fantasma<15 and dirección_pokey=2 then frame_pokey=7+24.
If Skipframe_fantasma<15 and dirección_pokey=3 then frame_pokey=3+24.
If Skipframe_fantasma<15 and status_fantasmas(4)=0 then frame_pokey=32.
If Skipframe_fantasma>15 and status_fantasmas(4)=0 then frame_pokey=33.
If Skipframe_fantasma<15 and status_fantasmas(4)=0 and contador_fantasmas>600 then frame_pokey=33.
If Skipframe_fantasma>15 and status_fantasmas(4)=0 and contador_fantasmas>600 then frame_pokey=34.
If eyes(4)=1 and dirección_pokey=1 then frame_pokey=40.
If eyes(4)=1 and dirección_pokey=3 then frame_pokey=41.
If eyes(4)=1 and dirección_pokey=4 then frame_pokey=42.
If eyes(4)=1 and dirección_pokey=2 then frame_pokey=43.
If pacman_status=1 then.
If dirección_pacman=2 then.
If Skipframe_pacman<1 then frame_pacman=2.
If Skipframe_pacman=1 then frame_pacman=3.
If Skipframe_pacman=2 then frame_pacman=4.
Endif.
If dirección_pacman=4 then.
If Skipframe_pacman<1 then frame_pacman=2.
If Skipframe_pacman=1 then frame_pacman=0.
If Skipframe_pacman=2 then frame_pacman=1.
Endif.
If dirección_pacman=1 then.
If Skipframe_pacman<1 then frame_pacman=2.
If Skipframe_pacman=1 then frame_pacman=5.
If Skipframe_pacman=2 then frame_pacman=6.
Endif.
If dirección_pacman=3 then.
If Skipframe_pacman<1 then frame_pacman=2.
If Skipframe_pacman=1 then frame_pacman=8.
If Skipframe_pacman=2 then frame_pacman=9.
Endif.
Endif.
If pacman_status=0 then.
Skipframe_muerte=skipframe_muerte+1.
If Skipframe_muerte=50 then frame_pacman=16 : playsound dead.
If Skipframe_muerte=60 then frame_pacman=17.
If Skipframe_muerte=70 then frame_pacman=18.
If Skipframe_muerte=80 then frame_pacman=19.
If Skipframe_muerte=90 then frame_pacman=20.
If Skipframe_muerte=100 then frame_pacman=21.
If Skipframe_muerte=110 then frame_pacman=22.
If Skipframe_muerte=120 then frame_pacman=23.
If Skipframe_muerte=130 then frame_pacman=24.
If Skipframe_muerte=140 then frame_pacman=25.
If Skipframe_muerte=160 then playsound pip.
If Skipframe_muerte=170 then frame_pacman=26 : playsound pip.
If Skipframe_muerte=200 then.
Frame_pacman=26 : delay 1000 :skipframe_muerte=0 :vidas=vidas-1.
If contador_fruta>1000 then fruta_activa=fruta_activa+1.
Goto newlive.
Endif.
Endif.