Amos Professional Manual Contents Index
Updating Objects
Displaying objects over a changing background
When objects need to be displayed against a rapidly changing background picture, other
problems can occur. The most important thing to understand is that although they can hold the
same images, Sprites and Bobs are completely different from one another. The following tables
set out these differences.
Sprites
- exist independently in the Amiga's memory
- are created by the Amiga's DMA hardware
- are stored independently from the screen, in a separate memory area
- use hardware coordinates
Bobs
- do not exist independently, their appearance on screen is all there is!
- are created by software using the Blitter chip
- are stored as part of the current display
- use screen coordinates
This has far reaching implications for your programming, and is the crucial reason for the entire
DOUBLE BUFFER system. It is the complete independence of Sprites that make them so useful.
AMOS Professional allows you to use Bobs with animated screens, and the next section explains
how screens are updated to permit this.
The update process
This explanation of the Bob movement system is very detailed. If you are not interested in the
theory, then the BOB CLEAR and BOB DRAW commands are explained later in this Chapter,
and will be enough to allow you to proceed.
The updating of single buffered screens will now be examined. Supposing you want to display a
single Witter Object on the screen. The following steps need to be undertaken:
- Draw up the display screen as usual.
- Discover the start position where the Bob is going to be displayed, and establish the
background area underneath the Bob.
- Copy this background area to a safe location in memory.
- Display the Bob over the original graphics in the target area, using the appropriate image from
the Object Bank.
- Discover the next position where the Bob is going to move.
- Clear the Bob from its current position, by displaying the safely copied background image at
its original screen location.
- Examine each Bob in turn to see if it has moved since the previous update. If so, make a copy
of the original screen image at the new coordinates.
- Finally, update by re-drawing the Bob at its new screen position.