Project #8 - Quote
Project Designed by Sam Dua (2024)
REQUIREMENTS
Create a program that displays at least 10 different messages over time
Quotes must be at least 3 words long
Every 2 seconds, the program should randomly display one of the quotes with random color, font, position and size.
Uses at least three fonts
Quotes should never move off screen
THEME IDEAS
Inspirational Quotes
Song Lyrics
STEP BY STEP
Part One - Show All Quotes
Setting It Up
Declare your array of Strings at the top of your program
In setup(), initialize the array and its elements. The code below is an example of this, using your own quotes.
Displaying Quotes
We'll test your array by showing *all* quotes on the screen at once
This will be changed later, but for now display each quote on the screen with a for loop so that you can clearly see each phrase
Reminder: Avoid copying and pasting code; create methods for any chunks of repeated code
At the first stage of the project, we'll just print out all the of the elements in the list.
Part Two - Random Quotes
Timing
Set your program up so that you are randomly displaying a quote from your array every 2 seconds
Example:
if (timer % 120 == 0)
{
index = (int) random(10);
}
Hint: there are 60 frames per second and you should have a timer variable
Your program should always have a quote visible
Only one quote should be visible at a time
Basic Randomization
Modify your program so the color of each quote is randomized
Test your program to make sure that the change works
The color should only change when a new quote is displayed
Add two more randomizations, testing each time:
Random Position
Tip: Have your quotes always start randomly near the middle of the screen as this will help give you room for movement in Part III.
Suggested range for position would be between 25% - 75% of the screen's width and height.
Random Text Size
At this stage we just create text. It should vary in position and size.
Part Three - Make It Fancy!
Fonts
Declare and initialize a new font
Apply that font to all of your text
Test your project displays correctly with the custom font
Additional Fonts
Declare and initialize two additional fonts
Instead of always using the first font, randomly select a font when you display a new quote.
Movement
Using variables for x and y speed, make your text move
Experiment to find a reasonable speed that makes the text readable and remain mostly on screen.
You may need to go back and revise your random starting positions.
At this stage we use fonts and colors to make it look better. Feel free to add a cool background or additional visual effects!