1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930
|
program pixfrogger;
import "exec";
global
jue;
ran1;
ran2;
ran3;
ran4;
pantc;
Struct ops;
pantalla_completa;
sonido=1;
musica=1;
lenguaje=-1;
End
elecc;
elecy;
wy;
ranviva[4];
ranpuntos[4];
llegada;
ler;
music;
njoys;
buzz;
string joyname;
buzz_joy;
//SONIDO.INC
wavs[50];
// COMPATIBILIDAD CON XP/VISTA/LINUX (usuarios)
string savegamedir;
string developerpath="/.PiXJuegos/PiXFrogger/";
Local
i; // la variable maestra
begin
njoys=number_joy();
if(njoys>0)
from i=0 to njoys-1;
joyname=JOY_NAME(i);
if(joyname[9]+joyname[10]+joyname[11]+joyname[12]=="Buzz");
buzz=1;
buzz_joy=i;
end
end
end
// C�digo aportado por Devilish Games / Josebita
if(fxi_os==0) //windows
savegamedir=getenv("APPDATA")+developerpath;
if(savegamedir==developerpath) //windows 9x/me
savegamedir=cd();
else
crear_jerarquia(savegamedir);
end
end
if(fxi_os==1) //linux
savegamedir=getenv("HOME")+developerpath;
crear_jerarquia(savegamedir);
end
if(file_exists(savegamedir+"opciones"))
load(savegamedir+"opciones",ops);
full_screen=ops.pantalla_completa;
end
carga_sonidos();
set_mode(640,480,16);
set_fps(30,0);
ler=load_fnt("fnt/puntos.fnt");
load_fpg("fpg/pixfrogger.fpg");
music=load_song("ogg/1.ogg");
sound_freq=44100;
ops.sonido=1;
if(ops.lenguaje==-1) elige_lenguaje(); else logo_pixjuegos(); end
loop
frame;
end
end
process logo_pixjuegos();
begin
delete_text(0);
graph=1;
x=320;
y=240;
z=-10;
from alpha=50 to 255 step 5;
if(key(_enter) or key(_esc)) break; end
frame;
end
timer[0]=0;
while(timer[0]<300) if(scan_code!=0) break; end frame; end
while(scan_code!=0) frame; end
if(ops.musica)
play_song(music,99);
end
menu();
from alpha=alpha to 0 step -10;
frame;
end
end
process menu()
private
tec;
keytime;
tec2;
begin
delete_text(all_text);
from i=1 to 4; ranviva[i]=0; ranpuntos[i]=0; end
elecc=0;
lista(4);
logo(2);
machango();
put_screen(0,3);
x=320;
y=240;
keytime=10;
loop
if(elecc==5)
elecc=0;
end
if(elecc==-1)
elecc=4;
end
if(keytime>0)
keytime--;
end
//elige algo
if(key(_enter)and keytime==0)
sonido(3);
if(elecc==0)
let_me_alone();
wy=0;
elecpersonaje();
break;
end
if(elecc==1)
let_me_alone();
back(3);
logo(2);
opcion();
break;
end
if(elecc==2)
let_me_alone();
back(5);
break;
end
if(elecc==3)
let_me_alone();
if(fxi_os==0)
shell("http://pixjuegos.com");
else
shell("x-www-browser http://pixjuegos.com &");
end
break;
end
if(elecc==4)
guarda_opciones();
exit(0);
end
end
if(key(_down))
if(tec==0)
elecc++;
sonido(2);
tec=1;
end
else
tec=0;
end
if(key(_up))
if(tec2==0)
elecc--;
sonido(2);
tec2=1;
end
else
tec2=0;
end
frame;
end
end
process lista(gr)
begin
x=-200;
y=300;
if(gr==13)
y=276;
end
if(gr==914)
y=220;
end
z=-10;
graph=gr;
if(ops.lenguaje==1)
if(graph==4) graph=911; end
if(graph==13) graph=913; end
end
loop
if(gr!=13) x+=(x-150)/-10; else x+=(x-200)/-10; end
frame;
end
end
process logo(gr)
begin
x=400;
y=-140;
z=-10;
graph=gr;
loop
y+=(y-90)/-10;
frame;
end
end
process movi(gr)
private
con;
begin
x=320;
y=-140;
z=-15;
graph=gr;
loop
con++;
if(con>100)
break;
end
y+=(y-240)/-10;
frame;
end
end
process machango()
private
osc;
begin
z=-20;
graph=500;
loop
osc+=10000;
if(osc>350000)
osc=0;
end
x=(cos(osc)*5)+20;
elecy=y;
if(elecc==0)
y=190;
end
if(elecc==1)
y=245;
end
if(elecc==2)
y=245+55;
end
if(elecc==3)
y=245+55+55;
end
if(elecc==4)
y=245+55+55+55;
end
frame;
end
end
process back(graph)
private
keytime;
begin
x=320;
y=240;
keytime=10;
if(graph==5 and ops.lenguaje==1) graph=912; end
loop
if(key(_esc))
let_me_alone();
sonido(1);
menu();
break;
end
//ayuda y tal
if(graph==5 or graph==912)
if(key(_enter) and keytime==0)
sonido(3);
let_me_alone();
menu();
break;
keytime=10;
end
if(keytime>0)
keytime--;
end
end
frame;
end
end
process opcion();
private
tec;
tec2;
tecenter;
begin
elecc=0;
lista(13);
machango();
wy=-100;
tecenter=1;
loop
if(key(_esc))
let_me_alone();
menu();
break;
end
if(key(_enter))
if(tecenter==0)
sonido(3);
if(elecc==0)
if(ops.pantalla_completa==0)
ops.pantalla_completa=1;
full_screen=1;
set_mode(640,480,16);
else
ops.pantalla_completa=0;
full_screen=0;
set_mode(640,480,16);
end
end
if(elecc==1)
if(ops.sonido==1)
ops.sonido=0;
else
ops.sonido=1;
sonido(3);
end
end
if(elecc==2)
if(ops.musica==1)
stop_song();
ops.musica=0;
else
play_song(music,99);
ops.musica=1;
end
end
if(elecc==3)
let_me_alone();
stop_song();
while(key(_enter)) frame; end
elige_lenguaje();
return;
end
end
tecenter=1;
else
tecenter=0;
end
//enter
if(key(_down))
if(tec==0)
sonido(2);
elecc++;
tec=1;
end
else
tec=0;
end
if(key(_up))
if(tec2==0)
sonido(2);
elecc--;
tec2=1;
end
else
tec2=0;
end
if(elecc==4)
elecc=0;
end
if(elecc==-1)
elecc=3;
end
frame;
end
end
process elecpersonaje()
private
dand;
begin
jue=0;
ran1=0;
ran2=0;
ran3=0;
ran4=0;
x=320;
y=240;
if(ops.lenguaje==1)
if(buzz) graph=915; else graph=910; end
else
if(buzz) graph=60; else graph=59; end
end
z=100;
loop
dand++;
if(dand==100)
movi(11);
end
if(dand==200)
movi(12);
end
if(dand==250)
graph=get_screen();
let_me_alone();
juego();
z=-100;
from alpha=255 to 0 step -15; frame; end
unload_map(0,graph);
break;
end
if((key(_up) and buzz==0) or (get_joy_button(buzz_joy,0) and buzz))
if(ran1==0)
sonido(4);
rana_elec(138,380,501,1);
ran1=1;
end
end
if((key(_z) and buzz==0) or (get_joy_button(buzz_joy,5) and buzz))
if(ran2==0)
sonido(4);
rana_elec(258,380,502,1);
ran2=1;
end
end
if((key(_p) and buzz==0) or (get_joy_button(buzz_joy,10) and buzz))
if(ran3==0)
sonido(4);
rana_elec(378,380,503,1);
ran3=1;
end
end
if((key(_q) and buzz==0) or (get_joy_button(buzz_joy,15) and buzz))
if(ran4==0)
sonido(4);
rana_elec(498,380,504,1);
ran4=1;
end
end
if(key(_esc))
let_me_alone();
while(key(_esc)) frame; end
menu();
break;
end
frame;
end
end
process rana_elec(x,y,graph,tipo);
begin
z=-15;
alpha=60;
while(exists(father))
if(alpha<240) alpha+=5; end
if(tipo and size>40) size-=8; end
frame;
end
end
process juego()
private
ganador;
dand;
begin
llegada=0;
wy=0;
delete_text(all_text);
if(ranpuntos[1]!=0) write_int(ler,200,470,4,&ranpuntos[1]); end
if(ranpuntos[2]!=0) write_int(ler,250,470,4,&ranpuntos[2]); end
if(ranpuntos[3]!=0) write_int(ler,390,470,4,&ranpuntos[3]); end
if(ranpuntos[4]!=0) write_int(ler,440,470,4,&ranpuntos[4]); end
indicador();
from i=-1 to 10;
piso(x,i*50);
end
if(ran1==1) ran(1); else ran(11); end
if(ran2==1) ran(2); else ran(12); end
if(ran3==1) ran(3); else ran(13); end
if(ran4==1) ran(4); else ran(14); end
frame(1000);
loop
if(ranviva[1]+ranviva[2]+ranviva[3]+ranviva[4]==1)
graph=get_screen();
x=320;
y=240;
z=-3;
let_me_alone();
from i=1 to 4;
if(ranviva[i]==1) ganador=i; end
end
rana_elec(320,200,500+ganador,0);
rana_elec(320,380,505,0);
ranpuntos[ganador]++;
timer[0]=0;
while(timer[0]<500 and !key(_enter)) frame; end
alpha=60;
dand=100;
loop
dand++;
if(dand==100)
movi(11);
end
if(dand==200)
movi(12);
end
if(dand==250)
let_me_alone();
juego();
z=-10;
from alpha=255 to 0 step -15; frame; end
unload_map(0,graph);
signal(id,s_kill);
end
end
end
if(ranviva[1]+ranviva[2]+ranviva[3]+ranviva[4]==0)
graph=get_screen();
x=320;
y=240;
z=-3;
let_me_alone();
alpha=60;
dand=100;
juego();
z=-10;
from alpha=255 to 0 step -15; frame; end
unload_map(0,graph);
signal(id,s_kill);
end
if(key(_esc))
let_me_alone();
while(key(_esc)) frame; end
graph=get_screen();
x=320; y=240; z=-100;
menu();
from alpha=255 to 0 step -15; frame; end
unload_map(0,graph);
break;
end
frame;
end
end
// lo siento gnomwer xD
process bac();
private
//INT blop = 0;
idc;
begin
/*blop = blendop_new();
blendop_intensity( blop, 0.2);
blendop_translucency(blop, 0.5);
blendop = blop;*/
z=father.z+5;
flags=father.flags;
idc=father.id;
LOOP
x=father.x+(father.x/30)-10;
y=father.y+5;
if(father.graph==50 or father.graph==52 or father.graph==54 or father.graph==56)
graph=900;
end
if(father.graph==51 or father.graph==53 or father.graph==55 or father.graph==57)
graph=901;
end
if(father.graph==100 or father.graph==101)
graph=904;
end
if(father.graph==102)
graph=906;
end
if(father.graph==103 or father.graph==104)
graph=905;
end
if(father.graph==106)
graph=903;
end
if(father.graph==105)
graph=902;
end
if(exists(idc))
else
break;
end
/*if(exists(father))
else
break;
end
graph =father.graph;
if(graph>150)
break;
end
flags=father.flags;
x = father.x + (father.x/30)-10;
y = father.y+5;
z=5;
if(ops.sombras==0)
break;
end
*/
FRAME;
END
/*ONEXIT
blendop = 0;
blendop_free(blop);*/
END
process ran(jugador);
private
qy;
up;
gr;
begin
y=400;
x=100;
qy=450;
if(jugador<10) ranviva[jugador]=1; else ranviva[jugador-10]=1; end
if(jugador==1 or jugador==11)
x=200;
gr=50;
end
if(jugador==2 or jugador==12)
x=250;
gr=52;
end
if(jugador==3 or jugador==13)
x=390;
gr=54;
end
if(jugador==4 or jugador==14)
x=440;
gr=56;
end
graph=gr;
bac();
loop
if(up>0)
up--;
end
if(y<0)
qy+=50;
end
if(y>480)
qy-=50;
end
if(qy==-2200) llegada=jugador; end
if(jugador==11 or jugador==12 or jugador==13 or jugador==14)
graph=gr;
if(rand(0,100)>90 or collision (type obstc))
graph=gr+1;
qy-=50;
if(collision(type obstcc))
qy+=50;
graph=gr;
//angle+=10000;
end
frame(200);
end
end
if(collision(type obstcc) or (llegada!=jugador and llegada!=0))
golp(x,y,graph);
sonido(4);
break;
end
if((
(jugador==1 and ((key(_up) and buzz==0) or (get_joy_button(buzz_joy,0) and buzz)))
or
(jugador==2 and ((key(_z) and buzz==0) or (get_joy_button(buzz_joy,5) and buzz)))
or
(jugador==3 and ((key(_p) and buzz==0) or (get_joy_button(buzz_joy,10) and buzz)))
or
(jugador==4 and ((key(_q) and buzz==0) or (get_joy_button(buzz_joy,15) and buzz)))
)
and up==0)
graph=gr+1;
qy-=50;
up=4;
else
if(up<3) graph=gr; end
end
if(y<300)
wy+=5;
end
y=wy+qy;
frame;
end
if(jugador<10) ranviva[jugador]=0; else ranviva[jugador-10]=0; end
end
process obstc(qy,tip)
private
gr;
begin
if(tip==0 or tip==1)
gr=rand(100,104);
end
if(tip==2 or tip==3)
gr=rand(105,106);
end
flags=tip;
graph=gr;
y=-50;
x=rand(0,900);
if(collision(type obstc))
x=rand(-10,-1500);
end
z=-10;
bac();
loop
obstcc(x,y);
if(tip==0 or tip==2)
if(tip==0)
x+=rand(10,15);
else
x+=5;
end
if(x>1000)
x=-100;//rand(-10,-1500);
end
if(collision(type obstc) and x<0)
x=rand(-10,-1500);
end
else
if(tip==1)
x-=rand(10,15);
else
x-=5;
end
if(x<-100)
x=1000;//rand(900,1500);
end
if(collision(type obstc) and x>640)
x=rand(900,1500);
end
end
y=wy+qy;
if(y>550)
break;
end
frame;
end
end
process obstcc(x,y)
begin
z=59;
graph=99;
frame(200);
end
process golp(x,y,graph)
private
iy;
begin
iy=-10;
loop
angle+=30000;
iy+=1;
y+=iy;
if(y>1000)
break;
end
frame;
end
end
process piso(x,qy)
private
gr;
begin
z=50;
x=320;
gr=200;
if(rand(0,1)==1)
gr=202;
end
if(rand(0,1)==1)
gr=204;
end
graph=gr;
loop
y=qy+wy;
if(y>550)
qy=qy-600;
gr=rand(200,201);
if(qy>-100)
gr=200;
end
if(qy==-2200) gr=206; end
if(qy<-2200) gr=204; end
if(gr==200)
if(rand(0,1)==1)
gr=202;
if(rand(0,1)==1)
gr=204;
end
end
end
if(gr==201)
gr=rand(0,3);
obstc(qy,gr);
obstc(qy,gr);
gr=201;
end
if(gr==201)
if(pantc==200 or pantc==202 or pantc==205)
gr=203;
end
end
if(gr==200 or gr==204 or gr==202)
if(pantc==201 or pantc==203)
gr=205;
end
end
graph=gr;
pantc=gr;
end
frame;
end
end
process indicador()
begin
bandera();
graph=50;
angle=270000;
size=50;
y=22;
z=-50;
loop
x=(wy/10)+190;
frame;
end
end
process bandera()
begin
graph=210;
x=320;
y=20;
z=-25;
loop
frame;
end
end
process elige_lenguaje();
private
tec;
keytime;
tec2;
begin
elecc=0;
lista(914);
machango();
loop
if(elecc==2)
elecc=0;
end
if(elecc==-1)
elecc=1;
end
if(keytime>0)
keytime--;
end
//elige algo
if(key(_enter)and keytime==0)
sonido(3);
ops.lenguaje=elecc;
break;
end
if(key(_down))
if(tec==0)
elecc++;
sonido(2);
tec=1;
end
else
tec=0;
end
if(key(_up))
if(tec2==0)
elecc--;
sonido(2);
tec2=1;
end
else
tec2=0;
end
frame;
end
let_me_alone();
while(key(_enter)) frame; end
logo_pixjuegos();
end
include "sonido.inc";
include "guardar.inc";
|