Game Development Reference
In-Depth Information
This will ensure that when the projectile is grabbed, the position of the bird is
contained in the two game attributes ProjectileX and ProjectileY.
Next, when the bird is not grabbed (the Otherwise section of the Touch rule),
change the value of the ProjectileX and ProjectileY attributes to the initial
position of the projectile, which is contained in InitialProjectileX and
InitialProjectileY.
Expand the Otherwise section of the Touch rule, and drag and drop a Change
Attribute behavior in this section. Change game.ProjectileX to
game.InitialProjectileX. Drag and drop another Change Attribute behavior and
change game.ProjectileY to game.InitialProjectileY. These two additional
behaviors are shown in Figure 6-17.
Figure 6-17. Back to initial position
Now you have attributes ProjectileX and ProjectileY set. Let's spend some time
on the elastic.
Elastic Theory
The elastic will be a basic actor of a very small size (5x5) that will modify its
shape (width), position, and rotation depending on the position of the projectile.
Figure 6-18 illustrates how the elastic interacts with the projectile.
 
Search WWH ::




Custom Search