I am working on a project that I think could be made with processing. I know what I want to do but I am not experienced enough to get my head around some programming concepts so I don't really know yet how to translate my idea into a working program. I've been looking a bit into working with strings and object oriented programming and also I've been playing a bit with controlP5 because I want some dropdown-menu functionality.
I was hoping if someone could help me with determining a basic structure for my project because I have been trying to get some seperate aspects of the program working but I have no idea how to tie everything together.
Basically the idea is this:
I want to have a couple of different txt files that have sentences on them, seperated by lines.
Each txt file represents a different type of sentences.
I'd like the program to select a TYPE of sentence (and thus the text file it should draw from), based on certain chances
I'd like these chances to be based on the selected items from a drop-down list.
Then once, the type is chosen, it should randomly select a sentence from within the text file.
So in practice:
I open the program
I see a dropdown menu
I select item 3 from the dropdown menu
Item 3 has a chance-set tied to it that determines that there is:
25% chance for type 1 to be chosen
25% chance for type 2 to be chosen
50% chance for type 3 to be chosen
Then, let's say based on these chances that type 3 is chosen, it will select a random sentence (or line) from type3.txt and display it
So far I only figured out how to randomly select lines from a txt file and how to make a dropdown menu using controlP5 but I don't know how to get these chances in and how to tie the functions together.
Also, I'd like the text that is displayed to be sequential. So that it will look like a feed of stacking sentences that is updating constantly based on these chances and text files. So far i've only been able to display text that replaced the previous text.
The image below roughly shows what i'd like it to look like. Imagine the colours of the sentences are the types and that the newest sentence would always be on top or on the bottom and the older ones move up or down untill they leave the screen.
I know I'm really asking for a lot and I don't expect anyone to give me a ready-to-use code that I can just copy/paste. I like to learn and do my best to make it myself. I am just wondering what the right approach is towards a project like this because I'm a bit lost and I don't know where to start in terms of structuring the program.