Computer Science Canada View.Update & Pic.Draw? |
Author: | Deadmon [ Thu Apr 27, 2006 8:11 pm ] | ||
Post subject: | View.Update & Pic.Draw? | ||
Hello compsci...I been trying to an answer to this problem: As this is now May, most compsci classes are asking for games..and I'm in the process of making one. ![]() Now, I been trying to find out how to move a picture around without flickering, but to no avail. :\ Basically, with the code below, if I were to hold "d", I would be able to see the flickering..if I were to remove cls, it would work fine, except I would see clones of my character. ![]()
Suggestions? Or something I missed? and..thanks! |
Author: | Clayton [ Thu Apr 27, 2006 8:29 pm ] | ||||
Post subject: | Re: View.Update & Pic.Draw? | ||||
Deadmon wrote: Hello compsci...I been trying to an answer to this problem:
As this is now May, most compsci classes are asking for games..and I'm in the process of making one. ![]() Now, I been trying to find out how to move a picture around without flickering, but to no avail. :\ Basically, with the code below, if I were to hold "d", I would be able to see the flickering..if I were to remove cls, it would work fine, except I would see clones of my character. ![]()
Suggestions? Or something I missed? and..thanks! with your code you can do this to eliminate the flickering
the above code is pretty much the same as yours with the exception i drew a box instead of a pic. you pretty much had it right except you use a combination of Draw.Cls and View.Update to remove the flickering |
Author: | Deadmon [ Thu Apr 27, 2006 8:38 pm ] | ||
Post subject: | |||
Well, I'm not not sure if you understood my question SuperFreak? ![]()
So now my code looks like that, but like I mentioned before, if I were to hold or push D, my picture would "flicker" (as in it gets cls'd and reappears). Thanks though![/code] |
Author: | Clayton [ Thu Apr 27, 2006 8:55 pm ] |
Post subject: | |
it shouldnt flicker, not if your using View.Update properly, the odd flicker is normal, which is much better than the constant flickering without View.Update, thats about as good as its going to get im afraid, unless a mod or some sort of Turing God knows how to prevent even the odd exceptional flicker |
Author: | Delos [ Thu Apr 27, 2006 9:05 pm ] | ||||
Post subject: | |||||
Deadmon wrote:
That line is your problem. You've not setup the 'offscreenonly' correctly. Try:
Instead. Since the window size you've specified is the default size, no need to change it. |
Author: | do_pete [ Thu Apr 27, 2006 9:07 pm ] |
Post subject: | |
You need a delay and lower the number you increment x by. If you make that number a decimal like 0.2 or something you can have a smooth animation without a delay but you should still have something controlling the fps. |
Author: | codemage [ Fri Apr 28, 2006 8:35 am ] |
Post subject: | |
You should also NOT clear the screen right before you do an update. For best results, clear screen draw everything update really short delay having a short delay helps Turing's weak image buffering system to prevent most of the flickering. |