/* * Constructeur du ViewJeu */ ViewJeu::ViewJeu() { map = Map::getInstance(); laby = Labyrinthe::getInstance(); pacman = Pacman::getInstance(); leftSideLaby = -1; bottomSideLaby = -1; loadLaby(); glClearColor(0,0,0,0); computeViewPort(); }
void main() { char j, a; unsigned int *seed; backupPageZero(); GenerateTables(); DiscLoad("FONT.BIN"); // testing //sedoric("!LOAD(\"TEAM.BIN\")"); //cls(); #ifdef debug printf("char : %d, short %d, int %d, long %d, float %d\n", sizeof(char), sizeof(short), sizeof(int), sizeof(long), sizeof(float)); printf("taper sur une touche pour continuer\n"); a = (char)getchar(); #endif io_needed = 1; loadCharacters(); #ifdef debug printf("taper sur une touche pour continuer\n"); a = (char)getchar(); #endif loadLaby(); if (ca==0) { if (c[x+y*XMAX] != 0) { unsigned char nb = 255; // un coffre ou un combat a été fini char cas = c[x+y*XMAX]; if (cas>=21 && cas<=28) nb = cas - 21; else if (cas >=30 && cas <= 50) nb = cas - 30 + 8; // les 8 premiers bits stockent les coffres if (nb < 40) { SetBit(combats_coffres[ville-1], nb); //printf("Coffre ou Combat %d fini!\n", nb); c[x+y*XMAX] = 0; } } } #ifdef debug for (a=0; a<8; a++) for (j=0; j<40; j++) if(TestBit(combats_coffres[a], j)) printf("Bit %d is set\n", j); // testing // SetBit(combats_coffres[ville-1], 0); #endif printf("Taper sur une touche pour continuer\n"); get(); seed = (unsigned int *) 630; // timer srand(*seed); #ifdef debug printf("timer vaut %d\n", *seed); printf("alea vaut %d\n", rand()); printf("taper sur une touche pour continuer\n"); a = (char)getchar(); #endif // Sedoric(command2); // 330 CASE=C(X,Y) prep(); drawLaby(); ca = c[x+y*XMAX]; // manageCell(); // 320 GOSUB 500:GOSUB 1000 while(1) { // 380 GET A$ //a = (char)getchar(); //printf("x=%d, y=%d, s=%d ca=%d\n", x,y,s,ca); a = get(); switch(a) { //#ifdef debug case 'F': // pour debug case 'f': // 390 IF A$="F" THEN END a = 'F'; text(); io_needed = 1; saveCharacters(); restorePageZero(); printf("sauvegarde ok\n"); SwitchToCommand("!DIR"); // évite une erreur bizarre return; break; //#endif case ' ': // 400 IF A$=" "AND F(1)>1 AND F(1)<7 THEN GOSUB 3000:GOTO 330 if(f[0]>1&&f[0]<7) { #ifdef debug for (j=0;j<4;j++) { printf("cle(%d,%d) = %d ", 3, j, cles[3][j]); } #endif // 3000 REM ClÈ // 3010 IF F(1)=2 THEN 3030 // 3020 IF CLEF(VIL,(F(1)-2))=0 THEN ZAP:PRINT TX$(4):GOTO 3050 // 3030 F(1)=0:GOSUB 600:PING // 3050 RETURN if (f[0] == 2) { f[0]=0; forward(); ping(); // on avance deux fois prep(); printf("On passe la porte\n"); wait(180); drawLaby(); forward(); } else { ////// MODIF Maximus ******* if(cles[ville-1][f[0]-3]==0) { zap(); printf("Ou est la cl{ ?\n"); } else { #ifdef debug printf("Porte %d cle(%d,%d) %d ", f[0], ville-1, (f[0]-3), cles[ville-1][f[0]-3]); a = (char)getchar(); #endif InvertBit(&dedans,f[0]-3); f[0]=0; forward(); ping(); // on avance deux fois prep(); printf("On passe la porte\n"); wait(180); drawLaby(); forward(); } } } break; case 'I': case 'i': case 'Z': case 'z': // 410 IF A$="I" OR A$="i" THEN GOSUB 600:GOTO 330 forward(); break; case 'J': case 'j': case 'Q': case 'q': // 420 IF A$="J" OR A$="j" THEN S=S-1:IF S=0 THEN S=4 s--; if(s<0) s=3; prep(); drawLaby(); break; case 'L': case 'l': case 'D': case 'd': // 430 IF A$="L" OR A$="l" THEN S=S+1:IF S=5 THEN S=1 s++; if(s>3) s=0; prep(); drawLaby(); break; case 'C': case 'c': // 435 IF A$="C" THEN GOTO 21000 text(); io_needed = 1; saveCharacters(); restorePageZero(); SwitchToCommand("CAMP"); break; //#ifdef debug case 'A': case 'a': printf("alea vaut %d\n", rand()); break; case 'K': case 'k': for (j=0;j<4;j++) { cles[ville-1][j] = !cles[ville-1][j]; } break; case 'V': case 'v': text(); io_needed = 1; saveCharacters(); restorePageZero(); SwitchToCommand("VILLE"); break; //#endif default: puts("I:avance, J:droite, L:gauche\nESPACE: ouvrir porte"); wait(200); } // 450 GOTO 300 } }