Đang chuẩn bị liên kết để tải về tài liệu:
3D Game Programming All in One- P24

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

3D Game Programming All in One- P24: During the past several years while working on the Tubettiland “Online Campaign” software and more recently while working on the Tubettiworld game, I figure I’ve received more than a hundred queries from people of all ages about how to get started making games. There were queries from 40-year-olds and 13-year-olds and every age in between. Most e-mails were from guys I would estimate to be in their late teens or early 20s. | Building the World 597 scale 1 1 1 dataBlock CampfireEmitterNode emitter CampfireEmitter velocity 1 Okay save your files and then launch Koob. When your player spawns in turn to the right you should see a little fire burning in the gully there as shown in Figure 21.1. The flame is the glowing object to the left of the crosshair in the picture. Now let s add the smoke. We ll do it slightly differently. We begin by defining the particle and emitter as before but then we ll place it in an easier way using the World Editor. Open up the particles.cs file you created earlier and add the following Figure 21.1 Campfire. datablock ParticleData CampfireSmoke textureName data particles smoke dragCoefficient 0.0 gravityCoefficient -0.15 inheritedVelFactor 0.00 lifetimeMS 4000 lifetimeVarianceMS 500 uselnvAlpha false spinRandomMin -30.0 spinRandomMax 30.0 colors 0 0.5 0.5 0.5 0.1 colors 1 0.6 0.6 0.6 0.1 colors 2 0.6 0.6 0.6 0.0 sizes 0 0.5 sizes 1 0.75 sizes 2 1.5 times 0 0.0 times 1 0.5 times 2 1.0 Team LRN 598 Chapter 21 Creating the Game Mission datablock ParticleEmitterData CampfireSmokeEmitter ejectionPeriodMS 20 periodVarianceMS 5 ejectionVelocity 0.25 velocityVariance 0.20 thetaMin 0.0 thetaMax 90.0 particles CampfireSmoke datablock ParticleEmitterNodeData CampfireSmokeEmitterNode timeMultiple 1 Save your work and then launch Koob. Locate the campfire and face it in camera fly mode press F8 . Open the World Editor press F11 and then enter the World Editor Creator press F4 . Browse the Tree view until you locate Mission Objects environment particleEmitter. Click it to place another particle emitter. You will get the Building Object ParticleEmitterNode dialog box. Using the illustration as a guide choose CampfireSmokeEmitterNode from the datablock list and then choose CampfireSmokeEmitter from the Particle data list see Figure 21.2 . After the smoke appears move it with the cursor until it s positioned directly over the campfire. Press F11 to get out of the editor grab .