
-----------------------------------
ziggy2shoes
Sun Nov 05, 2006 11:26 pm

The Flickering Mystery
-----------------------------------
Hello!

Note: I am an inexperienced programmer.

Thank you for taking the time to read this post good sir/ma'am.
I am making a game for school. (Aren't we all?)

Everything was going fine until somewhere during the throes of coding I seem to have done something to cause the avatar (a .bmp of a zoid) in the game to flicker oddly. 

Now, not wanting to trouble for help immediately I looked for a case such as mine. I soon discovered an apparantly useful command called View.Update!

Great, however, I am not sure where to put this command to stop the flickering, I have tried many positions but to no avail. Alas, I turn to you great heroes of compsci.ca in hope that you might be able to help me, as time permits naturally. 

Thank you once again and enjoy the rest of your exsistence. 

Yours enigmatically, 
Pepito, Supreme Commander of the 18th Homing Pigeon Surveillance Unit

THE CODE:

%***********************************
%*                                                         *
%*   Z O I D S : N E M E S I S                  *
%*                                                         *
%***********************************

%

If necessary I can attach to you a .zip of the whole schidoodle, pictures and all.

-----------------------------------
richcash
Sun Nov 05, 2006 11:57 pm


-----------------------------------
In order to use View.Update you need to use this :
View.Set ("offscreenonly")
View.Set is the same command as setscreen, so you could just add the "offscreenonly" part into your existing setscreen statement.

-----------------------------------
DemonZ
Mon Nov 06, 2006 1:14 am


-----------------------------------
yes u must use the offscreenonly when using View.Set or setscreen, but that will only make a blank page, because everything that was drawn to the screen was copied off the screen and is waiting to paste what was drawn. This is known as animation buffering, so when you call the setscreen or View.Set and are using offscreenonly, make sure you add a View.Update or View.UpdateArea in your main loop followed by a cls to stop all the flickering, like so:

%variables, procedures, processes, whatever on top
setscreen ("offscreenonly")
% Main loop
loop
% All the game logic
View.Update
cls
end loop
This way it will copy what was drawn to the screen and buffer the animation, making it not flicker.
Hope this helps

-----------------------------------
ziggy2shoes
Mon Nov 06, 2006 9:45 am


-----------------------------------
Excellent show chaps, it worked!
Thank you very much. 
I'd give you some bits but alas, I don't have many. 
Oh well. Thank you!
