Tema: C++/Allegro
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 21/09/2014, 14:40
johana_castro95
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: C++/Allegro

Tengo un archivo .h que tiene todas las variables y luego lo mando a llamar en las clases del personaje y enemigos ? es in correcto eso ??

Código:
#ifndef VARIABLES_H
#define VARIABLES_H
#include<allegro.h>
#include "menudatos.h"
#include "datos.h"
#define speed 4
////////////////////////////////////////////////////////
            /*VARIABLES*/
    int points=0;           /*Extra*/
    int delay_man=-1;       /*Extra*/
    clock_t ti1=0,ti2=0;    /*Extra*/
    int num_enemy;          /*Extra*/
    int ene_speed;          /*Extra*/
    BITMAP *bmp;            /*Menu*/
    BITMAP *box;            /*ladrillos*/
    BITMAP *buffer;         /*Juego*/
    BITMAP *backgrnd;       /*fondos*/
    BITMAP *gateclos;       /*PuertaAbierta*/
    BITMAP *gateopen;       /*PuertaCerrada*/
    BITMAP *hiscr;          /*Score*/
    BITMAP *tem_enemy;      /*EnemigosTemp*/
    DATAFILE *data;         /*Archivo.dat*/
    DATAFILE *main_pg;      /*Archivo.dat*/
    int noentry,man,bord,   /*Colores*/
    _box,__enemy,_blast,    /*Colores*/
    _bomb;                  /*Colores*/
    int man_status;         /*Colores*/
    int color_game[6];      /*Colores*/
    enum{NOENTRY,MAN,BORD,  /*Colores*/
    _BOX,DEATH,_BLAST,_BOMB};
    int color_enemy[6];     /*Colores*/
    int initial[15][19]=
                { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
                  -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1,
                  -1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1,
                  -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1,
                  -1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1,
                  -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1,
                  -1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1,
                  -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1,
                  -1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1,
                  -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1,
                  -1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1,
                  -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1,
                  -1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1,
                  -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1,
                  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
                };
                int background[15][19];
struct imagen
{
    int x,y,col;
};

#endif // VARIABLES_H
Lo tengo mal asi esntonces ??