Computer Science Canada Need help with flickering |
Author: | Mizzie30 [ Mon Jan 16, 2012 5:41 pm ] | ||
Post subject: | Need help with flickering | ||
I need some help with my pong game. Its flickering so much that it's hard to see, ive tried to use cls and View.Update but it doesn't seem to work.
Please specify what version of Turing you are using 4.0.5 |
Author: | Tony [ Mon Jan 16, 2012 5:50 pm ] | ||
Post subject: | RE:Need help with flickering | ||
- you're not setting offscreenonly - you have more than one View.Update
View.Update is fundamentally incompatible with processes (think about what each one does). You'd have to remove processes before you can start using View.Update. |
Author: | Mizzie30 [ Mon Jan 16, 2012 8:33 pm ] | ||
Post subject: | Re: RE:Need help with flickering | ||
Tony @ Mon Jan 16, 2012 5:50 pm wrote: - you're not setting offscreenonly
- you have more than one View.Update
View.Update is fundamentally incompatible with processes (think about what each one does). You'd have to remove processes before you can start using View.Update. I tried to set it to offscreenonly but when I do it freezes the program and I don't know how to use anything but a process. |
Author: | Raknarg [ Mon Jan 16, 2012 8:34 pm ] |
Post subject: | RE:Need help with flickering |
The question you must ask yourself is why are you using a process? What are you trying to accomplish with it? |
Author: | Mizzie30 [ Mon Jan 16, 2012 8:41 pm ] |
Post subject: | Re: RE:Need help with flickering |
Raknarg @ Mon Jan 16, 2012 8:34 pm wrote: The question you must ask yourself is why are you using a process? What are you trying to accomplish with it?
I'm using process because my teacher never taught us how to do forks so I am trying to figure this out myself. I have no clue how to do procedures or anything other then processes. |
Author: | Aange10 [ Mon Jan 16, 2012 8:41 pm ] |
Post subject: | Re: RE:Need help with flickering |
Mizzie30 @ 16/1/2012, 7:41 pm wrote: Raknarg @ Mon Jan 16, 2012 8:34 pm wrote: The question you must ask yourself is why are you using a process? What are you trying to accomplish with it?
I'm using process because my teacher never taught us how to do forks so I am trying to figure this out myself. I have no clue how to do procedures or anything other then processes. Okay, so what's a process? |
Author: | Mizzie30 [ Mon Jan 16, 2012 8:48 pm ] |
Post subject: | Re: RE:Need help with flickering |
Aange10 @ Mon Jan 16, 2012 8:41 pm wrote: Mizzie30 @ 16/1/2012, 7:41 pm wrote: Raknarg @ Mon Jan 16, 2012 8:34 pm wrote: The question you must ask yourself is why are you using a process? What are you trying to accomplish with it?
I'm using process because my teacher never taught us how to do forks so I am trying to figure this out myself. I have no clue how to do procedures or anything other then processes. Okay, so what's a process? All I know is that I can use it to run multiple things. |
Author: | mirhagk [ Mon Jan 16, 2012 8:58 pm ] |
Post subject: | RE:Need help with flickering |
basically you need to restructure your game like the following: loop draw paddle1 draw paddle2 draw ball etc.... View.Update update paddle1 update paddle2 update ball etc delay end loop |
Author: | Raknarg [ Mon Jan 16, 2012 8:58 pm ] |
Post subject: | RE:Need help with flickering |
Yes. Now the problem with this in turing, is that (if I remember correctly) it's uncontrollable and unpredictable, so you never really know the outcome of the fork. The second thing is that using a process will interfere with View.Update. However, there is a solution. Do you need these things to run at the same time? the answer is NO. You need it to LOOK like it's running at the same time. |
Author: | Beastinonyou [ Tue Jan 17, 2012 7:34 am ] | ||
Post subject: | Re: RE:Need help with flickering | ||
Mizzie30 @ Mon Jan 16, 2012 8:48 pm wrote: Aange10 @ Mon Jan 16, 2012 8:41 pm wrote: Mizzie30 @ 16/1/2012, 7:41 pm wrote: Raknarg @ Mon Jan 16, 2012 8:34 pm wrote: The question you must ask yourself is why are you using a process? What are you trying to accomplish with it?
I'm using process because my teacher never taught us how to do forks so I am trying to figure this out myself. I have no clue how to do procedures or anything other then processes. Okay, so what's a process? All I know is that I can use it to run multiple things. So, you understand that processes can run multiple things, but you don't understand how procedures work? the only thing I ever use processes for is music playing in the background for programs, procedures are what you need to be doing. for Processes, you call it whatever you want, put in a bunch of code you want to be run, and call it with fork. However, the way it runs is far different from using procedures. think of Procedures as just a chunk of code that you can call anytime you want, and it will do whatever is inside.
it's really simple, and far more effective for running something more than once. Once you have that down, you can move onto understand how to pass parameters, and utilize the ability You should also understand when to use Procedures and when to use Functions. |
Author: | Mizzie30 [ Tue Jan 17, 2012 8:30 pm ] |
Post subject: | Re: Need help with flickering |
Thanks everyone for you help I kind of figured out procedures and the ball now runs smoothly but my paddles don't show up how can I run multiple procedures? |
Author: | Dreadnought [ Tue Jan 17, 2012 8:36 pm ] | ||
Post subject: | Re: Need help with flickering | ||
Mizzie30 wrote: how can I run multiple procedures?
|
Author: | Mizzie30 [ Tue Jan 17, 2012 8:48 pm ] | ||
Post subject: | Re: Need help with flickering | ||
Dreadnought @ Tue Jan 17, 2012 8:36 pm wrote: Mizzie30 wrote: how can I run multiple procedures?
Tried that It only runs the first procedure. |
Author: | mirhagk [ Tue Jan 17, 2012 10:20 pm ] |
Post subject: | RE:Need help with flickering |
move the loops outside of the procedures, make the loops call each procedure, have them run once each, and then hit the end of the loop and restart. |