Computer Science Canada make a program look smooth |
Author: | UnTiteled [ Wed Jan 13, 2010 8:41 am ] | ||
Post subject: | make a program look smooth | ||
What is it you are trying to achieve? <Replace all the <> with your answers/code and remove the <>> i am trying to make my program look mooth and not flash (the program flashes for a split second : how to make not do that??) What is the problem you are having? <Answer Here> the program flashes for a split second : how to make not do that?? Describe what you have tried to solve this problem <Answer Here> ive tryed the view update and the offscreen, everything i know Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) <Answer Here>
Please specify what version of Turing you are using <Answer Here> 4.1.1 |
Author: | bc123 [ Wed Jan 13, 2010 8:47 am ] |
Post subject: | Re: make a program look smooth |
nice program but im not sure how to fix :S |
Author: | Ktomislav [ Wed Jan 13, 2010 8:51 am ] | ||
Post subject: | Re: make a program look smooth | ||
I think you just made a double thread. ![]() Anyway, if you have tried using View.Update you must have used it the wrong way. You should put View.Update right before delay. And I recommend you to put this outside the loop because you could easily get an error saying you have to much pictures or something like that.
|
Author: | UnTiteled [ Wed Jan 13, 2010 3:12 pm ] |
Post subject: | RE:make a program look smooth |
ok...if i put the view update before the delay...it doesnt change anything |
Author: | UnTiteled [ Wed Jan 13, 2010 4:34 pm ] |
Post subject: | RE:make a program look smooth |
i figured it all out thanks for your help and by the way you have to put the View.Update, cls after the delay |
Author: | TerranceN [ Wed Jan 13, 2010 4:57 pm ] | ||
Post subject: | Re: make a program look smooth | ||
Your game is flashing because View.Update() is only getting called when your fireball is active, adding a View.Update() to your first game loop, will stop the flashing (I think). But there is still a problem with how you are coding your game loop. This problem wont stop what you have from running, but you will find it difficult to add more things to draw, and if you wanted to change any of your code, you would have to change it in more than one place. Say you wanted to draw a second fireball when you hit a different key, would you add another loop inside your main loop and your fireball loop? But then what if both are active? I hope you can see this would take a lot of duplicate code. Another, more expandable way, is to use boolean values to indicate whether or not each fireball is active.
Of course, if you don't need to add any more fireballs (or conditional drawings) then you dont need to use this, but I thought I should mention it Hope this helps. |