Time for action — changing the color

  1. Instead of the scaler, add a ColorFader affector that subtracts 0.25 of each color channel per second:
    affector ColorFader
    {
    red -0.25
    green -0.25
    blue -0.25
    }
    
  2. Compile and run the application. You should see how the white particles get darker with each second they live.
    Time for action — changing the color

What just happened?

We added an affector that changes each color channel during the existence of a particle, using the predefined values.

Have a go hero — change the color to red

Change the colorfader code so the particles fade from white to red. The result should look like this:

Have a go hero — change the color to red
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.213.87