Monday, February 2, 2009

Boolean Functions and If/Else

Today we will learn about an instrument that is a big part of game and simulation programs: The if/else statement that helps you to control the execution in your animations. This statement allows you to perform a number of actions only if certain conditions are met and to perform something else otherwise.
We will also learn about functions that help to make decisions in if/else statements. Those functions are called Boolean Functions. They return a TRUE or FALSE value.
We will observe how these powerful weapons can help improving the known bugs of the Zeus' Wrath animation. Zeus then will no longer be able to strike any object and will laugh at us if we want him to strike a philosopher twice.

In the lab you will be working on exercise 6 on page 199 of the textbook. This exercise takes the animation even a step further: The philosophers start talking and Homer gains immunity against Zeus' strikes.


Homework
  • Read section 6.2, pages 178-191
  • Answer the review questions 6.2.

No comments: