Document Sample
Animation Powered By Docstoc
   The heart of almost all games is animation.

   Without animation, there would be no
    movement and without movement we’d all
    be stuck playing board and card games.

   Every game with animation employs some
    type of animation engine, typically involving
   Look at the picture, What do you see?
   Animation is the illusion of movement

   Every animation you’ve ever seen is really just
    an illusion.

   Movement is really just a trick being played
    on your eyes.
   Unlike television and movies, computer games
    are much more limited when it comes to frame

   High Frame rates in games correspond to much
    higher processor overhead, so game developers
    are left to balance the frame rate against system
    speed and resources.

   Lower resolution and smoother animation or…
   The classic approach to animation is to draw
    a background image separately from the
    objects moving on the foreground(cel
     Cel animation is limited b/c only so many cel
     sheets can be overlaid

   Question: Why do game developers have
    more control over animation than traditional
   There are 3 types of 2D animation:
     Frame – Based Animation:
      ▪ non-gaming animation
      ▪ Pre-generated static frame images(Flip book)Make one
      ▪ Ex. movies
     Cast-Based Animation
      ▪ Gaming animation
      ▪ Sprite animation objects move independently of background
      ▪ Ex. Weather man
     Palette Animation
      ▪ Animating colors in a graphical object
   Position – each sprite has a (x,y)

   Velocity – how the objects move

   Transparency – every image is rectangular

   Z-Order – layers

   Collisions – when objects interact
   Position – (x, y) of upper left corner
   Velocity – where the sprites each cycle
   Z-order – ordering of a sprite for passing
   Bounding Rectangle – area the sprite can travel
   Bounds Action – how sprites act when they hit the
   Hidden/visible – instead of deleting objects
      ▪ Ex. Whack – a - mole
   Global variables to handle the sprites bitmap,
    rectangular position, Z-order, bounds,
    bounds action and hidden
   3 constructors to create sprites
   Functions necessary to set and get all
    variables associated with sprites, draw the
    sprite and update and isPointInside
   Bounds Actions have 4 types
     0 –stop, 1 – wrap, 2 –bounce and 3 - die
   Building the Fore Program
   Create a program that used balls as sprites
    and simulate different bounds actions using
    update and draw
   Update the UFO program to have some
    standard background sprites
   Extension for an A: Enable Collisions to delete

Shared By: