Graphics Reference
In-Depth Information
Figure 8-17 An even more exciting game of “Push the Sphere into the Abyss with the Cube”
Forthepurposesofthischapter,onlyminimalinteractive logicisnecessary,sothisisallthedetailI'mgoing
to cover here. Much of the time, no interaction will be necessary—you'll just set up a physical situation and let
the simulator take over. However, sometimes using interactive triggers can be very handy to get the effect you
want. For more information about working with interactive content in the game engine, you can refer to Part V
of this topic.
Using Actions in BGE
Forpeople designing games, it'simportant tobeable tohaveanimated objects andarmature motions accessible
to the game logic. Mostly, animators are best off doing sophisticated animation in the ordinary Blender anima-
tionenvironment—animationinthegameengineisfarmorerestrictivethanitisinBlenderitself.Nevertheless,
there are times when you will want to simulate physical reactions to hand-keyed animation. To do this with
BGE, you use actions in the game-play environment, as follows:
1. Start a fresh session of Blender and key the location and rotation of the default cube at frame 1.
2. Advance to frame 31 (click the Up button three times), move the cube up along the z-axis, and rotate it
slightly to the left. Key this location and rotation as shown in Figure 8-18 . Note that the figure shows the
keyframe view in the F-Curve Editor, the Action Editor, and the 3D window.
3. In the Logic buttons area, with the cube selected, set up a sensor, controller, and Ipo actuator as in
Figure 8-19 . In the setup, I have the sensor selected as Always, with the left pulse button activated. This
sends a pulse message repeatedly from the sensor. The Action actuator type is Play. The start and end
framesoftheIpotobeplayed,intheStartFramandEndFramfields,are1and30.WhenyoupressP,the
 
 
 
Search WWH ::




Custom Search