Lesson 1.6 - Using collision effects
In this lesson, we'll learn how to add collision effects to the screensaver. Actually the sprites overlap when they encounter each other, they do not collide. You can make them collide like balls on a pool table.
Set the collision options
1. First, be
sure to be in "Stopped" mode. Double-click on the sprite "Blue Sphere" in the list (
), see below. A dialog opens:

2. Click on
the Sound & Collision tab
if necessary. Select "Level
1" in the Object Collision
Level list (
). The application supports several collision
levels. For example, if you set the blue and red balls to level 1, and
if you set the green and spinning balls to level 2: blue and red balls
will collide together but they won't collide with green and spinning balls.
You can consider levels like invisible layers in which sprites are moving.
The rule is simple: Two
sprites must be in the same collision level to collide together.
IMPORTANT:
Collision level are not related to sprite order in the project (ie. the
order of sprites in the project list).
3. Select "Change path" in
the Collision with another object
option (
). This option is mostly used. This permits to
change the motion path of the object after the collision (like this is
the case for 2 balls on a pool table for example).
4. When done, click OK. You changed the option for the blue ball.
5.
Now, repeat the same procedure for green,
red and spinning
balls (
).
6. When all the collision settings are set, try your screensaver fullscreen (F11) or switch to "play" mode. Much more fun, isn't it?
Add sounds to collisions
7. You can add
sounds when the sprites collide together. This could be a cool addition
to your screensaver (don't add too much sounds though!). Double-click
on the sprite "Spinning Ball"
in the list (
), see below. A dialog opens:

8. Select the
Sound & Collision tab if necessary.
In the Collision Sounds group,
we'll specify a sound in the Between
Objects zone. You can specify a full pathname in this zone but
we recommend you to click on the "..."
button (
) and select the following file: "...\My
Documents\Axialis Librarian\Media Files\Sounds\Sound07.wav".
The full pathname to this file appear in the edit zone (
).
9. You can hear
the sound by clicking on the Play button (
). When done,
click OK. Each time a sprite collide
with the Spinning Ball you'll hear this sound. If you want to hear the
collision sounds, you must test the screensaver fullscreen (F11).
The collision sound are not audible in Play
mode.
IMPORTANT:
Only WAV sounds are supported
for collision sound. The sound feature can be disabled by the end user
(in the compiled screensaver).
Lesson 7 - Defining
a background music