I try to recompile code written by CorpsmanDE for Delphi (pingPong)
I work with Opensuse Linux and Lazarus 1.8.2
I get the following Errors
elements.pas(32,24) Error: Duplicate identifier "Position"
elements.pas(32,24) Hint: Identifier already defined in elements.pas at line 29
elements.pas(32,34) Error: Duplicate identifier "SpeedVektor"....etc
Here is the code
Unit Elements;
Interface
Uses
classes, LCLIntf, LCLType, LCLProc, // Trect
graphics; // TCanvas, TColor
Type
TBall = Class;
TFpoint = Record
x, y: Single;
End;
TBall = Class
private
fvx, fvy, fx, fy, fr, fm: Single;
fc: Tcolor;
Function getpos: Tfpoint;
Procedure Setpos(Value: TFpoint);
Function getSpeed: Tfpoint;
Procedure SetSpeed(Value: TFpoint);
public
Property Color: Tcolor read FC write fC;
Property Radius: Single read fr;
Property Position: Tfpoint read getpos write Setpos;
Property SpeedVektor: TFpoint read getSpeed write SetSpeed;
Property Mass: Single read Fm write fm;
Constructor Create(Position, SpeedVektor: TFpoint; Radius, Mass: single);
Destructor Destroy; override;
Procedure Render(Const Canvas: TCanvas);
Procedure CalculateMass;
Procedure BorderCollision(CollisionRect: Trect; InsideCollision: Boolean = True);
Procedure CollideWithOther(Const Ball2: TBall);
Procedure Move;
End;
Function Point(x, y: Single): Tfpoint;
Function Rect(ALeft, ATop, ARight, ABottom: Integer): Trect;
Implementation
Why does the class not compile? What did I wrong?Iassume it compiled in delphi
Thans for the help