PART FIFTEEN
FLOAT TEXT

MESSAGE SYSTEM

Message Class

MessageManager


Putting It All Together

CHECKPOINT
Run your code and see...

OVERLOADING AND DURATION 

What is Overloading?

Default Constructor

TimeLeft and Duration

GainMoney

CHECKPOINT
Run your code and see...

FADE

Time Left As Percentage

Fade Effect

Each time we render, make a new color based on the old color variable.  Note that we don't modify the old color directly!  

If we had done so, then passed this Message something like color.White, it would modify *all* the uses of white in our program.

CHECKPOINT
Run your code and see...

FLOATING MESSAGE

Adding The Class

ANNOUNCEMENT

Announcement System

The text is centered on the screen, but left aligned!  This means we'll need to do math based on the width of the text.

Let's Make Centering Better

As a thought experiment:  how might you write this differently to help prevent it from shifting a value multiple times?  What about allowing the user to go back and forth between different text alignments?

CHECKPOINT
Run your code and see...