Game Development Community

Airplain updated tutorial Wont run.

by Matthew Hoesterey · in Torque X 2D · 07/27/2008 (2:22 pm) · 1 replies

So I'm getting an error with this block of code, Created as the updated airplane tutorial has instructed:

#region Private, protected, internal fields



ValueInterface _roll;
ValueInterface _pitch;

ValueInPlaceInterface _airSpeed = new ValueInPlaceInterface(0.0f);
ValueInPlaceInterface _altitude = new ValueInPlaceInterface(0.0f);
ValueInPlaceInterface _heading = new ValueInPlaceInterface(0.0f);
float _turnPerDegreeRoll;
float _altitudePerDegreePitch;
float _minAltitude;
float _maxAltitude;

Vector2 _originalSize;

float _originalAltitude;

ValueInterface _altitude;

The Error is :
the type 'StarterGame2D.FlightModelComponent' already contains a definition for '_altitude'

So I can see even in the block of code above _altitude is being defined twice. I can get the code to compile by removing the second definition but then I get a runtime crash error.

Am I reading something wrong or is the tutorial bugged. If so does anyone know a solution.

I'm still wrapping my head around how the Interface system and am confussed by the double declaration that the tutorial is asking me to make.

#1
07/27/2008 (7:42 pm)
So I realized that the tutorial asked me to put some of the above code in the other component. Arg.. I wish the tutorials bolded things like that or at least started a new paragraph. :)