Results 1 to 11 of 11

Thread: disappearing sprites problem

  1. #1

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

    disappearing sprites problem

    I got this game (well, about 2% of one so far) and all it is right now is a map of part of a city, and i have a car driving down the road. Now, the problem is, sometimes its there, and sometimes its not. it drives me insane. I've made sure i've freed the bitmap handle and the device context, so i don't think its a memory thing, but it probably is. I've attached the project; it uses 3 classes (a car, sprite and bitmap class). I know that probably seems like a lot of overhead for nothing, but it'll help alot later in the game. anyway, try and see if you can figure it out.
    thanks a million
    jmiller
    Last edited by jmiller; Nov 9th, 2002 at 05:35 PM.

  2. #2

    Thread Starter
    Addicted Member jmiller's Avatar
    Join Date
    Jul 2002
    Location
    University of Michigan
    Posts
    238
    here's the project
    Last edited by jmiller; Nov 12th, 2002 at 11:29 PM.

  3. #3

    Thread Starter
    Addicted Member jmiller's Avatar
    Join Date
    Jul 2002
    Location
    University of Michigan
    Posts
    238
    PLEASE! for the love of god, can someone help?!!?!?!?! This is driving me insane!

  4. #4
    Fanatic Member Mushroom Realm's Avatar
    Join Date
    Mar 2002
    Location
    Murrieta, California
    Posts
    650
    Is it just flashing or does it dissapear for long periods of time? I cant download, im at school. Maybe you should reset the visible to true every time you move it.

  5. #5

    Thread Starter
    Addicted Member jmiller's Avatar
    Join Date
    Jul 2002
    Location
    University of Michigan
    Posts
    238
    i've got it so the user moves the car with the move keys, but it still dissapears, only sometimes though, and if you move it around alot it will reappear, check out the new version.
    Attached Files Attached Files
    Last edited by jmiller; Nov 15th, 2002 at 01:49 PM.

  6. #6

    Thread Starter
    Addicted Member jmiller's Avatar
    Join Date
    Jul 2002
    Location
    University of Michigan
    Posts
    238
    if you noticed that the car 'smears' across the screen, i've fixed that. in the LoadFrames function of the sprite class, insert the command 'set cbSource = Nothing', and it won't smear anymore. I think the dissapearing problem is just with windows XP though, because i'm on a 98 system now, and its not dissappearing. let me know if you know why its disappearing in XP.

  7. #7
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    When I start your game, the car dissappears about 1/10 of the times I start it...I'm using Win2K.

  8. #8

    Thread Starter
    Addicted Member jmiller's Avatar
    Join Date
    Jul 2002
    Location
    University of Michigan
    Posts
    238
    yeah win2K and winXP are sort of in the same group, in terms of API capatability

  9. #9
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    I'm running Win98 and the car doesn't disappear, but it leaves "tracks" behind it when I move left or right, but not up or down. Try refreshing the background everytime the car is moved.

    It looks kind of cool because it seems like the car is doing a major burn-out
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  10. #10

    Thread Starter
    Addicted Member jmiller's Avatar
    Join Date
    Jul 2002
    Location
    University of Michigan
    Posts
    238
    Yeah i know, i fixed that problem. it was that the 'SaveUnder' bitmap didn't change size when the car did, that why it did it when you went left and right only. it only cleared half the car (because of the width to height ratio change). you can fix that by going into the LoadFrames function of the Sprite class, and inserting the command 'set cbUnder = Nothing'. Then, when you call the SaveUnder sub, it will redimension the cbUnder bitmap. But, i still havent' fixed the dissappearing problem.

  11. #11

    Thread Starter
    Addicted Member jmiller's Avatar
    Join Date
    Jul 2002
    Location
    University of Michigan
    Posts
    238
    well i've sort of narrowed down what the problem could be. It only disappears when a new car image is loaded, like at the beginning or when you move the car in a different direction. Its not that car is being drawn over, or erased, its that the bitmap is simply blank. i've tried drawing to a separate form and whenever the car goes blank on the first form, it goes blank on the second, so it must be a problem with the bitmap. again this is only win2k and winxp. PLEASE IF YOU KNOW ANYTHING ABOUT THE API, HELP ME. i can't continue writing my game until this is solved.
    thanks

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