Results 1 to 8 of 8

Thread: Delphi internal error

  1. #1

    Delphi internal error

    What is internal error PRO-2688?

    My game is written in Delphi 6 and DelphiX, it works fine but it freezes and the above error is the only information I get.

    What is this error and how can it be resolved?
    Wake up from the dream and live your life to the full

  2. #2

    Delphi internal error

    Are you doing anything with critical sections? I saw a thing on Google about setting breakpoints inside critical sections.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #3

    Delphi internal error

    The whole internet has never heard of this problem, I've been google-ing, but all I found were other Pro-errors.

    You sure you typed in the right number? Either that or you've found an error listed nowhere.
    Huhuhu

  4. #4

    What is internal error PRO-2688?

    Nope, no critical sections...and the error number is correct. I've also searched the internet and could'nt find it.

    Some of my code:

    [pascal]
    //This is the player class
    TPlayer = class(TImageSprite)
    private
    Fired: Integer; //This variable determines how many bullets have been fired, you can only fire 5 bullets a second.
    public
    procedure DoMove(MoveCount: Integer); override;
    end;

    //This is the Bomb class
    TBomb = class(TImageSprite)
    public
    procedure DoMove(MoveCount: Integer); override;
    procedure DoCollision(Sprite: TSprite; var Done: Boolean);override;
    end;

    function TForm1.NewPlayer;
    begin
    Player_No := Player_No + 1;
    with TPlayer.Create(DXSpriteEngine1.Engine) do
    begin
    Player.Image := Form1.DXImageList1.Items.Find('Player');
    Player.X := 500;
    Player.Y := 710;
    Player.Width := Player.Image.Width;
    Player.Height := Player.Image.Height;
    Result := True;
    Lives:= Lives -1;
    end;
    end;

    procedure TForm1.GameEnd;
    begin
    If Player_No >2 then
    with DXDraw1.Surface.Canvas do
    begin
    DXTimer1.Enabled := False;
    Timer1.Enabled := False;
    DXWaveList1.Items.Find('Tada').Play(False);
    Font.Size := 26;
    Font.Color := clYellow;
    DXDraw1.Surface.Fill(0);
    TextOut(290,220,'GAME OVER,YOU LOST ');
    TextOut(290,270,'PRESS ESCAPE KEY AND TRY AGAIN');
    end;
    end;

    procedure TPlayer.DoMove(MoveCount: Integer);
    var
    MyX: Double;
    MyY : Double;
    begin
    If moveLeft and
    (x>5) then
    X := X - 10;

    If moveright and
    ((X+Form1.DXImageList1.Items.Find('Player').Width) <Form1>5) then
    Y := Y - 10;

    if Movedown and
    (y<form1.DXDraw1.Height-65)then
    Y:= Y + 10;

    MyX := X;
    MyY := y;

    //Check whether button1 is pressed (SPACEBAR)
    If isButton1 in Form1.DXInput1.States Then
    begin
    if Fired <= 3 then
    begin
    Inc(Fired);
    with TBullet.Create(Form1.DXSpriteEngine1.Engine) do
    begin
    Image := Form1.DXImageList1.Items.Find('Bullet');
    Form1.DXWaveList1.Items.Find('Fire').Play(False);
    X := MyX + 30; //Set it's X pos to our current X pos
    Y := MyY; //Set it's Y pos to our current Y pos
    Width := Image.Width; //Set it's size
    Height := Image.Height;
    end;
    end;
    end;
    end;


    procedure TBomb.DoMove(MoveCount: integer);
    begin

    Y := Y + 25;
    Collision;
    if (Y >= Form1.DXDraw1.Height +20) Then
    Dead;
    end;


    procedure TBomb.DoCollision(Sprite: TSprite; var Done: Boolean);
    begin
    If (Sprite is TPlayer) Then
    begin
    Sprite.Collisioned := False;
    Sprite.Dead; //Kill the Sprite
    Form1.DXWaveList1.Items.Find('hit').Play(False);
    Player.Dead;
    Done := False;
    end;
    end;


    Called in DXTimer:
    if (player.Deaded) and (Player_No <= 2) then
    NewPlayer;
    GameEnd;
    [/pascal]

    I suspect that it might have to do with the bomb collision, the freeze happens when the bomb hits my player...funny thing is that it works as it should some times and not other times.

    EDITED - to include pascal BB tag.
    Wake up from the dream and live your life to the full

  5. #5

    Delphi internal error

    I edited you post for better legibility.

    Should you be calling "Collision;" inside the DoMove method of your Bomb? Won't the Collision code be called at some other point in your game loop?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  6. #6

    What is internal error PRO-2688?

    Thanks for your feedback :-)

    I'm not sure, the collision is called in the doMove method in the example that game with DelphiX. It's supposed to check for collisions and if it is found then the doCollision method will be executed.

    Where do you think it should be?
    Wake up from the dream and live your life to the full

  7. #7

    Delphi internal error

    When you get internal errors it has rarely to do with your sources themselves, but more often with the IDE having problems with something (maybe a defect file or such).

    But the first stop for those errors is Borland's quality central where users report prolbems and bugs with Borladn's IDEs and where Borland also tells what to do and how to fix them (for internal errors it's often a patch to a newer version).

    Have you updated your Delphi 6? If I remember correct then there are 2 or more service packs for D6. If nothing of that helps, create a new empty project and drop your current source into it and see if that works.

  8. #8

    Delphi internal error

    I have not used DelphiX for generations, so I may be wrong here, but Collision should be called whereever all the collision calculations are done.

    ie..
    [pascal]
    while GameLoop do
    MoveObjects; // In here all the DoMove methods are called
    CheckCollisions; // In here all the DoCollision methods are called
    RenderObjects; // In here all the Draw methods are called.
    end;
    [/pascal]

    You'll probably have a way to handling enemy AI as well in there.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •