Article View: alt.comp.lang.learn.c-c++
Article #614Problems with variables//problemas con variables
From: maapirua
Date: Fri, 30 Jun 2000 00:00
Date: Fri, 30 Jun 2000 00:00
62 lines
3675 bytes
3675 bytes
PARDON ME BUT THE OTHER EMAIL ADDRESS DOESN'T WORK PROPERLY
I am trying to make a computer game. I am using DirectX and Borland C++
Builder.
I have made some directdraw and directsound classes to simplify the directx
programming.
With this classes I have made another class to control the Warriors in my
game.
Now I'm making the classes and some small examples to prove them , then i
will try to make a big game.
When I declare the variables depending the order I use to do it my program
works properly,
works but some items don't appear or justly don't works.
For example:
if I declare the variables in this way the program crashes
//////////////////////////////////////////////////////////////////////
TObjeto Pocima; // Tobjeto is a class which has an array of
TSDIRECTDRAWSURFACE and counter variables
int VELOCIDAD;
int legolaspunt;
int gandalfpunt;
int primero;
TSDIRECTDRAW direct1; file://TSDIRECTDRAW is a class i have made to
make
idirectdraw easier
TSDIRECTDRAWSURFACE Temporal,logo,fondo2,fondo; // idem but with
idirectdrawsurface
TPersonaje Legolas,Gandalf; // TPersonaje is a class to control the
warriors in the game (it has a great array of TSDIRECTDRAWSURFACE to keep
the // different
movements of the warriors.
RPersonaje DatosLego,DatosGan,datosmago;
RegFoto REGFOTO;
//////////////////////////////////////////////////////////////////////
But if I declare the variables in this order the program works properly
//////////////////////////////////////////////////////////////////////
TObjeto Pocima;
int VELOCIDAD;
int legolaspunt;
int gandalfpunt;
int primero;
TSDIRECTDRAW direct1;
TSDIRECTDRAWSURFACE Temporal;
TPersonaje Legolas;
RPersonaje DatosLego;
TSDIRECTDRAWSURFACE logo;
RPersonaje datosmago;
TSDIRECTDRAWSURFACE fondo2;
RPersonaje DatosGan;
TPersonaje Gandalf;
TSDIRECTDRAWSURFACE fondo;
RegFoto REGFOTO;
//////////////////////////////////////////////////////////////////////
If I change the order the program may draw only some of the items in the
screen
f.e. In some cases I can only see one of the two warriors in the game.
I think than the pointers are the problem, but I'm not able to solve it.
Technical Details
Message-ID:
<8jijha$3811@eui1nw.euskaltel.es>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10c163,d2157333467379ac X-Google-Attributes: gid10c163,public X-Google-Thread: 103077,d2157333467379ac X-Google-Attributes: gid103077,public X-Google-Thread: 105367,d2157333467379ac X-Google-Attributes: gid105367,public X-Google-Thread: faaa2,d2157333467379ac X-Google-Attributes: gidfaaa2,public X-Google-Thread: 114592,d2157333467379ac X-Google-Attributes: gid114592,public X-Google-Thread: 1060e9,c1fd47a81fbedef8,start X-Google-Attributes: gid1060e9,public X-Google-Thread: 1145b7,d2157333467379ac X-Google-Attributes: gid1145b7,public X-Google-Thread: fd3cd,d2157333467379ac X-Google-Attributes: gidfd3cd,public From: "maapirua" <maapirua@bi.ehu.es> Subject: Problems with variables//problemas con variables Date: 2000/06/30 Message-ID: <8jijha$3811@eui1nw.euskaltel.es> X-Deja-AN: 640899475 Organization: Euskaltel X-MSMail-Priority: Normal X-Priority: 3 Newsgroups: alt.comp.lang.learn.c-c++,alt.games.builder,alt.games.builder.dcgames,cern.c++,comp.games.development.design,comp.games.development.programming,comp.games.development.programming.algorithms,comp.games.development.programming.misc,comp.lang.c++.mod X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700