Game Development Reference
In-Depth Information
Table 6-2. Projectile Actor Attributes
Name
Projectile
Size\Width
25
Size\Height
25
Color\Red
1
Color\Green
0
Color\Blue
0
This small red actor will be thrown by the slingshot.
Storing the Initial Position
In order to store the initial position of the projectile, you will use two game
attributes. The reason for using game attributes instead of actor attributes is
because you will need to access this initial position from other actors (the
subsequent projectiles).
Return to the Scene Editor and create two real game attributes named
''InitialProjectileX'' and ''InitialProjectileY.''
Use a Change Attribute behavior to store the initial position of the projectile in
the two attributes you just created. Open the Projectile actor in the Actor Editor;
drag and drop a Change Attribute behavior and change game.InitialProjectileX
to Projectile.Position.X as shown in Figure 6-10.
Figure 6-10. Change Attribute of InitialProjectX
Drag and drop a second Change Attribute behavior (or duplicate the previous
one) into the Projectile actor and change game.InitialProjectileY to
Projectile.Position.Y.
 
Search WWH ::




Custom Search