Computer Science Canada Sprites flashing, spazzing |
| Author: | paperclipz [ Thu Nov 29, 2007 12:15 pm ] | ||
| Post subject: | Sprites flashing, spazzing | ||
I finally got one of my sprites working. Heres the code im using
whats going on is whenever im trying to move, the main picture of him standing in one place consistently shows up. When i move west, a black screen pops up surrounding the vicinity of the sprite and red/white dots show up in this box. If anyone knows what to help me with it would be much appreciated. Thanks. |
|||
| Author: | isaiahk9 [ Tue May 06, 2008 5:26 pm ] |
| Post subject: | Re: Sprites flashing, spazzing |
I am not positive but I believe that it is because you are using the "flashy" animation technique. To make it un-flashy, all you need to do is put setscreen("offscreenonly") on the top of the code, and then whenever you want to draw or display something put View.Update. That should take care of your problem, but I'll monitor this post in case it doesn't. |
|
| Author: | Saad [ Tue May 06, 2008 5:41 pm ] |
| Post subject: | Re: Sprites flashing, spazzing |
isaiahk9 @ Tue May 06, 2008 5:26 pm wrote: I am not positive but I believe that it is because you are using the "flashy" animation technique. To make it un-flashy, all you need to do is put setscreen("offscreenonly") on the top of the code, and then whenever you want to draw or display something put View.Update. That should take care of your problem, but I'll monitor this post in case it doesn't.
Let me provide more insight into the "flashy" animation technique. What's really going on is that as your drawing something it is instantly drawn in the screen. This means you keep saying each thing getting drawn. As a result it creates flickering. What doing View.Set ("offscreenonly") does is create an off-screen buffer onto which the graphics are drawn. When View.Update the changes are applied to the screen. This link goes over how to use each in more detail and with some code. |
|