Results 1 to 9 of 9

Thread: DelphiX Timer FPS

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Well SilverWarrior, thank you for the info! I will look into this. I am new to game programming and that game is my first.

    Wave.dcu is included with DelphiX I think, if you want I could attach it with a future post? I also thought that something with that code seemed wrong but couldnt lay my finger on it. I got that code from a tutorial on which I am expanding.

    If you could perhaps give me an example of how to use spriteimages differently than I currently am, I will be grateful. In the meantime I will see if I cant figure this out on my own.

    Many thanks for the help

    EDIT: I have found the following proprties that DelphiX provides: AnimCount, AnimLooped, AnimPos, AnimSpeed, AnimStart.

    Those must be what you were referring to? Although what I cannot find is a different way of "loading" different frames. It doesnt seem like DelphiX has its own spriteimage property? Or maybe I'm just not looking I'll keep looking.

    EDIT2: Lol my bad, I found that the TImageSprite has a Image property which is a TPictureCollectionItem. Although, I cannot understand how it will be any different if I use the Image property? It still has to load images from a DXImagelist, doesnt it? Unless what you meant was that by using "Player.SpriteImage.LoadfromGraphic" It has to load the image into graphic memory, is this correct? Cause by using the Image property the code will look like this: "Player.Image := PlayerGfx.Items[0];".

    Then by using that method, how will I load the correct images once the player's frame has changed? This seems like it could work, I just need to figure out how to put it all together.

    EDIT3: Lol this is pretty funny. Tell me if I am correct:

    You use the Image property to specify where the player's Image is (In which DXImagelist I mean). Then by using the AnimCount property you specify the maximum frames for the player. With AnimStart you set the number for the corresponding start frame. By doing this it will load the images from the start point that you specified with AnimStart and keep loading untill it has reached AnimCount's value, then it will loop and repeat the process. Is this correct? AnimSpeed, AnimPos and AnimLooped is self-explanatory I believe.

    Then two more things. The ChangeFrame procedure. What did you mean when you said it still changes frames when the player frames havn't changed? Cause "Player.ChangeFrame(0)" is only called when the player is walking. When I use "Player.ChangeFrame(1)" it only changes the player's picture to "PlayerGfx.Items[1]", but it doesnt loop animation?

    And how will the "DXDraw1.Surface.Draw" procedure look? Cause it requires "SrcRect: TRect" and "Source: TDirectDrawSurface", which the "Player.Image" property doesnt have
    Last edited by Proph3t; 08-10-2013 at 10:59 AM.
    IF YOU'VE FAILED TO TAKE OVER THE WORLD, CREATE A GAME WHERE YOU CAN.

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
  •