🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.learn.c-c++
Article #613

Problems with variables//problemas con variables

#613
From: TimoSoft
Date: Fri, 30 Jun 2000 00:00
59 lines
3651 bytes
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; //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: <8jihd0$3518@eui1nw.euskaltel.es>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10c163,d2157333467379ac,start
X-Google-Attributes: gid10c163,public
X-Google-Thread: 103077,d2157333467379ac,start
X-Google-Attributes: gid103077,public
X-Google-Thread: 105367,d2157333467379ac,start
X-Google-Attributes: gid105367,public
X-Google-Thread: 1145b7,d2157333467379ac,start
X-Google-Attributes: gid1145b7,public
X-Google-Thread: fd3cd,d2157333467379ac,start
X-Google-Attributes: gidfd3cd,public
X-Google-Thread: 10f023,d2157333467379ac,start
X-Google-Attributes: gid10f023,public
X-Google-Thread: faaa2,d2157333467379ac,start
X-Google-Attributes: gidfaaa2,public
X-Google-Thread: 114592,d2157333467379ac,start
X-Google-Attributes: gid114592,public
From: "TimoSoft" <timosoft@geocities.com>
Subject: Problems with variables//problemas con variables
Date: 2000/06/30
Message-ID: <8jihd0$3518@eui1nw.euskaltel.es>
X-Deja-AN: 640878573
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,comp.games.development.design,comp.games.development.programming.algorithms,comp.games.development.programming.misc,comp.lang.c++,comp.lang.c++.
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700