Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: List Index Out Of Bounds

  1. #11

    Re: List Index Out Of Bounds

    I installed the newest unDekphiX without any problems. Remember to uninstall the older version first, I think it says so on the install exe Remove the old version from your library path and then run the install file, I think Delphi should be closed as well
    Wake up from the dream and live your life to the full

  2. #12
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,246
    Blog Entries
    2

    Re: List Index Out Of Bounds

    Quote Originally Posted by Cer3brus
    The new unDelphiX(http://www.micrel.cz/Dx/) refuses point blank to install nicely
    Maybe I made a mess of the installation? Are there any tutorials around?
    Basically, you need to add a couple of paths to your library directory, and then open and install the package corresponding to the Delphi version you are using. In my case it added the Source and Source\dcu100 directories.

    The installer worked a treat for me, but it fell over because of the conflict between unDelphiX and my DevExpress components. I fixed it by renaming the dxCommon unit of unDelphiX to unDXCommon.

    Whilst my comments may indicate it's just a library problem... I've never used the sprites of unDelphiX... I suspect the guys who have commented after me are offering some more solid advice about the actual use of unDelphiX, which may resolve the problem in your code without upgrading to the latest version.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  3. #13

    Re: List Index Out Of Bounds

    .

  4. #14

    Re: List Index Out Of Bounds

    Quote Originally Posted by pstudio
    First, what's up with this?

    Code:
    GetKeyState(32) and 128 = 128
    Last time I checked 128 equals 128
    Pstudio, that line code is inspecting the byte value from "GetKeyState(32)" and then logical combined using operator "AND" with value 128 "(GetKeyState(32) and 12" the resulting value may or may not be 128; this is a very commun way for inspect the bits states inside a byte, in this case he is just asking if the value in GetKeyState(32) has the 8th bit turned on.



  5. #15

    Re: List Index Out Of Bounds

    Quote Originally Posted by tpascal
    Quote Originally Posted by pstudio
    First, what's up with this?

    Code:
    GetKeyState(32) and 128 = 128
    Last time I checked 128 equals 128
    Pstudio, that line code is inspecting the byte value from "GetKeyState(32)" and then logical combined using operator "AND" with value 128 "(GetKeyState(32) and 12" the resulting value may or may not be 128; this is a very commun way for inspect the bits states inside a byte, in this case he is just asking if the value in GetKeyState(32) has the 8th bit turned on.


    Yeah, I actually thought about that afterwards. I guees I need to refresh my operator precedence in pascal. I've been coding way to much c++ lately My bad
    Imagine I've written something clever here inspiring you to make something awesome. If that happens give me credits

  6. #16

    Re: List Index Out Of Bounds

    Ok, so I had a closer look at your code and found the problem. Your bullets were not freed when they left the 'top' of the screen...

    In your THBullet.doMove you had the following:

    [pascal] If X < 0 then Free;[/pascal]

    This must be changed to:

    [pascal] if y <= 0 then // not x!!
    dead; [/pascal]

    Furthermore you need to add Engine.Dead in your procedure TfrmDXTest.MoveTimer

    This works and your fps don't drop after a long period as before but I'm not entirely convinced that your code is 100% correct. Use the method as described by user 137 to see if you free objects correctly. A more OOP approach would be better; once you have the hang of it it's easy and more manageable. I also suggest you take a look at the shoot example which ships with unDelphiX.

    Looks good so far
    Wake up from the dream and live your life to the full

  7. #17

    Re: List Index Out Of Bounds

    Thanks!!
    After looking at the documentation(read:translate.google.com
    I found out that you can't free the bullets but instead you have to call dead;
    and in the timer code call engine.dead; what it actually does is process the objects that need to be removed instead of doing something wierd with the sprite engine. I'll finish the demo soon

  8. #18

    Re: List Index Out Of Bounds

    No problem
    Wake up from the dream and live your life to the full

Page 2 of 2 FirstFirst 12

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
  •