Animation

Animation

I find it very hard to create animated sprites, but as I mentioned earlier, this could easilybe because I have no skill when it comes to drawing.Animation is perhaps one of the most important elements of a game. Even with a simple game like Tetris, things move—they animate. Having your hero move around the screen in a fixed pose like some kind ofstatue is not much fun to watch. It’s much more exciting to see your characters arms andlegs moving as they walk around the screen.With most modern 3D games, the objectswithin the game (such as bad guys) are 3D models with many triangles used to represent acomplex shape. Movement of these objects is achieved by applying mathematical transformations to the triangles making up the 3D object, causing them to move as required.Some games even employ a skeletal system allowing the animator to simply move the bones of a character and have their body follows as necessary.

Because Sir Lamorak’s Quest is a simple 2D game, we won’t need anything that complex. Instead, we’ll use a simple form of animation that’s very similar to stop-motion animation.This process shows one image (sprite) after another, with the new image (sprite )being in a slightly different position to the last.When pieced together (with code), the images appear to animate as one-image transitions to the next.

By now, you should start to see the benefits of having a sprite sheet.The sprite sheet defines the animation’s different frames; then we use code to load each sprite (or frame) into the animation and display the animated sprites on screen. Figure 2.4 shows a simple sprite sheet containing sprites that can be used within an animation. The first line shows the character running down, the next line running up, then right, and finally left.

 

Figure 2.4 An animation sprite sheet.    

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值