Sprites And Mirrors In Blitz Basic Phillip Maslan
Sprites And Mirrors In Blitz Basic Phillip Maslan Rodger Wang 1
What is a sprite, and how can I use one? • A sprite is a two triangle polygon used for representing 2 D objects in 3 D space. • Initialize a sprite like an entity, but using the command: – sprite. Name = Load. Sprite ( “graphic. gif” ) • After a sprite is initialized it may be positioned like and moved as any other entity. 2
Why would you want to use a sprite? • Useful for any entities that must appear in large quantities. • Useful for 2 D interfaces in 3 D games. • Useful for simple background fills. 3
Attaching a sprite to the camera is great for on screen menus. • While loading a sprite, assign it to a parent camera with the command: – sprite. Name = Load. Sprite “x. gif”, 0, parent • Before moving the camera, move the sprite into position on screen with: – Position. Entity sprite. Name, x, y, z, true • The sprite will be in this position on screen at all times. 4
Sprites are also great for creating ethereal images. • Making a sprite shimmer is easy by oscillating the resize command: – scale. Sprite sprite, xscale, yscale • Moving the sprite and making it shimmer is great for energy blasts and moving explosions. • Also could be used to draw attention to the on screen menus. 5
Sprites have different viewing modes for different needs. • Fixed, Make the sprite always face the camera. – Great for stars in a star field and messages. • Free : Make the sprite stay face in a certain direction. – Great for teleports, paintings, and signs. • Upright : sprite always faces camera, but also tilts with the camera. – This is great for sprites attached to the camera. 6
Mirrors make great shiny floors. • A mirror is a infinite flat surface. • The surface is added with the command: – mirror = Create. Mirror() • Complete the effect by adding texture to the surface. Mirror. Cone. bb 7
Thank you. Questions? 8
- Slides: 8