If you want to have a lot of animation on the screen, you will come across
two problems if you try to do it using objects:
- There is a limit on the number of objects per screen, so you may not be able to
animate everything that you want to that way.
- Objects slow down the game - the more objects on the screen, the slower
the game runs.
The solution to these problems is to use an animating background scene.
How it works is this: Each room can have from 1 to 5 backgrounds. Normally,
each room just has one background. However, you can import up to four extra
backgrounds in each room, and if you do so then the game will cycle through
them, giving the effect of animation.
This gives two main advantages - you can animate the entire screen, and due
to the way the engine works, it doesn't slow down the game at all.
To import a second background for a room, load the room into the editor, pull
down the "Main background" list box, and choose the "Import new background" option.
Choose the file that's storing the background and you're done.
To delete a background, select it then click the "Delete" button.
You define the speed at which the backgrounds will animate by setting the
"BackgroundAnimationDelay" option in the property grid for the room. The default
is 5, which cycles background every 5 frames.
NOTE: All the background scenes must be the same size.
NOTE: (256-colour only) The backgrounds frames each have their own palette (unless
you select "Share palette with main background" before importing). This means
that when the current frame switches in-game, the palette will get reset - therefore
you can't use special palette effects such as CyclePalette or SetPalRGB on screens
with animating backgrounds.
|