This week I began to create my game. After the player helps my flying object avoid obstacles the gradient background will change over time. I have placed the gradient background code I found on Processing’s reference page in my sketch and started sorting it into a class so I can execute a different background after a certain amount of time (or points) collected:


Figure 1. Gradient background Class.



Figure 2. First tab, initializing parameters for gradient class.

The above page shows the function within the class at play. I wanted to use the gradient functions’ parameters in the class but due to the constructions of the function itself, it seemed I was unable to do so. The function itself however, could have changed parameters for a different object within the class. Therefore it works in away but only within the class’s function.



Figure 3. First Gradient Background.

Figure 3. First Gradient Background.


Figure 3. When gradient background 1 is active.


Figure 4. Second Gradient background.

Static page of the white ellipse object and gradient background. (It will be controlled going up or down with the potentiometer to avoid incoming objects which just like the white ellipse will have their own classes.) The gradients will change stating a change in time from day to dusk to night.