Game Development Reference
In-Depth Information
FIG 3.3 Setting pixel values for UV
modification.
Step 7. To add more sprites to the scene, duplicate SimplePlane, and
change its location and the start and end pixel values. Using the available
icons in the texture map you will be able to make a nice street scene.
SimplePlane can also be treated like the rocket ship from a previous
workshop, and code can be added to move it around in the game.
Note
Specifying UV Values
The listing in Listing 3.2 assumes that the pixel values for the sprite
textures have the y values flipped. If you find that your sprite textures are
upside down, change the code for all y values to endPixel.y/texture
.height. This will turn the images up the other way.
3.4 Animated Sprites
Technically, any 2D image used as an object or character in a game
is a sprite. However, the term is associated more often with a set of
2D animations representing specific movements of a game object. In
this case, a sprite consists of a set of images that combine to animate
specific gestures, such as walking, running, and jumping. The sprites are
imported into a game engine and code is used to control how the frames
are presented in the game environment to give the illusion of character
movement.
Search Nedrilad ::




Custom Search