Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13
  1. #1

    {Allegro.h}[Problema](Creo un video gioco)

    ciao!creando un video gioco con la libreia allegro.h tramite il il libroProgrammare un video gioco passo per passo con Allegro.h del sito www.bertinettobartolomeodavide.it/sono usciti i seguenti errori come risolvo?
    codice:
    BITMAP buf, sprite,scrolling, screen,buffer, buffer2,immagine ; // mi esce l'erorre BITMAP' does not name a type
    PALETTE colori; //mi esce l'erorre PALETTE' does not name a type
    DATAFILE dati; //mi esce l'erorre DATAFILE' does not name a type
    void doppiobuffering(){
    vsync(); // mi esce l'errore `vsync' was not declared in this scope
    blit(buffer2, screen, 0, 0, 0, 0, 640, 480); `blit' was not declared in this scope
    clear(buffer2); // mi esce l'errore clear was not declared in this scope
    }
    void player() {
    if (morto==1) {
    draw_sprite(buf, sprite, x, y33 )`draw_sprite' was not declared in this scope
    }
    }
    void presentazione() {
    if (go==1) {
    while (!key[KEY_SPACE]) { // mi esce l'errore KEY_SPACE was not declared in this scope
    blit(dati[presetazione].dat, screen, 0, 0, 0, 0, 1024, 768);// mi esce `dati' was not declared in this scope
    }
    }
    go=0;
    }
    textout(buf, "GAME OVER", 480, 370, 215);// mi esce l'errore `textout was not declared in this scope

  2. #2

    descrizione errori.

    ancora meglio guardate il codice.
    codice:
    BITMAP  does not name a type
    PALETTE does not name a type
    DATAFILE does not name a type
    In function `void doppiobuffering()':
    vsync was not declared in this scope
    buffer2 was not declared in this scope
    screen was not declared in this scope
    blit was not declared in this scope
    clear was not declared in this scope
    void buffering():
    buffer was not declared in this scope
    buffer2 was not declared in this scope
    blit was not declared in this scope
    void blocco():
    immagine was not declared in this scope
    buffer was not declared in this scope
    `blit' was not declared in this scope
    `void scrolling()':
    error: `buffer' was not declared in this scope
     `buffer2' was not declared in this scope
     `blit' was not declared in this scope
     In function `void player()':
     `buf' was not declared in this scope
    `sprite' was not declared in this scope
    `draw_sprite' was not declared in this scope
     In function `void movimentotasti()':
     `key' was not declared in this scope
    `KEY_LEFT' was not declared in this scope
     `key' was not declared in this scope
     `KEY_RIGHT' was not declared in this scope
     `key' was not declared in this scope
    `KEY_UP' was not declared in this scope
     `KEY_DOWN' was not declared in this scope
     `key' was not declared in this scope
    `KEY_SPACE' was not declared in this scope
    In function `void fondale()':
    `dati' was not declared in this scope
     `sottosfondo' was not declared in this scope
     `buf' was not declared in this scope
     `blit' was not declared in this scope
     In function `void nemico()':
     `buf' was not declared in this scope
     `dati' was not declared in this scope
    `pg2' was not declared in this scope
    `draw_sprite' was not declared in this scope
    In function `void collisione()':
     `dati' was not declared in this scope 
     `vitameno' was not declared in this scope
     `play_sample' was not declared in this scope
     In function `void esplgioc()':
     `buf' was not declared in this scope : `dati' was not declared in this scope
     `esplosione' was not declared in this scope
     `draw_sprite' was not declared in this scope
    In function `void cattivocolpito()':
    `dati' was not declared in this scope
     `gameover' was not declared in this scope
     `play_sample' was not declared in this scope
    In function `void esplcattivo()':
     `buf' was not declared in this scope
    `draw_sprite' was not declared in this scope
     In function `void puntivite()':
    `score' was not declared in this scope
    `sprintf' was not declared in this scope
     `buf' was not declared in this scope
     `textout' was not declared in this scope
     In function `void gameover()':
     `buf' was not declared in this scope
     `textout' was not declared in this scope
    `dati' was not declared in this scope
    `play_sample' was not declared in this scope
     In function `void presentazione()':
    `key' was not declared in this scope
     `KEY_SPACE' was not declared in this scope
    `dati' was not declared in this scope
    `presetazione' was not declared in this scope
     `screen' was not declared in this scope
    `blit' was not declared in this scope
     In function `void gameover()':
      redefinition of `void gameover()'
    `void gameover()' previously defined here
    `buf' was not declared in this scope
     `textout' was not declared in this  `dati' was not declared in this scope
    `play_sample' was not declared in this scope
     In function `void fuoconemico()':
    `buf' was not declared in this scope
    dati' was not declared in this scope
    proiettile' was not declared in this scope
    draw_sprite was not declared in this scope
    dati' was not declared in this scope
    play_sample' was not declared in this scope
    In function `void missile()':
    buf' was not declared in this scope
    dati' was not declared in this scope
    proiettile' was not declared in this scope
    draw_sprite' was not declared in this scope
    play_sample' was not declared in this scope
    In function `int main()':
    keyboard' was not declared in this scope
    KEY_ESC' was not declared in this scope
    expected constructor, destructor, or type conversion before ';' token

  3. #3

    ecco tutto il mio listato

    codice:
    #include "H.h"
    BITMAP buf, sprite,scrolling, screen,buffer, buffer2,immagine ;
    PALETTE colori;
    DATAFILE dati;
    int x,y,pattern,missinv,missani,proicont,direzionex,direzioney,lancio, xpropal, ypropal,moltiplica, xscroll, xcattivo, ycattivo, xconto, yconto, morto, tempesplgioc, fuoco, xmiss, ymiss, mortocattivo;
    int playeresplode,tempesplcattivo, contapunti, vite, fine, go, suono1, suono2, suono3, suono4;
    void doppiobuffering(){
    vsync();
    blit(buffer2, screen, 0, 0, 0, 0, 640, 480);
    clear(buffer2);
    }
    void buffering(){
    blit(buffer, buffer2, 0, 0, 0, 0, 640, 480);
    }
    void blocco(){
    for (pattern=0;pattern<=1920;pattern=pattern+480) {
    blit(immagine,buffer,0,0,0,pattern,640,480);
    }
    }
    void scrolling(){
    for (y=0;y>=-1440;y=y-2) {
    blit (buffer, buffer2, 0, 0, 0, y, 640, 1920);
    doppiobuffering();
    }
    }
    void player() {
    if (morto==1) {
    draw_sprite(buf, sprite, x, y);
    }
    }
    void movimentotasti() {
    if (morto==1) {
    if (key[KEY_LEFT]) {
    x=x-2;
    if (x<=0) {
    x=0;
    }
    }
    if (key[KEY_RIGHT]) {
    x=x+2;
    if (x>=300) {
    x=300;
    }
    }
    if (key[KEY_UP]) {
    y=y-2;
    if (y<=0) {
    y=0;
    }
    }
    if (key[KEY_DOWN]) {
    y=y+2;
    if (y>=180) {
    y=180;
    }
    }
    if (key[KEY_SPACE]) fuoco=1;
    }
    }
    void fondale() {
    xscroll=xscroll+1;;
    blit(dati[sottosfondo].dat, buf, 0, 0, 0, 0, 1024, 768);
    if (xscroll>319) {
    xscroll = 0;
    }
    }
    void nemico() {
    if (mortocattivo==1) {
    draw_sprite(buf, dati[pg2].dat, xcattivo, ycattivo);
    }
    }
    void movimentonemico() {
    if (mortocattivo==1) {
    if (yconto==1) {
    ycattivo=ycattivo-1;
    if (ycattivo<=10) {
    yconto=2;
    }
    }
    if (yconto==2) {
    ycattivo=ycattivo+1;
    if (ycattivo>=150) {
    yconto=3;
    }
    }
    if (yconto==3) {
    xcattivo=xcattivo-1;
    xconto=xconto+1;
    if (xconto>=40) {
    xconto=0; yconto=1;
    }
    }
    if (xcattivo<=-50) {
    xcattivo=360;
    ycattivo=10;
    yconto=3;
    }
    }
    }
    void collisione() {
    if (((x+30)>=xcattivo) && (x<=(xcattivo+40))) {
    if (((y+20)>=ycattivo) && (y<=(ycattivo+31))) {
    morto=0;
    if (suono1==0) {
    play_sample(dati[vitameno].dat, 255,128,1000);
    suono1=1;
    }
    }
    }
    }
    void esplgioc() {
    if (morto==0) {
    if (tempesplgioc<=200) {
    tempesplgioc++;
    draw_sprite(buf, dati[esplosione].dat, x, y);
    }
    else {
    x=10; y=30;
    morto=1;
    tempesplgioc=0;
    vite--;
    suono1=0;
    }
    }
    }
    void cattivocolpito() {
    if (((xmiss+10)>=xcattivo) && (xmiss<=(xcattivo+40))) {
    if (((ymiss+5)>=ycattivo) && (ymiss<=(ycattivo+31))) {
    if (suono4==0) {
    play_sample(dati[gameover].dat, 255,128,1000);
    suono4=1;
    }
    mortocattivo=0;
    fuoco=0;
    suono2=0;
    }
    }
    }
    void esplcattivo() {
    if (mortocattivo==0) {
    if (tempesplcattivo<=200) {
    tempesplcattivo++;
    draw_sprite(buf, playeresplode, xcattivo, ycattivo);
    }
    else {
    xcattivo=360; ycattivo=10;
    tempesplcattivo=0;
    mortocattivo=1;
    contapunti++;
    suono4=0;
    }
    }
    }
    void puntivite() {
    sprintf(score, "PUNTI: %ld VITE: %ld", (long)contapunti, (long)vite);
    textout(buf,  score, 1, 1, 215);
    }
    void gameover() {
    if (vite==0) {
    if (fine<=200) {
    textout(buf, "GAME OVER", 120, 95, 215);
    fine++;
    if (suono3==0) {
    play_sample(dati[gameover].dat, 255,128,1000);
    suono3=1;
    }
    }
    else {
    tempesplgioc=0;
    tempesplcattivo=0;
    morto=1;
    x=10; y=30;
    xcattivo=360; ycattivo=10;
    yconto=3; xconto=0;
    fuoco=0;
    xmiss=0; ymiss=0;
    mortocattivo=1;
    contapunti=0;
    vite=3;
    fine=0;
    go=1;
    suono1=0; suono2=0; suono3=0, suono4=0;
    }
    }
    }
    void presentazione() {
    if (go==1) {
    while (!key[KEY_SPACE]) {
    blit(dati[presetazione].dat, screen, 0, 0, 0, 0, 1024, 768);
    }
    }
    go=0;
    }
    void gameover() {
    if (vite==0) {
    if (fine<=200) {
    textout(buf, "GAME OVER", 480, 370, 215);
    fine++;
    if (suono3==0) {
    play_sample(dati[gameover].dat, 255,128,1000);
    suono3=1;
    }
    }
    else {
    tempesplgioc=0;
    tempesplcattivo=0;
    morto=1;
    x=10; y=30;
    xcattivo=911; ycattivo=30;
    yconto=3; xconto=0;
    fuoco=0;
    xmiss=0; ymiss=0;
    mortocattivo=1;
    contapunti=0;
    vite=3;
    fine=0;
    go=1;
    suono1=0; suono2=0; suono3=0, suono4=0;
    xpropal = xcattivo+100;
    ypropal = ycattivo-10;
    }
    }
    }
    void fuoconemico() {
    if (lancio==0) {
    proicont++;
    if (proicont==50) {
    proicont=0;
    lancio=1;
    if (xcattivo>=x) {
    direzionex=1;
    }
    if (xcattivo<=x) {
    direzionex=2;
    }
    if (ycattivo>=y) {
    direzioney=1;
    }
    if (ycattivo<=y) {
    direzioney=2;
    }
    }
    xpropal = xcattivo+100;
    ypropal = ycattivo-10;
    }
    if (lancio==1) {
    if (direzionex==1) {
    xpropal=xpropal-5;
    }
    if (direzionex==2) {
    xpropal=xpropal+5;
    }
    if (direzioney==1) {
    ypropal=ypropal-5;
    }
    if (direzioney==2) {
    ypropal=ypropal+5;
    }
    draw_sprite(buf, dati[proiettile].dat, xpropal,ypropal);
    if (xpropal<=0) {lancio=0;}
    if (xpropal>=1024) {lancio=0;}
    if (ypropal<=0) {lancio=0;}
    if (ypropal>=768) {lancio=0;}
    }
    if (((xpropal+25)>=x) && (xpropal<=(x+251))) {
    if (((ypropal+25)>=y) && (ypropal<=(y+83))) {
    if (suono4==0) {
    play_sample(dati[gameover].dat, 255,128,1000);
    suono4=1;
    }
    morto=0;
    lancio=0;
    suono4=0;
    }
    }
    }
    void missile() {
    if (fuoco==0) {
    xmiss=x+150; ymiss=y+40;
    }
    if (fuoco==1) {
    draw_sprite(buf, dati[proiettile].dat, xmiss, ymiss);
    if (missinv==0){
    missani++;
    }
    if (missani==5) {
        missinv=1;
    }
    if (missinv==1) {
    missani--;
    }
    if (missani==0) {
    missinv=0;
    }
    xmiss=xmiss+10;
    if (suono2==0) {
    play_sample(dati[fuoco].dat, 255,128,1000);
    suono2=1;
    }
    if (xmiss>=1024) {
    fuoco=0;
    suono2=0;
    }
    }
    }
    
    int main(){
    tempesplgioc=0;
    tempesplcattivo=0;
    morto=1;
    x=10; y=30;
    xcattivo=360; ycattivo=10;
    yconto=3; xconto=0;
    fuoco=0;
    xmiss=0; ymiss=0;
    mortocattivo=1;
    contapunti=0;
    vite=3;
    fine=0;
    go=1;
    suono1=0; suono2=0; suono3=0, suono4=0;
    while (!keyboard[KEY_ESC]) {
    blocco();
    buffering();
    scrolling();
    fondale();
    player();
    movimentotasti();
    nemico();
    movimentonemico();
    collisione();
    esplgioc();
    cattivocolpito();
    esplcattivo();
    puntivite();
    gameover();
    presentazione();
    missile();
    fuoconemico();
    }
    }
    END_OF_MAIN ();

  4. #4
    Utente di HTML.it L'avatar di Alex'87
    Registrato dal
    Aug 2001
    residenza
    Verona
    Messaggi
    5,802
    Hai linkato correttamente la libreria? Sembrerebbe di no...

    ps: è inutile che usi il tag CODE se prima non intendi il codice
    SpringSource Certified Spring Professional | Pivotal Certified Enterprise Integration Specialist
    Di questo libro e degli altri (blog personale di recensioni libri) | ​NO M.P. TECNICI

  5. #5
    grz x i consigli, cm dovrei fare x la libreria?

  6. #6

    ps: è inutile che usi il tag CODE se prima non intendi il codice
    cs significa questa frase cs devo intendere il codice? nn è esplicito in quello che scrivo sopratutto i titoli

  7. #7
    Originariamente inviato da Cracker1992
    cs significa questa frase cs devo intendere il codice? nn è esplicito in quello che scrivo sopratutto i titoli
    Non "intendere", indentare. Del codice scritto senza indentazione è praticamente illeggibile. Confronta quello che hai scritto con la sua versione indentata e valuta quale è più comprensibile:
    codice:
    #include "H.h"
    
    BITMAP buf, sprite,scrolling, screen,buffer, buffer2,immagine ;
    PALETTE colori;
    DATAFILE dati;
    int x,y,pattern,missinv,missani,proicont,direzionex,direzioney,lancio, xpropal, ypropal,moltiplica, xscroll, xcattivo, ycattivo, xconto, yconto, morto, tempesplgioc, fuoco, xmiss, ymiss, mortocattivo;
    int playeresplode,tempesplcattivo, contapunti, vite, fine, go, suono1, suono2, suono3, suono4;
    
    void doppiobuffering()
    {
        vsync();
        blit(buffer2, screen, 0, 0, 0, 0, 640, 480);
        clear(buffer2);
    }
    void buffering()
    {
        blit(buffer, buffer2, 0, 0, 0, 0, 640, 480);
    }
    void blocco()
    {
        for (pattern=0; pattern<=1920; pattern=pattern+480)
        {
            blit(immagine,buffer,0,0,0,pattern,640,480);
        }
    }
    void scrolling()
    {
        for (y=0; y>=-1440; y=y-2)
        {
            blit (buffer, buffer2, 0, 0, 0, y, 640, 1920);
            doppiobuffering();
        }
    }
    void player()
    {
        if (morto==1)
        {
            draw_sprite(buf, sprite, x, y);
        }
    }
    void movimentotasti()
    {
        if (morto==1)
        {
            if (key[KEY_LEFT])
            {
                x=x-2;
                if (x<=0)
                {
                    x=0;
                }
            }
            if (key[KEY_RIGHT])
            {
                x=x+2;
                if (x>=300)
                {
                    x=300;
                }
            }
            if (key[KEY_UP])
            {
                y=y-2;
                if (y<=0)
                {
                    y=0;
                }
            }
            if (key[KEY_DOWN])
            {
                y=y+2;
                if (y>=180)
                {
                    y=180;
                }
            }
            if (key[KEY_SPACE]) fuoco=1;
        }
    }
    void fondale()
    {
        xscroll=xscroll+1;;
        blit(dati[sottosfondo].dat, buf, 0, 0, 0, 0, 1024, 768);
        if (xscroll>319)
        {
            xscroll = 0;
        }
    }
    void nemico()
    {
        if (mortocattivo==1)
        {
            draw_sprite(buf, dati[pg2].dat, xcattivo, ycattivo);
        }
    }
    void movimentonemico()
    {
        if (mortocattivo==1)
        {
            if (yconto==1)
            {
                ycattivo=ycattivo-1;
                if (ycattivo<=10)
                {
                    yconto=2;
                }
            }
            if (yconto==2)
            {
                ycattivo=ycattivo+1;
                if (ycattivo>=150)
                {
                    yconto=3;
                }
            }
            if (yconto==3)
            {
                xcattivo=xcattivo-1;
                xconto=xconto+1;
                if (xconto>=40)
                {
                    xconto=0;
                    yconto=1;
                }
            }
            if (xcattivo<=-50)
            {
                xcattivo=360;
                ycattivo=10;
                yconto=3;
            }
        }
    }
    void collisione()
    {
        if (((x+30)>=xcattivo) && (x<=(xcattivo+40)))
        {
            if (((y+20)>=ycattivo) && (y<=(ycattivo+31)))
            {
                morto=0;
                if (suono1==0)
                {
                    play_sample(dati[vitameno].dat, 255,128,1000);
                    suono1=1;
                }
            }
        }
    }
    void esplgioc()
    {
        if (morto==0)
        {
            if (tempesplgioc<=200)
            {
                tempesplgioc++;
                draw_sprite(buf, dati[esplosione].dat, x, y);
            }
            else
            {
                x=10;
                y=30;
                morto=1;
                tempesplgioc=0;
                vite--;
                suono1=0;
            }
        }
    }
    void cattivocolpito()
    {
        if (((xmiss+10)>=xcattivo) && (xmiss<=(xcattivo+40)))
        {
            if (((ymiss+5)>=ycattivo) && (ymiss<=(ycattivo+31)))
            {
                if (suono4==0)
                {
                    play_sample(dati[gameover].dat, 255,128,1000);
                    suono4=1;
                }
                mortocattivo=0;
                fuoco=0;
                suono2=0;
            }
        }
    }
    void esplcattivo()
    {
        if (mortocattivo==0)
        {
            if (tempesplcattivo<=200)
            {
                tempesplcattivo++;
                draw_sprite(buf, playeresplode, xcattivo, ycattivo);
            }
            else
            {
                xcattivo=360;
                ycattivo=10;
                tempesplcattivo=0;
                mortocattivo=1;
                contapunti++;
                suono4=0;
            }
        }
    }
    void puntivite()
    {
        sprintf(score, "PUNTI: %ld VITE: %ld", (long)contapunti, (long)vite);
        textout(buf,  score, 1, 1, 215);
    }
    void gameover()
    {
        if (vite==0)
        {
            if (fine<=200)
            {
                textout(buf, "GAME OVER", 120, 95, 215);
                fine++;
                if (suono3==0)
                {
                    play_sample(dati[gameover].dat, 255,128,1000);
                    suono3=1;
                }
            }
            else
            {
                tempesplgioc=0;
                tempesplcattivo=0;
                morto=1;
                x=10;
                y=30;
                xcattivo=360;
                ycattivo=10;
                yconto=3;
                xconto=0;
                fuoco=0;
                xmiss=0;
                ymiss=0;
                mortocattivo=1;
                contapunti=0;
                vite=3;
                fine=0;
                go=1;
                suono1=0;
                suono2=0;
                suono3=0, suono4=0;
            }
        }
    }
    void presentazione()
    {
        if (go==1)
        {
            while (!key[KEY_SPACE])
            {
                blit(dati[presetazione].dat, screen, 0, 0, 0, 0, 1024, 768);
            }
        }
        go=0;
    }
    void gameover()
    {
        if (vite==0)
        {
            if (fine<=200)
            {
                textout(buf, "GAME OVER", 480, 370, 215);
                fine++;
                if (suono3==0)
                {
                    play_sample(dati[gameover].dat, 255,128,1000);
                    suono3=1;
                }
            }
            else
            {
                tempesplgioc=0;
                tempesplcattivo=0;
                morto=1;
                x=10;
                y=30;
                xcattivo=911;
                ycattivo=30;
                yconto=3;
                xconto=0;
                fuoco=0;
                xmiss=0;
                ymiss=0;
                mortocattivo=1;
                contapunti=0;
                vite=3;
                fine=0;
                go=1;
                suono1=0;
                suono2=0;
                suono3=0, suono4=0;
                xpropal = xcattivo+100;
                ypropal = ycattivo-10;
            }
        }
    }
    void fuoconemico()
    {
        if (lancio==0)
        {
            proicont++;
            if (proicont==50)
            {
                proicont=0;
                lancio=1;
                if (xcattivo>=x)
                {
                    direzionex=1;
                }
                if (xcattivo<=x)
                {
                    direzionex=2;
                }
                if (ycattivo>=y)
                {
                    direzioney=1;
                }
                if (ycattivo<=y)
                {
                    direzioney=2;
                }
            }
            xpropal = xcattivo+100;
            ypropal = ycattivo-10;
        }
        if (lancio==1)
        {
            if (direzionex==1)
            {
                xpropal=xpropal-5;
            }
            if (direzionex==2)
            {
                xpropal=xpropal+5;
            }
            if (direzioney==1)
            {
                ypropal=ypropal-5;
            }
            if (direzioney==2)
            {
                ypropal=ypropal+5;
            }
            draw_sprite(buf, dati[proiettile].dat, xpropal,ypropal);
            if (xpropal<=0)
            {
                lancio=0;
            }
            if (xpropal>=1024)
            {
                lancio=0;
            }
            if (ypropal<=0)
            {
                lancio=0;
            }
            if (ypropal>=768)
            {
                lancio=0;
            }
        }
        if (((xpropal+25)>=x) && (xpropal<=(x+251)))
        {
            if (((ypropal+25)>=y) && (ypropal<=(y+83)))
            {
                if (suono4==0)
                {
                    play_sample(dati[gameover].dat, 255,128,1000);
                    suono4=1;
                }
                morto=0;
                lancio=0;
                suono4=0;
            }
        }
    }
    void missile()
    {
        if (fuoco==0)
        {
            xmiss=x+150;
            ymiss=y+40;
        }
        if (fuoco==1)
        {
            draw_sprite(buf, dati[proiettile].dat, xmiss, ymiss);
            if (missinv==0)
            {
                missani++;
            }
            if (missani==5)
            {
                missinv=1;
            }
            if (missinv==1)
            {
                missani--;
            }
            if (missani==0)
            {
                missinv=0;
            }
            xmiss=xmiss+10;
            if (suono2==0)
            {
                play_sample(dati[fuoco].dat, 255,128,1000);
                suono2=1;
            }
            if (xmiss>=1024)
            {
                fuoco=0;
                suono2=0;
            }
        }
    }
    
    int main()
    {
        tempesplgioc=0;
        tempesplcattivo=0;
        morto=1;
        x=10;
        y=30;
        xcattivo=360;
        ycattivo=10;
        yconto=3;
        xconto=0;
        fuoco=0;
        xmiss=0;
        ymiss=0;
        mortocattivo=1;
        contapunti=0;
        vite=3;
        fine=0;
        go=1;
        suono1=0;
        suono2=0;
        suono3=0, suono4=0;
        while (!keyboard[KEY_ESC])
        {
            blocco();
            buffering();
            scrolling();
            fondale();
            player();
            movimentotasti();
            nemico();
            movimentonemico();
            collisione();
            esplgioc();
            cattivocolpito();
            esplcattivo();
            puntivite();
            gameover();
            presentazione();
            missile();
            fuoconemico();
        }
    }
    END_OF_MAIN ();
    Un'altra cosa che dovresti fare è aggiungere commenti nel tuo codice, in modo da facilitarne la comprensione a chi lo vede per la prima volta.

    Comunque, non conosco bene allegro, ma la cosa che spicca subito è che non hai incluso allegro.h, per cui tutti i tipi e le funzioni relative alla libreria allegro non vengono riconosciute dal compilatore.

    P.S.: magari evita anche il linguaggio da SMS ("nn", "cs" e compagnia), non è ben visto su questo forum.
    Amaro C++, il gusto pieno dell'undefined behavior.

  8. #8
    grz! x i consigli però anche includendo allegro.h mi escono quasi gli stessi errori.

  9. #9
    Utente di HTML.it L'avatar di Scara95
    Registrato dal
    Jul 2009
    residenza
    Zimella (VR)
    Messaggi
    2,589
    Hai linkato la liberia nell'eseguibile??
    Potrebbe essere anche quello??

  10. #10
    Originariamente inviato da Cracker1992
    grz! x i consigli però anche includendo allegro.h mi escono quasi gli stessi errori.
    "Quasi"? Posta gli errori nuovi.
    Originariamente inviato da Scara95
    Potrebbe essere anche quello??
    Per gli errori che ha postato prima no, dato che sono tutti errori di compilazione e non di linking. Probabilmente comunque quando l'avrà messo a posto, se non linka la relativa libreria, salteranno fuori anche quelli.
    Amaro C++, il gusto pieno dell'undefined behavior.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.