My project, Marvelous Trivia, makes use of Object Oriented Programming to create a trivia game of Marvel Comic questions. My application has 2 classes, Question and Game, as well as an Index page where general functions are be rendered.
I felt lost at the start of my project because I felt as if there were so many directions I could take to execute a trivia game. To lessen the load, I began by mapping out my flow to determine where I would place a function to get the most bang for my buck. This helped immensely with determining where to begin! During my map out process I declared a relationship between my classes by having my questions belong to a game and vice versa (game has many questions). This meant I could separate my questions into different difficulty levels that my user can chose from. Then I could render only those specific questions based on a selected difficulty. This would also allow an automatic association when a player adds their own question to the database. Within the form to create a question, a difficulty level(game_id) is chosen which translates to which game that question becomes associated with.
One of my best friend throughout the creation of this application was a combination of the renowned
debugger and the illustrious
Debugger will stop your code where ever it is placed. You can then go into your console and type code from within your function to see what it is actually doing and or returning.
Console.log() allows you to pass in code snippets as an argument. When your application gets to that code it will not stop the program, but instead print the value of the argument you passed it, to the browsers console.
I used a combination of these throughout my project build. I will say I probably utilized