Name: ___________________________________________ 121 Lesson 10 Spawning Copyright Goodheart-Willcox Co., Inc. May not be reproduced or posted to a publicly accessible website. If the car accelerates from 0 mph to 20 mph, or .006 miles per second, in two seconds, the acceleration is .0015 miles per second2 (.006 ÷ 22 = .0015). If the driver applies the brakes, the car will slow down. Slowing down or changing the instantaneous speed in the negative direction is deceleration. If a dog runs out into the path of the car, the driver slams on the brakes. The speed of the car might change from 30 mph to 0 mph in two seconds. In game design, it is typical to apply the formulas of direction, speed, and acceleration using the virtual distances in the game. The game frame can be broken down into a grid, like you did in the first lesson. The regular spacing of the grid acts like real-life measurements. In the real world, a meter is 100 centimeters. In the virtual world, one grid section might be 10 pixels by 10 pixels. Just as the virtual world reduces the size of the real-world room, it must also reduce the time intervals to accurately match the scale. In most games, the time intervals are milliseconds, or 0.001 seconds. Speed in a video game is calculated by how many pixels an object moves in each fraction of a second. If the software speed is calibrated so a speed setting of 1 moves five pixels per second, then it would take 20 seconds to move 100 pixels (100 pixels ÷ 5 pixels/sec = 20 sec). Animation Animation is the creation of a series of images that quickly change to give the illusion of movement. This is similar to a flipbook animation where you draw a series of pictures in the corner of a notepad and then flip the pages to see the object animated. Game design software has some built-in animation features or you can create custom animations on your own and import them. To animate a sprite is to make it appear to move. To accomplish this, the designer needs to create several animation frames. As you learned in Lesson 1, these images or frames form an animation set. On each frame, the sprite changes a small amount. If you need a sprite to walk, you need to create animation frames for each pose as the characters’ arms and legs articulate. Articulation is the bending and positioning of movable parts. A human character may have articulated legs, arms, fingers, head, lips, eyelids, and many other parts, as shown in Figure 10-3. Acceleration Force Deceleration Force Goodheart-Willcox Publisher rzymuR/Shutterstock.com Figure 10-2. Force applied to an object creates acceleration and deceleration.
Previous Page Next Page