BBC BASIC for Windows
« Sprites and Refresh »

Welcome Guest. Please Login or Register.
Apr 6th, 2018, 12:01am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Sprites and Refresh  (Read 760 times)
KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Sprites and Refresh
« Thread started on: Nov 24th, 2013, 5:37pm »

I have adapted a neat little program from the Acorn days which produces one of those scrolling day and night displays which overlays the pattern of night (and, obviously day) on a map of the world. It works very nicely and as I am using to demonstrate a concept, day and night move in response to cursor keys rather than the clock.
Fine. Everything is rock steady, because I am using *REFRESH OFF and a *REFRESH after drawing the new pattern.
However the sun is indicated with GCOL3,whatever, which means that its colour varies as it passes over land or sea. I thought it would be a nice idea to use a sprite for the sun. Fine, everything works - except that now the shadow of night and the text on the screen flickers horribly.
Remove the references to sprites and back to rock steady. Initialise sprites and flicker.
Am I doing something wrong or is this an undocumented feature of the sprite library?
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Sprites and Refresh
« Reply #1 on: Nov 24th, 2013, 6:38pm »

on Nov 24th, 2013, 5:37pm, KenDown wrote:
Am I doing something wrong or is this an undocumented feature of the sprite library?

I don't think you can mix the use of sprites with *REFRESH, as these are alternative ways of making animation 'glitch free'. I would recommend that you choose one or other technique, and then stick with it for the entire program.

For example if you use *REFRESH don't you need to redraw the background each time the sun moves anyway? Even if you don't need to redraw the entire background you could save and then restore just the bit covered by the sun (e.g. using *GSAVE/*DISPLAY or RECTANGLE .. TO).

Richard.
« Last Edit: Nov 24th, 2013, 6:43pm by admin » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls