Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

pimple

C# :: Mother Flicker!

This topic is 5389 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi... I've wrote this 'game' in C#, but i just can't get rid of the flickering. I do know why the flickering occurs, but the thing is that all of the tutorials on the internet explaing how to get rid of it, but only if you're using images and such... here's how my game works: i create a two dimensional array (labels), each being 12x12 pixels. the array is 20X40, and the first row (top) is made of randomly added bombs. then, the bombs drop down to the bottom row (i just copy each row, from bottom to top, erasing the top one)... anyhoo, so i have a timer that fires this, so bombs (or X's) just keep on dropping down the screen... and since I'm only using labels, i just don't know how to remove that flickering junk. can anyone please help me?! here's my game: http://www.mvhsbreakers.com/game.zip thanks! [edited by - pimple on October 15, 2003 8:41:27 PM]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Nice idea for a game!!!!! i had fun with it, and i see no flickering at all, now u just have to make it more graphic

Share this post


Link to post
Share on other sites
well, if i increase the speed of the bombs or if you just hold down one of the arrow keys, you''ll see some flickering...
i''m going to implement that game quite a bit, but i just want to make it run smoother (graphically)... then after i''m done with that, i''ll add bitmaps and such...

thanks...

Share this post


Link to post
Share on other sites
bitmap blting code will most liekly need to be implemented quite differently than the way you are using labels. If you use graphical blting you can employ a technique called double buffering which will prevent flicker. As it stands labels just weren''t designed for smooth movement.

Share this post


Link to post
Share on other sites
so there''s no way of double buffering those labels? or... no way of having that game ever being flicker-free?!
thanks

Share this post


Link to post
Share on other sites
I'm not familiar with C#, but I may have found a "Bug" in your game. If you move the cursor over, I think 22, bombs will never hit you. It may be 23, but I tried this 3 times, and blocks never fall on that line.

[edited by - PumpkinPieman on October 15, 2003 12:41:21 AM]

Share this post


Link to post
Share on other sites
As you probably know the flickering is refresh. I wrote a game in C# using GDI+ and could not for the life of me get rid of the flickering. The method I finally did manage to use to resolve it was switching to Managed DirectDraw. It''s very easy to work with and gets rid of annoying flicker.

Share this post


Link to post
Share on other sites
alright then, thanks...
concerning the post before yours... yeah, i just noticed how bombs will never drop on that one colum... that''s weird since i use Random.Next to make that first row... anyhoo, i''ll just see what i can do with directdraw then, and i''ll post in the future in case i have any success...

btw, after watching reloaded yesterday, i had this great idea... i''ll just make the background black, and the boms green, and instead of X''s, i''ll just randomly generate other characters (like the ones used in the matrix), and the brightness of the characters will also vary... so you''ll look pretty cool (hopefully)... i don''t know, maybe i''ll call my game something like "Matrix: XP"

Share this post


Link to post
Share on other sites
I did this too with gdi+ now I know there is a .doublebuffer in the gdi+ somewhere...
ahh found it

put this in your constructer for the form


SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);


really all you need is the last one for double buffering.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!