Results 1 to 4 of 4

Thread: Expert help needed!

  1. #1

    Thread Starter
    Addicted Member jmiller's Avatar
    Join Date
    Jul 2002
    Location
    University of Michigan
    Posts
    238

    Angry Expert help needed!

    I've had this problem for a while now, and this is the second post about it. I have a problem with dissapearing sprites.

    If you have some time, please check out this project and tell me why the sprite appears to randomly dissapear. Only look at this is you have > WIN98.
    What happens is that when the car(the sprite) is loaded, it may or may not dissapear. this happens when the game is loaded, or when the car changes direction and a new sprite is loaded. I would be greatful of any help you could give me.
    thanks
    Attached Files Attached Files

  2. #2
    Addicted Member darrenl's Avatar
    Join Date
    Jul 2000
    Location
    Portsmouth, UK
    Posts
    148
    I've had a quick look and the problem is in the clsSprite.cls file. You have a public sub called Draw, in this the first thing you do is to check the validity of the hdc of the sprite. Your code was checking if the hdc value was less than 1, but sometimes a hdc can be a negative number. Change the code to read...

    Code:
        'make sure current frame is valid
        If cbFrames(lCurrentFrame).hdc = 0 Then Exit Sub
    and all will be well.
    Dazzer

  3. #3

    Thread Starter
    Addicted Member jmiller's Avatar
    Join Date
    Jul 2002
    Location
    University of Michigan
    Posts
    238
    YOU ARE THE MAN!
    Thank you so much, this problem has been driving me nuts.

  4. #4
    Addicted Member darrenl's Avatar
    Join Date
    Jul 2000
    Location
    Portsmouth, UK
    Posts
    148
    No problem.
    Dazzer

Posting Permissions

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



Click Here to Expand Forum to Full Width