Hi, im working on a simple program for my computer sciences class.
im making a side scroller, and the problem is that when the background moves to the left it blinks; there are flashes of grey that show up sparatically.
any help is much appreciated!
Printable View
Hi, im working on a simple program for my computer sciences class.
im making a side scroller, and the problem is that when the background moves to the left it blinks; there are flashes of grey that show up sparatically.
any help is much appreciated!
What method are you using to animate it? Are you using BitBlt? DirectX? Or are you using Picturebox controls? Or something else?
I have two pictureboxes that move across the screen using a timer. once one picturebox is off the screen it goes back to the right side.
Would it be better if i just made one really long image instead of looping it?
I'm not sure if it will help, but try to set the pictureboxs autoredraw property to true....if that don't help, then I'm not sure if you can take away the flickering using a picturebox..
Hey..
I too am in a computer science class and am making a 2d side scrolling game! My advice is not to use timer's in your game and to create a game loop.
I will upload an example tommorow that may help you. My game is having the backgound scroll (not the actual sprite) and I too am having some troubles.
But to get rid of you flashes..try making a back buffer. The best way is if you can upload what you have and I'll take a look at it.
Doe
I know I said I would upload my example but I was fooling around with it and I have messed it up :(
I will continue to work on it and upload it as soon as I can
Doe
Hey thanks a lot man!
if you want to see what i have its uploaded
Here
Just another question.
When you hold down an arrow key i want an immediate response from the program.
Right now because you have to hold down the arrow keys for a bit before the computer rapidly presses the button it makes it hard to move the ship.
does anyone know how to fix this?
You are probably using the KeyPress event....if you declare a boolean...and assain itto true in the keydown event and false in the keyup event, then you don't have that problem anymore...but then you would have to find an other method to call your function....;)
This is how to do it....do as I said above, but domit with a long in stead...assign it 0, in the keydown event check if the user presses down or up....if up then assign that long the value 1, if down assign it 2. Then in your main loop check the long. If it zero, then make it go stright forward, if it is 1 then make it go up, if it is 2 then make it go down....
Good luck...nice game...I had a look at it...
wow thanks a lot
it works perfectly!