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.
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.
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.
Last edited by jmiller; Nov 15th, 2002 at 01:49 PM.
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.
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
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.
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