16Fermer18
philip-lynxLe 31/10/2010 à 13:47
RYGAR (./16) :
Je viens juste de découvrir ce topic et un seul mot me viens BRAVO !
merci smile calin

La version 0.3 du jeu est arrivé les amis ! smile Premiers éléments interactifs, changement d'une couleur dans la palette, et une véritable lutte pour parvenir à faire une créature et un rocher en mouvement pas trop moche (pas facile avec si peu de pixels et de couleurs), sans que le tout ne se mette à ralentir (l'utilisation de la procédure, fait il y a peu à l'aide de Vince et Fadest, est à proscrire pendant les phases d'actions du jeu).

[URL=http://img100.imageshack.us/i/fofo2.jpg/][IMG]http://img100.imageshack.us/img100/8668/fofo2.th.jpg[/IMG][/URL]
char redir[]={0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF}; char pal[]={ 0x00,0x03,0x04,0x04,0x06,0x0B,0x09,0x0C,0x0D,0x0D,0x0D,0x04,0x05,0x02,0x08,0x05, 0x00,0x33,0x44,0x44,0x66,0xBB,0x28,0x2B,0x2C,0x2D,0x6D,0x58,0x5A,0x4C,0x88,0x64};



exe version 0.3 (à tester sur votre émulateur préféré):
tromb Fichier joint : globshoot_03.o

tromb Fichier joint : rhum.bmp
tromb Fichier joint : roch.bmp
tromb Fichier joint : gameover.bmp


/* Glob Shoot version 0.3 - LYNX 31/10/2010 console tenu à la verticale Handy/Option/Rotate Screen(Right) D-pad et bouton option 1 LYNX-image */ #include <lynx.h> #include <lynxlib.h> #include <stdlib.h> #include "inc\fond1.pal" // Ceci sert à inclure le fichier palette généré par sprpck /* LYNX-specific #defines: */ #define JOY_RIGHT 0x10 #define JOY_LEFT 0x20 #define JOY_DOWN 0x40 #define JOY_UP 0x80 #define BUTTON_OPTION1 0x08 #define BUTTON_OPTION2 0x04 #define BUTTON_LEFT 0x02 #define BUTTON_RIGHT 0x01 #define BUTTON_PAUSE 0x01 //#define SC BSTRETC H(a) (*(uint *)((a)+15)) // déformation, macro //#define SC BTILT(a) (*(uint *)((a)+17)) // déformation, macro char SCREEN[8160] at (MEMTOP-16320); char RENDER[8160] at (MEMTOP-8160); extern char fond1[]; // ecran titre //extern char fond2[]; // image decor monde 1, d'une taille de 32*102; il faudra donc scroller 6 images de droite à gauche. extern char fondlvl[]; // image fond level, d'une taille de 32*102; extern char gameover[]; // image game over, d'une taille de 20*32; char SCB[]; #asm _SCB dc.b $c0,$10,$20 dc.w 0,0 dc.w 0,0,$100,$100 dc.b $01,$23,$45,$67,$89,$ab,$cd,$ef #endasm extern char fond2[]; // image decor monde 1, d'une taille de 32*102; il faudra donc scroller 6 images de droite à gauche. char SCBfond2[]; // à la 3ème ligna asm, j'ai remplacé 100 par 200 pour doubler la largeur du décor (nbre de colonne * 2) #asm _SCBfond2 dc.b $c0,$10,$20 dc.w 0,0 dc.w 0,0,$200,$100 dc.b $01,$23,$45,$67,$89,$ab,$cd,$ef #endasm // déclaration des objets sprites qui seront linkés char sprite1[]; // extern char sprite2[]; // coque (taille: 30*24) // A partir du sprite1, je souhaite obtenir 6 images, de 0 à 5, du moteur à élice : // clip du sprite 1 extern char sp000000[]; extern char sp000001[]; extern char sp000002[]; extern char sp000003[]; extern char sp000004[]; extern char sp000005[]; char *sprtab[6] = {sp000000, sp000001, sp000002, sp000003, sp000004, sp000005}; char SCBsprite1[]; // déclaration d'un nouveau controleur de sprite, moteur à hélice char SCBsprite2[]; // déclaration d'un nouveau controleur de sprite, coque #asm _SCBsprite1 dc.b $c7,$10,$20 dc.w _SCBsprite2,0 dc.w 0,0,$100,$100 dc.b $01,$23,$45,$67,$89,$ab,$cd,$ef _SCBsprite2 dc.b $c7,$10,$20 dc.w 0, _sprite2 dc.w 0,0,$100,$100 dc.b $01,$23,$45,$67,$89,$ab,$cd,$ef #endasm // ------------------------------------ char chiffres[]; // // clip du sprite chiffres: 0123456789.L extern char ch000000[]; extern char ch000001[]; extern char ch000002[]; extern char ch000003[]; extern char ch000004[]; extern char ch000005[]; extern char ch000006[]; extern char ch000007[]; extern char ch000008[]; extern char ch000009[]; extern char ch000010[]; extern char ch000011[]; char *chiffrestab[12] = {ch000000, ch000001, ch000002, ch000003, ch000004, ch000005, ch000006, ch000007, ch000008,ch000009, ch000010, ch000011}; extern char SCBchiffres[]; // déclaration d'un nouveau controleur de sprite #asm _SCBchiffres dc.b $c7,$10,$20 dc.w 0,0 dc.w 0,0,$100,$100 dc.b $01,$23,$45,$67,$89,$ab,$cd,$ef #endasm // ------------------------------------ // ------------------------------------ char jauge[]; // // clip du sprite jauge d'énergie du shiplayer extern char ja000000[]; extern char ja001000[]; extern char ja002000[]; extern char ja003000[]; extern char ja004000[]; extern char ja005000[]; extern char ja006000[]; extern char ja007000[]; extern char ja008000[]; extern char ja009000[]; char *jaugetab[10] = {ja000000, ja001000, ja002000, ja003000, ja004000, ja005000, ja006000, ja007000, ja008000, ja009000}; extern char SCBjauge[]; // déclaration d'un nouveau controleur de sprite #asm _SCBjauge dc.b $c7,$10,$20 dc.w 0,0 dc.w 0,0,$100,$100 dc.b $01,$23,$45,$67,$89,$ab,$cd,$ef #endasm // ------------------------------------ // ------------------------------------ char rhume[]; // // clip du sprite rhume, que le nanoship doit capturer. extern char rh000000[]; extern char rh000001[]; extern char rh000002[]; extern char rh000003[]; extern char rh000004[]; extern char rh000005[]; extern char rh000006[]; char *rhumetab[7] = {rh000000, rh000001, rh000002, rh000003, rh000004, rh000005, rh000006}; extern char SCBrhume[]; // déclaration d'un nouveau controleur de sprite #asm _SCBrhume dc.b $c7,$10,$20 dc.w 0,0 dc.w 0,0,$100,$100 dc.b $01,$23,$45,$67,$89,$ab,$cd,$ef #endasm // ------------------------------------ c0 à la plce de c7 desactive la couleur 0 (transparente) // ------------------------------------ char roch[]; // // clip du sprite rhume, que le nanoship doit capturer. extern char ro000000[]; extern char ro000001[]; extern char ro000002[]; extern char ro000003[]; extern char ro000004[]; extern char ro000005[]; extern char ro000006[]; extern char ro000007[]; extern char ro000008[]; extern char ro000009[]; extern char ro000010[]; extern char ro000011[]; extern char ro000012[]; extern char ro000013[]; extern char ro000014[]; extern char ro000015[]; extern char ro000016[]; extern char ro000017[]; char *rochtab[18] = {ro000000, ro000001, ro000002, ro000003, ro000004, ro000005, ro000006, ro000007, ro000008, ro000009, ro000010, ro000011, ro000012, ro000013, ro000014, ro000015, ro000016, ro000017}; extern char SCBroch[]; // déclaration d'un nouveau controleur de sprite #asm _SCBroch dc.b $c7,$10,$20 dc.w 0,0 dc.w 0,0,$100,$100 dc.b $01,$23,$45,$67,$89,$ab,$cd,$ef #endasm // ------------------------------------ // variable (int = 2 octets ; char = 1 octet) int posx,posy,level; // int i,score,energ,pchi,upchi; int compteur,scrollx; char goship,t,tempa,tempb,tempc,tempd,tempe,etape,gslife,stopm,pause,drap1,nodecor,boumgb,aaroch; // de -128 à 127 int govil,vil,vilx,tempvilx,vily,avil,tempavil,hasa,hasam,hasar; int goroch,eroch,rochx,temprochx,rochy,aroch,temparoch,rasa,rasam,rasar; int atest; // assembler vertical retrace syncronisation routine void Vsync() { #asm vretrace: lda $fd0a bne vretrace #endasm } // Hors de l'assembleur, point de salut... // L'utilisation de la procedure suivante, lors de l'écran d'action, // fait ramer le jeu. void Fchiffres(clx,cly,classe) int clx; int cly; int classe; { SCBDATA(SCBchiffres) = chiffrestab[classe%12]; SCBX(SCBchiffres) = clx; SCBY(SCBchiffres) = cly; DrawSprite(SCBchiffres); } /************************************************************************** ** ** ** ** **************************************************************************/ char main() //main() { InitIRQ(); CLI; SetBuffers(SCREEN, RENDER ,0); /* set the palette */ SetRGB(pal); // Ceci sert à changer la palette de la Lynx (16 couleurs). //DrawFBox(0,0,160,102,0); SCBX(SCB) = 0; SCBY(SCB) = 0; SCBDATA(SCB) = fond1; // coordonnées X et Y du shiplayer, moteur à hélice : SCBX(SCBsprite1) = 0; SCBY(SCBsprite1) = 0; SCBDATA(SCBsprite1) = sprite1; posx = -40; posy = 39; // coordonnées X et Y du shiplayer, coque : SCBX(SCBsprite2) = 58; SCBY(SCBsprite2) = 52; SCBDATA(SCBsprite2) = sprite2; // coordonnées X et Y des chiffres et des lettres : SCBX(SCBchiffres) = 0; SCBY(SCBchiffres) = 0; SCBDATA(SCBchiffres) = chiffres; // coordonnées X et Y de la jauge : SCBX(SCBjauge) = 0; SCBY(SCBjauge) = 0; SCBDATA(SCBjauge) = jauge; /************************************************************************** ** BOUCLE PRINCIPALE ** **************************************************************************/ for(;;) // boucle principale { // test affichage nombre de sprite: if (joystick & (BUTTON_RIGHT)) nodecor=1;//{nodecor=1;DrawFBox(0,0,160,102,0);} if (joystick & (BUTTON_LEFT)) nodecor=0; // ********************************************************************************************* if (etape==0) // écran titre { DrawSprite(SCB); // affichage fond1 Fchiffres(4,5,0); // 0 Fchiffres(4,10,10); //. Fchiffres(4,15,3); //3 ++tempa; if (tempa>24 & etape==0) // petite teporisation avant d'autoriser le joueur de recommencer le jeu. { tempa=24; if (joystick & (BUTTON_OPTION1)) { tempa=0;etape=1; energ=10; level=1;score=0;drap1=0; // drap1 agit sur l'affichage du score. goship=0; posx=-40; posy=39;gslife=3; govil=0;goroch=0; SCBDATA(SCB) = fondlvl; } } } // ********************************************************************************************* if (etape==1 | etape==8 | etape==9) // écran level OU ecran perd une vie/game over { SCBDATA(SCB) = fondlvl; for (compteur = 0 ; compteur < 5 ; compteur++) // de 0 à 4, ce qui fait 5. Grâce à la boucle for... { SCBX(SCB) = compteur*32; // ...on incrémente la position X de chaque nouvelle image... SCBY(SCB) =0; DrawSprite(SCB); // ... et ainsi on affiche fondlvl 5 fois la même image (taille: 32*102) l'une àprès l'autre, à un intervalle de 32. } } // ********************************************************************************************* if (etape==1) { // SCBDATA(SCBchiffres) = chiffrestab[11%12]; // L // SCBX(SCBchiffres) = 93; // SCBY(SCBchiffres) = 44; // DrawSprite(SCBchiffres); Fchiffres(93,44,11); // SCBDATA(SCBchiffres) = chiffrestab[10%12]; // - // SCBX(SCBchiffres) = 93; // SCBY(SCBchiffres) = 44+5; // DrawSprite(SCBchiffres); Fchiffres(93,49,10); // SCBDATA(SCBchiffres) = chiffrestab[level%12]; // 1 // SCBX(SCBchiffres) = 93; // SCBY(SCBchiffres) = 44+10; // DrawSprite(SCBchiffres); Fchiffres(93,57,level); Fchiffres(61,57,gslife); // nbre de vie SCBDATA(SCBrhume) = rhumetab[5%7]; // coeur SCBX(SCBrhume) = 57; SCBY(SCBrhume) = 39; DrawSprite(SCBrhume); ++tempa; // durée de l'écran de présentation : level et nbre de life if (tempa>=79) { tempa=0; etape=2; SCBDATA(SCB) = fond2; drap1=1; govil=0;goroch=0; boumgb=0; } } // ********************************************************************************************* // Affichage de 4 images pour le décors, les 2 images du shiplayer, la jauge et les 2 images du score. if (etape==2) { // ********* decor : // ++tempb; // vitesse defilement du decor // if (tempb>=2) // { // tempb=0; //scrollx++; scrollx=scrollx+2; // } // if (scrollx==32) scrollx=0; // l'image fond2 : 32 pixels de large, donc remise à 0 si égale à 32. // for (compteur = 0 ; compteur < 6 ; compteur++) // de 0 à 5, ce qui fait 6. Grâce à la boucle for... // { // SCBX(SCB) = compteur*32; // ...on incrémente la position X de chaque nouvelle image... // SCBX(SCB)=SCBX(SCB)-scrollx; // SCBY(SCB) = 0; // DrawSprite(SCB); // ... et ainsi on affiche 6 fois la même image (taille: 32*102) l'une àprès l'autre, à un intervalle de 32. //if (nodecor==0) DrawSprite(SCB); // } /*************************************************************************** ** Problème de ralentissement au bout de 20 secondes de jeu : j'ai décidé ** ** d'économiser deux (gros) sprites utilisés pour le décor. ** ***************************************************************************/ if (scrollx==64) scrollx=0; // l'image fond2 : 32 pixels de large, donc remise à 0 si égale à 32. for (compteur = 0 ; compteur < 4 ; compteur++) // de 0 à 3, ce qui fait 4. Grâce à la boucle for... { SCBX(SCBfond2) = compteur*64; // ...on incrémente la position X de chaque nouvelle image... SCBX(SCBfond2)=SCBX(SCBfond2)-scrollx; SCBY(SCBfond2) = 0; SCBDATA(SCBfond2) = fond2; DrawSprite(SCBfond2); // ... et ainsi on affiche 4 fois la même image (taille: 64*102) l'une àprès l'autre, à un intervalle de 64. //if (nodecor==0) DrawSprite(SCB); } // ********* shiplayer : if (goship==0 & posx<20) { posx=posx+1; if (posx>=20) {posx=20; goship=1;} } if (goship==1 & stopm==0) { if (joystick & JOY_RIGHT) posx++; // direction Droite if (posx>120) posx=120; if (joystick & JOY_LEFT) posx--; // direction Gauche if (posx<2) posx=2; if (joystick & JOY_UP) posy--; // direction Haut if (posy<-2) posy=-2; if (joystick & JOY_DOWN) posy++; // direction Bas if (posy>80) posy=80; } // sprite 1 du shiplayer: moteur à hélice (6 images d'une taille de 8*22 chacunes) SCBX(SCBsprite1) = posx; SCBY(SCBsprite1) = posy; ++tempa; // vitesse animation de l'hélice if (tempa>=3+stopm) { tempa=0; ++t; if (stopm>0 & stopm<32) ++stopm; // Arrêt progressif du moteur à hélice... } if (stopm>1) // ...et le shiplayer sort progressivement de l'écran. { ++tempe; if (tempe>=4) {tempe=0; posx--;} } // clip du sprite 1 if (t>=5) t=0; SCBDATA(SCBsprite1) = sprtab[t%6]; // rappel: Le sprite 2 (coque) est lié au sprite 1 (hélice). SCBX(SCBsprite2) = posx+8; SCBY(SCBsprite2) = posy-1; DrawSprite(SCBsprite1); // ********* rocher 1 : if (eroch==0) { if (goroch<9) ++goroch; // petite temporisation avant l'attaque virale if (goship==1 & goroch>8 & stopm==0) { rasam=rasa; rasa=random()%4; // de 0 à 3 if (rasa==rasam) // Si le même nombre sort 2 fois de suite, alors... { rasar=random()%2; // de 0 à 1 if (rasar==0) ++rasa; if (rasar==1) --rasa; } if (rasa>3) rasa=0; if (rasa<0) rasa=3; eroch=1;rochx=160;temprochx=0;rochy=rasa*24;rochy=rochy+3;aroch=0;temparoch=0; // Taille rocher1: 24*24 ; objectif : // 4 positions de départ Y pour le rocher : rochy = 3 ou 27 ou 51 ou 75 // espacement de 3 lignes en haut et en bas : 3 et 99 (75 + 24 (nbre de ligne du rocher1)) } } if (eroch==1) { //++temprochx; // vitesse du rocher 1 en fonction du niveau. if (level==1)// & temprochx>1) { //temprochx=0;--rochx; rochx=rochx-1; } if (level==2)// & temprochx>0) { //temprochx=0;--rochx; rochx=rochx-2; } ++temparoch; // animation du rocher 1 if (temparoch>5) { temparoch=0;++aroch; if (aroch>15) aroch=0; } if (rochx<-24) {eroch=0;} // si rocher1 sort de l'écran, alors remise à 0 de sa création. // collision rocher1/shiplayer !!! if (stopm==0) { if (rochy+12>posy-4 & rochy+12<posy+28) { if (rochx+12>posx & rochx+12<posx+40) { eroch=0;aaroch=16; boumgb=1; stopm=1;energ=0; // panne sèche: arrêt du moteur à hélice } } } } if (eroch>0) // affichage { SCBDATA(SCBroch) = rochtab[aroch%18]; SCBX(SCBroch) = rochx; SCBY(SCBroch) = rochy; DrawSprite(SCBroch); } // test3: //SCBDATA(SCBchiffres) = chiffrestab[10%12]; //SCBX(SCBchiffres) = rochx+12; //SCBY(SCBchiffres) = rochy+12; //DrawSprite(SCBchiffres); // fin test3 // ********* rhume (vilain 1) : if (govil<32) ++govil; // petite temporisation avant l'attaque virale if (goship==1 & govil>31 & vil==0 & stopm==0) { hasam=hasa; hasa=random()%6; // de 0 à 5 // if (hasa==hasam) ++hasa; // if (hasa>5) hasa=0; if (hasa==hasam) // Si le même nombre sort 2 fois de suite, alors... { hasar=random()%2; // de 0 à 1 if (hasar==0) ++hasa; if (hasar==1) --hasa; } if (hasa>5) hasa=0; if (hasa<0) hasa=5; vil=1;vilx=160;tempvilx=0;vily=hasa*16;vily=vily+3;avil=0;tempavil=0; // Taille vilain1: 16*16 ; objectif : // 6 positions de départ Y pour le vilain1 : vily = 3 ou 19 ou 35 ou 51 ou 67 ou 83 // espacement de 3 lignes en haut et en bas : 3 et 99 (83 + 16 (nbre de ligne du vilain1)) } // // test1: // SCBDATA(SCBchiffres) = chiffrestab[10%12]; // SCBX(SCBchiffres) = posx+30; // SCBY(SCBchiffres) = posy+9; // DrawSprite(SCBchiffres); // SCBX(SCBchiffres) = posx+30; // SCBY(SCBchiffres) = posy+12; // DrawSprite(SCBchiffres); // SCBX(SCBchiffres) = posx+40; // SCBY(SCBchiffres) = posy+9; // DrawSprite(SCBchiffres); // SCBX(SCBchiffres) = posx+40; // SCBY(SCBchiffres) = posy+12; // DrawSprite(SCBchiffres); // fin test1 if (vil==1) { ++tempvilx; // vitesse du vilain 1 en fonction du niveau. if (level==1 & tempvilx>1) { tempvilx=0;--vilx; } if (level==2 & tempvilx>0) { tempvilx=0;--vilx; } ++tempavil; // animation du vilain 1 /*************************************************************************** ** Les conditions suivantes ralentissent le jeu ! Alors j'opte pour une ** ** seule condition... il faut limiter le nbre de condition. ***************************************************************************/ // if (tempavil==41) tempavil=1; // if (tempavil>0 & tempavil<11) avil=0; // 1 à 10 // if (tempavil>10 & tempavil<21) avil=1; // 11 à 20 // if (tempavil>20 & tempavil<31) avil=2; // 21 à 30 // if (tempavil>30 & tempavil<41) avil=1; // 31 à 40 if (tempavil>10) { tempavil=0;++avil; if (avil>2) avil=0; } // SCBDATA(SCBrhume) = rhumetab[avil%7]; // SCBX(SCBrhume) = vilx; // SCBY(SCBrhume) = vily; // DrawSprite(SCBrhume); if (vilx<-16) {vil=0;} // si vilain1 sort de l'écran, alors remise à 0 de sa création. // test2: // SCBX(SCBchiffres) = vilx; // SCBY(SCBchiffres) = vily+8; // DrawSprite(SCBchiffres); // fin test2 // capture du vilain1 !!! // atest=0; // if (vily+8>posy+9 & vily+8<posy+12) atest=1; // if (vily+6>posy+7 & vily+8<posy+16) atest=1; if (stopm==0) { if (vily+8>posy+7 & vily+8<posy+16) { if (vilx>posx+30 & vilx<posx+40) { // atest=1; vil=2;avil=3;tempavil=0; } } } // vily // posx // posy } if (vil==2) // virus capturé le nanoship ! { // avil=3; vily=posy+3;vilx=posx+38; tempd=0; // ici, on stoppe temporairement la jauge. ++tempavil; // animation du vilain 1 if (tempavil>0 & tempavil<11) avil=4; // 1 à 10 if (tempavil>10 & tempavil<21) avil=3; // 11 à 20 if (tempavil>20 & tempavil<31) avil=4; // 21 à 30 if (tempavil==31) { vil=0;energ=energ+4;++score; if (energ>10) energ=10; // --energ; // if (energ<1) energ=10; } } if (vil>0) // affichage { SCBDATA(SCBrhume) = rhumetab[avil%7]; SCBX(SCBrhume) = vilx; SCBY(SCBrhume) = vily; DrawSprite(SCBrhume); } // ********* chiffre & lettre : // ++tempc; // test le score // if (tempc>=24) // { // tempc=0; // if (score<100) ++score; // if (score>99) score=0; // // hasam=hasa; // hasa=random()%7; // de 0 à 6 // if (hasa==hasam) ++hasa; // if (hasa==7) hasa=0; // score=hasa; // } // ********* jauge d'énergie du shiplayer: ++tempd; // test la jauge if (tempd>=59 & energ>0) { tempd=0;--energ; if (energ==0) { stopm=1; // panne sèche: arrêt du moteur à hélice } } //energ=1; if (energ>0) { --energ; // energ de 1 à 10 --> mais de 0 à 9 pour le n° image SCBDATA(SCBjauge) = jaugetab[energ%10]; SCBX(SCBjauge) = 55; SCBY(SCBjauge) = 4; DrawSprite(SCBjauge); ++energ; } if (stopm>0) { if (boumgb>0) // explosion du shiplayer { ++aaroch; if (aaroch==18) aaroch=16; SCBDATA(SCBroch) = rochtab[aaroch%18]; SCBX(SCBroch) = posx+10; SCBY(SCBroch) = posy-1; DrawSprite(SCBroch); } if (posx<-32) { --gslife; // perd un ship... stopm=0;etape=1;tempa=0;energ=10;goship=0;posx=-40;posy=39;boumgb=0;aaroch=0; govil=0;vil=0;vilx=0;tempvilx=0;vily=0;avil=0;tempavil=0; hasa=0;hasam=0;hasar=0; goroch=0;eroch=0;rochx=0;temprochx=0;rochy=0;aroch=0;temparoch=0; rasa=0;rasam=0;rasar=0; if (gslife>0) // ...mais s'il en reste encore, alors retour à l'étape 1. { etape=1; } if (gslife<1) // ...mais s'il n'en plus, alors game over. { etape=8; } } } } // ********************************************************************************************* // if (etape==3) // { // } // ********************************************************************************************* if (etape>7) { SCBDATA(SCB) = gameover; SCBX(SCB) = 70; SCBY(SCB) = 34; DrawSprite(SCB); if (etape==9) { if (!(joystick & BUTTON_OPTION1)) { etape=0;SCBX(SCB)=0;SCBY(SCB)=0;SCBDATA(SCB)=fond1; } } if (etape==8) { ++tempa; if (tempa>24) // petite teporisation avant d'autoriser le joueur de recommencer le jeu. { tempa=24; if (joystick & BUTTON_OPTION1) {tempa=0;etape=9;} } } } // ********************************************************************************************* if ((etape==1 & drap1==1) | etape==2 | etape==8 | etape==9) // affichage du score { if (score<10) { //pchi=score; // unité: SCBDATA(SCBchiffres) = chiffrestab[score%12]; SCBX(SCBchiffres) = 150; SCBY(SCBchiffres) = 51; DrawSprite(SCBchiffres); // Fchiffres(150,51,score); // dizaine: SCBDATA(SCBchiffres) = chiffrestab[0%12]; // 0 SCBX(SCBchiffres) = 150; SCBY(SCBchiffres) = 51-4; DrawSprite(SCBchiffres); // Fchiffres(150,47,0); } if (score>9) { pchi=score; if (score>9 & score<20) {pchi=pchi-10;upchi=1;} if (score>19 & score<30) {pchi=pchi-20;upchi=2;} if (score>29 & score<40) {pchi=pchi-30;upchi=3;} if (score>39 & score<50) {pchi=pchi-40;upchi=4;} if (score>49 & score<60) {pchi=pchi-50;upchi=5;} if (score>59 & score<70) {pchi=pchi-60;upchi=6;} if (score>69 & score<80) {pchi=pchi-70;upchi=7;} if (score>79 & score<90) {pchi=pchi-80;upchi=8;} if (score>89 & score<100) {pchi=pchi-90;upchi=9;} // unité: SCBDATA(SCBchiffres) = chiffrestab[pchi%12]; SCBX(SCBchiffres) = 150; SCBY(SCBchiffres) = 51; DrawSprite(SCBchiffres); // Fchiffres(150,51,pchi); // dizaine: SCBDATA(SCBchiffres) = chiffrestab[upchi%12]; SCBX(SCBchiffres) = 150; SCBY(SCBchiffres) = 51-4; DrawSprite(SCBchiffres); // Fchiffres(150,47,upchi); } } // ********************************************************************************************* //Fchiffres(8,92,etape); // test de variable (mais où est le debogueur ?) Vsync(); SwapBuffers(); } /************************************************************************** ** FIN de la BOUCLE PRINCIPALE ** **************************************************************************/ } //}

Face à des problèmes de ralentissement (au bout de 10 ou 20 secondes), j'ai décidé d'utiliser moins de sprites pour le décor (4 au lieu de 6). Mais je ne connais pas bien les limites de la console. Il faut tester sur une LYNX, et me dire ce qu'il en est.