Skip to content

Raulentiul/Who-wants-to-be-a-Millionaire

Repository files navigation

Who wants to be a Millionaire game in Java

Short description of the project

This game was done using JavaFX and a connection to an Oracle Database. It contains a LogIn and a CreateAccount page, and there are two types of users: players and admins (the role is given through the database). If the user logs as an admin, they can add a question to the database, but as a player, the game will be initialized.
The game features the three lifelines: FiftyFifty, AskAudience and PhoneFriend.
Unlike the television game, this one only stops if the player fiinishes all the questions that are in the database.

Before runnig the project

I used VS Code for this program, so I had to download the necessary libraries:

  • For the connection with the Database, you need a Connector.
  • For the GUI libraries, I used JavaFX.
  • For the Test classes, I used JUnit, and it can be downloaded from within VS Code. It is not mandatory for the program to run.

You may want to update the launch.json and the settings.json in order for the program to see the respective libraries.

Setting the Database

In order to have a Database, you have to download Oracle Database and a Software for easier use.
After the download, you'll have to open the SQL Plus command prompt, and input the username (SYS as SYSDBA) and any password you wish (in my code, BlaBlaBla).
After opening the software and making a connection, you'll have to make two tables.

  1. ACCOUNT
    • USERNAME, PASSWORD, BOSS
  2. QUESTIONS
    • QUESTIONID, QUESTIONTEXT, CORRECTANSWER, ANSWERA, ANSWERB, ANSWERC, ANSWERD, AVAILABLE

Don't forget to update any part of the code if necessary!

Running on Linux

sudo apt-get install openjfx
javac --module-path /usr/share/openjfx/lib --add-modules javafx.controls -cp .:lib/ojdbc11.jar Main.java
java --module-path /usr/share/openjfx/lib --add-modules javafx.controls -cp .:lib/ojdbc11.jar Main

In order to make it work, don't forget to install SQL Plus!

About

A GUI game that also has a database connection

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages