Thema: Delphi DelphiX und DirectInput

Einzelnen Beitrag anzeigen

Spurius

Registriert seit: 19. Aug 2003
294 Beiträge
 
Delphi 7 Professional
 
#1

DelphiX und DirectInput

  Alt 30. Jan 2004, 19:02
Hallo,
warum funktioniert folgender Code nicht?
Delphi-Quellcode:
 type
 tcar = class(timagesprite)
 private
 public
  procedure DoMove(MoveCount: Integer); override;
 end;
var
  Form1: TForm1;
  car: tcar;
implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
 car := tcar.Create(dxspriteengine1.Engine);
 car.Image := dximagelist1.Items.Find('1');
 car.X := 0;
 car.Y := 0;
 car.Width := car.Image.Width;
 car.Height := car.Image.Height;
 form1.DoubleBuffered := true;
 dxdraw1.DoubleBuffered := true;
end;
procedure tcar.DoMove(movecount: integer);
begin
 if isLeft in Form1.DxInput1.States then
    car.X := car.X -3;
  if isRight in Form1.DxInput1.States then
    car.X := car.X +3;
end;
procedure TForm1.FormPaint(Sender: TObject);
begin
 form1.dxspriteengine1.Draw;
 form1.dxdraw1.Flip;
end;

procedure TForm1.DXTimer1Timer(Sender: TObject; LagCount: Integer);
begin
 form1.dxspriteengine1.Draw;
 form1.dxdraw1.Flip;
end;

end.
Gruß
Spurius
  Mit Zitat antworten Zitat