Game Development Reference
In-Depth Information
Listing 60: A simple script that receives OnDestruction message and reacts by sending Break message
Exercises
1. The vehicle we made in section 4.2 is a four-wheel drive vehicle. Change it to
two-wheel drive so that only the back wheels are connected to the motor.
2. Create two boxes with rigid bodies and make the vehicle we made in section
4.2 carry them as it moves. What are the necessary changes you have to make on
the vehicle in order to be able to carry such objects?
3. Implement a transmission control for the vehicle in section 4.2, so that the player
can change the speed manually. Remember that a higher shift increases the maximum
speed and decreases motor torque. Use A key to shift up and Z key to shift down.
Implementatleast4differentspeeds.
4. Use a modified version of RaycastShooter to implement a shotgun. This shotgun
must be usable with GunInput script, and must cast at least 5 rays in each shot. These
rays must originate from the muzzle and diffuse randomly by some degrees on x
and y axes. Finally, disable continuous shooting for the shotgun.
Search WWH ::




Custom Search