Skip to content

JBriscola è stato concepito come una soluzione sofisticata per gli amanti dei giochi di carte e degli appassionati di programmazione Java. Il suo nome, "JBriscola", nasce dalla combinazione della lettera "J", che rappresenta il linguaggio di programmazione Java, e il famoso gioco di carte italiano, la "briscola".

License

Notifications You must be signed in to change notification settings

profumato4/Briscola

Repository files navigation

JBriscola

LICENSE Download Stars CodeQL CI

Index

  1. Italiano

  2. English

🇮🇹

Perchè JBriscola?

JBriscola è stato concepito come una soluzione sofisticata per gli amanti dei giochi di carte e degli appassionati di programmazione Java. Il suo nome, "JBriscola", nasce dalla combinazione della lettera "J", che rappresenta il linguaggio di programmazione Java, e il famoso gioco di carte italiano, la "briscola".

Questo progetto è nato con l'obiettivo di offrire un'esperienza di gioco coinvolgente e divertente, mentre allo stesso tempo dimostra le capacità e la versatilità del linguaggio Java nel contesto dei giochi. JBriscola offre una vasta gamma di funzionalità e possibilità di personalizzazione, garantendo ore di divertimento per gli utenti di tutte le età e livelli di esperienza.

Con una solida architettura e un'interfaccia intuitiva, JBriscola si propone di diventare il punto di riferimento per chiunque cerchi un'esperienza di gioco di carte impeccabile su piattaforma Java. Che tu sia un appassionato di programmazione desideroso di esplorare le potenzialità di Java o semplicemente un giocatore alla ricerca di un nuovo passatempo, JBriscola è qui per offrirti un'esperienza indimenticabile.

Caratteristiche Principali

JBriscola offre una serie di caratteristiche uniche e interessanti che lo distinguono dagli altri giochi di carte Java. Ecco un'anteprima delle sue funzionalità più significative:

  • GUI: Grazie all'utilizzo del framework Java Swing, JBriscola vanta un'interfaccia grafica utente intuitiva e user-friendly . Il design moderno, fornito dal look and feel FlatLightLaf, permette agli utenti di navigare agevolmente attraverso il gioco, assicurando un'esperienza di gioco fluida e piacevole.

  • Animazioni: Il software è provvisto di animazioni create tramite l'utilizzo dell'oggetto Timer fornito da javax.swing. Questo oggetto ci consente di programmare eventi che si verificano a intervalli regolari, il che è essenziale per creare animazioni fluide e controllate. Tutte le animazioni utilizzate in JBriscola sono implementate nella classe Animation come metodi. É possibile trovare la classe all'interno all'interno della directory briscola. All'interno delle classi CPU e Giocatore è possibile trovare i metodi per l'animazione del lancio della carta strutturato nello modo. La logica dietro queste animazioni è abbastanza semplice ma efficace. Per esempio, nell'animazione di distribuzione di una carta, utilizziamo il Timer per aggiornare continuamente la posizione della carta finché non raggiunge la sua destinazione finale sul tavolo. Ciò viene fatto controllando le coordinate x e y della carta e aggiornandole gradualmente finché non raggiungono le coordinate desiderate. Una volta raggiunto il punto finale, il Timer viene interrotto e l'animazione viene completata.

public void distribuisciAnimation(JButton card, ImageIcon img, int x1) {
        timerDistribuisci = new Timer(5, new ActionListener() {
            private int y = 90;
            private int x = 158;

            @Override
            public void actionPerformed(ActionEvent e) {
                if (x == x1 && y == 600) {
                    card.setIcon(img);
                    ((Timer) e.getSource()).stop();
                    System.out.println("Timer stoppato");
                }


                if (y < 600) {
                    y = Math.min(y + 20, 600);
                    card.setBounds(x, y, 89, 168);
                    card.repaint();
                    if (card.getLocation().x < x1) {
                        x = Math.min(x + 20, x1);
                        card.setBounds(x, y, 89, 168);
                        card.repaint();
                    }
                }

            }
        });

        timerDistribuisci.start();

    }
  • Login & Register: JBriscola implementa un robusto sistema di login e registrazione, consentendo agli utenti di creare e gestire i propri account personali. Questo sistema è integrato con un database MySQL online attivo 24 ore su 24, garantendo la sicurezza e l'accessibilità dei dati degli utenti. Il tutto gestitto dalle classi Login, Register, Database che sono accessibili sempre all'interno della directory briscola.

  • Classifica: Per gli utenti competitivi, JBriscola offre una semplice classifica con il nome dei 5 giocatori con più partite vinte, che tiene traccia dei migliori giocatori e delle loro prestazioni nel gioco. Questo aggiunge un elemento di competizione e sfida, incoraggiando gli utenti a migliorare le proprie abilità e scalare le classifiche.

  • Musica : Il gioco è dotato di una colonna sonora che può risultare fastidiosa. Tuttavia, tramite un tasto dedicato nel menu principale, è possibile gestire facilmente l'audio durante il gioco.

  • Menu durante la Partita: Durante una partita, gli utenti possono accedere a un menu, tramite il tasto esc, che consente di riavviare la partita, tornare al menu principale o mettere la partita in pausa. Questo offre un maggiore controllo e flessibilità durante l'esperienza di gioco.

  • Schermata di Caricamento: Presente una schermata di caricamento animata per preparare il gioco all'avvio.

  • Selezione del Tipo di Carte: All'interno del menu principale, gli utenti hanno la possibilità di scegliere il tipo di carte da utilizzare durante il gioco. Attualmente, sono disponibili le carte piacentine, napoletane e siciliane, offrendo agli utenti una varietà di opzioni per personalizzare l'esperienza di gioco secondo le proprie preferenze.

  • Tracciamento dei Punti: Durante la partita, JBriscola tiene traccia dei punti fatti dai giocatori. Questi punti vengono visualizzati in tempo reale all'interno dell'interfaccia grafica utente (GUI) mentre si gioca, consentendo ai giocatori di monitorare i punteggi e determinare il vincitore della partita in base alle regole del gioco.

  • Schermata Finale: Alla fine di ogni partita, viene mostrata una schermata di vittoria, sconfitta o pareggio in base ai punti totalizzati dai giocatori. Questo permette ai giocatori di visualizzare chiaramente l'esito della partita e di valutare le proprie prestazioni. Inoltre, i risultati vengono inviati al database, registrando la vittoria, la sconfitta o il pareggio.

  • Navigazione Intuitiva: Semplicemente cliccando sulla schermata finale, i giocatori possono tornare al menu principale del gioco. Questa funzionalità consente agli utenti di prendere decisioni rapide su cosa fare dopo la fine di una partita, se desiderano iniziare una nuova partita, consultare le impostazioni o effettuare altre azioni.

  • Gioca Contro il Computer: JBriscola offre la possibilità di giocare contro un avversario controllato dal computer. Attualmente, il bot seleziona le carte casualmente durante la partita.

Tecnologie Utilizzate

JBriscola è costruito utilizzando una varietà di tecnologie moderne per offrire un'esperienza di gioco fluida e coinvolgente. Ecco una panoramica delle principali tecnologie utilizzate:

  • Java SE: Linguaggio di programmazione principale utilizzato per lo sviluppo del gioco.
  • Java Swing: Utilizzato per la creazione dell'interfaccia grafica utente (GUI).
  • FlatLaf: Look and feel moderno per Java Swing che fornisce un design pulito e professionale.
  • MySQL: Database relazionale utilizzato per gestire i dati degli utenti, come le credenziali di login e le statistiche di gioco.
  • JDBC (Java Database Connectivity): Utilizzato per la connessione e l'interazione con il database MySQL.

Configurazione ed Uso

Requisiti di Sistema

  • Sistema Operativo: Windows, macOS, Linux

  • Java: Versione 8 o successiva

  • Spazio su Disco: Almeno 400 MB di spazio libero

  • RAM: Almeno 512 MB di RAM

Installazione

Per poter giocare a JBriscola bisogna questi semplici passi:

  • Installare java sul proprio pc in caso non fosse gia installato seguire questo link

  • Installare l'ultima reales qui

    • Una volta scaricato file zip estrarre il contenuto.
    • Dopo l'estrazione avrete un file .jar e una cartella, fare doppio click sul file .jar e si inzierà ad aprire JBriscola
    • È possibile avviare il file .jar anche eseguendo il seguente comando sul cmd ⚠️Attenzione, bisogna essere nella stessa directory del file jar affinchè il comando funzioni:
    java -jar Briscola.jar
  • Altrimenti è possibile clonare questa repository tramite il seguente comando (per eseguire il comando c'è bisogno di installare git altrimenti usare la procedura standar ovvero cliccare su code e poi download file zip ed estrarre il contenuto):

git clone https://github.com/profumato4/Briscola.git
  • Fare attenzione ad avere la cartella res e il file Briscola.jar nella stessa cartella

  • Bene adesso è possibile avviare JBriscola avviando il file Briscola.jar facendo doppio click sopra oppure eseguendo il comando sul terminale:

java -jar Briscola.jar

Come iniziare

Benvenuto in JBriscola! Per iniziare a giocare, segui questi semplici passaggi:

  • Registrazione: Se non hai ancora un account, clicca su "Register" nel menu principale. Inserisci un nome utente e una password desiderati, quindi conferma la password. Una volta completata la registrazione, sarai pronto per effettuare il login.

  • Login: Se hai già un account, clicca su "Login" nel menu principale. Inserisci il tuo nome utente e la password registrati durante la fase di registrazione.

  • Avvia una Nuova Partita: Dopo aver effettuato il login, sei pronto per iniziare una nuova partita! Clicca su "Start New Game".

  • Gioca e Divertiti: Una volta iniziata la partita, goditi l'emozione della Briscola! Utilizza le carte a tua disposizione per battere il tuo avversario.

  • Esplora le Funzionalità:Non dimenticare di esplorare tutte le funzionalità offerte da JBriscola, come la gestione del punteggio, le opzioni di personalizzazione e altro ancora. Puoi anche dare un'occhiata alla classifica per vedere come ti confronti con altri giocatori. Vedi la sezione Caratteristiche Principali

Video DEMO

https://www.youtube.com/watch?v=46mEq1oxnNQ

Licenza

Questo software è rilasciato sotto la licenza MIT. Consulta il file LICENSE per ulteriori informazioni.

Domande o problemi?

Se hai domande o riscontri problemi, utilizza issue tracker nel repository per segnalarli.

Buon Divertimento!

Ora che sei pronto, non resta che giocare! Sfida i tuoi amici, migliora le tue abilità, e goditi ogni momento di gioco. Che le carte ti siano sempre favorevoli!

🇬🇧

Why JBriscola?

JBriscola was designed as a sophisticated solution for card game lovers and Java programming enthusiasts. Its name, "JBriscola", comes from the combination of the letter "J", which represents the Java programming language, and the famous Italian card game, "briscola".

This project was born with the aim of offering an engaging and fun gaming experience, while at the same time demonstrating the capabilities and versatility of the Java language in the context of gaming. JBriscola offers a wide range of features and customization possibilities, ensuring hours of fun for users of all ages and experience levels.

With a solid architecture and an intuitive interface, JBriscola aims to become the point of reference for anyone looking for a flawless card gaming experience on the Java platform. Whether you are a programming enthusiast eager to explore the potential of Java or simply a gamer looking for a new pastime, JBriscola is here to offer an unforgettable experience.

briscola Features

JBriscola offers a number of unique and interesting features that set it apart from other Java card games. Here is a preview of its most significant features:

  • GUI: Thanks to the use of the Java Swing framework, JBriscola boasts an intuitive and user-friendly graphical user interface. The modern design, provided by the FlatLightLaf look and feel, allows users to navigate smoothly through the game, ensuring a smooth and enjoyable gaming experience.

  • Animations: The software is equipped with animations created using the Timer object provided by javax.swing. This object allows us to schedule events that occur at regular intervals, which is essential for creating smooth, controlled animations. All animations used in JBriscola are implemented in the Animation class as methods. You can find the class inside the briscola directory. Within the CPU and Giocatore classes you can find methods for animating structured card throwing in the way. The logic behind these animations is quite simple but effective. For example, in a card dealing animation, we use the Timer to continuously update the position of the card until it reaches its final destination on the table. This is done by checking the x and y coordinates of the chart and gradually updating them until they reach the desired coordinates. Once the end point is reached, the Timer is stopped and the animation is completed.

public void distribuisciAnimation(JButton card, ImageIcon img, int x1) {
        timerDistribuisci = new Timer(5, new ActionListener() {
            private int y = 90;
            private int x = 158;

            @Override
            public void actionPerformed(ActionEvent e) {
                if (x == x1 && y == 600) {
                    card.setIcon(img);
                    ((Timer) e.getSource()).stop();
                    System.out.println("Timer stoppato");
                }


                if (y < 600) {
                    y = Math.min(y + 20, 600);
                    card.setBounds(x, y, 89, 168);
                    card.repaint();
                    if (card.getLocation().x < x1) {
                        x = Math.min(x + 20, x1);
                        card.setBounds(x, y, 89, 168);
                        card.repaint();
                    }
                }

            }
        });

        timerDistribuisci.start();

    }
  • Login & Register: JBriscola implements a robust login and registration system, allowing users to create and manage their personal accounts. This system is integrated with a 24-hour online MySQL database, ensuring the security and accessibility of user data. All managed by the Login, Register, Database classes which are always accessible within the briscola directory.

  • Leaderboard: For competitive users, JBriscola offers a simple leaderboard with the name of the 5 players with the most match wins, which tracks the best players and their performances in the game. This adds an element of competition and challenge, encouraging users to improve their skills and climb the leaderboards.

  • Music: The game has a soundtrack that can be annoying. However, via a dedicated button in the briscola menu, you can easily manage the audio during the game.

  • In Game Menus: During a game, users can access a menu, via the escape key, that allows them to restart the game, return to the briscola menu, or pause the game. This offers greater control and flexibility during the gaming experience.

  • Loading Screen: There is an animated loading screen to prepare the game for launch.

  • Card Type Selection: Within the briscola menu, users have the option to choose the type of cards to use during the game. Currently, Piacenza, Neapolitan and Sicilian cards are available, offering users a variety of options to customize the gaming experience to their preferences.

  • Point Tracking: During the game, JBriscola keeps track of the points scored by the players. These points are displayed in real time within the graphical user interface (GUI) as you play, allowing players to monitor scores and determine the winner of the match based on the game's rules.

  • Final Screen: At the end of each game, a victory, defeat or draw screen is shown based on the points scored by the players. This allows players to clearly view the outcome of the match and evaluate their performance. Furthermore, the results are sent to the database, recording the win, loss or draw.

  • Intuitive Navigation: By simply clicking on the end screen, players can return to the game's briscola menu. This feature allows users to make quick decisions about what to do after a game ends, whether they want to start a new game, review settings, or take other actions.

  • Play Against the Computer: JBriscola offers the possibility of playing against a computer-controlled opponent. Currently, the bot selects cards randomly during the game.

Used Technologies

JBriscola is built using a variety of modern technologies to deliver a smooth and immersive gaming experience. Here is an overview of the briscola technologies used:

  • Java SE: Linguaggio di programmazione principale utilizzato per lo sviluppo del gioco.

  • Java Swing: Utilizzato per la creazione dell'interfaccia grafica utente (GUI).

  • FlatLaf: Look and feel moderno per Java Swing che fornisce un design pulito e professionale.

  • MySQL: Database relazionale utilizzato per gestire i dati degli utenti, come le credenziali di login e le statistiche di gioco.

  • JDBC (Java Database Connectivity): Utilizzato per la connessione e l'interazione con il database MySQL.

Configuration and Use

System requirements

  • Operating System: Windows, macOS, Linux

  • Java: Version 8 or later

  • Disk Space: At least 400 MB of free space

  • RAM: At least 512 MB of RAM

Installation

To be able to play JBriscola you need these simple steps:

  • Install java on your PC if it is not already installed, follow this link

  • Install the latest reales here

    • Once the zip file has been downloaded, extract the contents.
    • After extraction you will have a .jar file and a folder, double click on the .jar file and it will start to open JBriscola
    • You can also start the .jar file by running the following command on cmd ⚠️Attention, you must be in the same directory as the jar file for the command to work:
    java -jar Briscola.jar
  • Otherwise it is possible to clone this repository using the following command (to execute the command you need to install git otherwise use the standard procedure or click on code and then download zip file and extract the contents):

git clone https://github.com/profumato4/Briscola.git
  • Be careful to have the res folder and the Briscola.jar file in the same folder

  • Well now it is possible to start JBriscola by starting the Briscola.jar file by double clicking on it or by executing the command on the terminal:

java -jar Briscola.jar

How to get started

Welcome to JBriscola! To start playing, follow these simple steps:

  • Registration: If you don't have an account yet, click "Register" in the briscola menu. Enter a desired username and password, then confirm the password. Once registration is complete, you will be ready to log in.

  • Login: If you already have an account, click "Login" in the briscola menu. Enter your registered username and password during the registration phase.

  • Start a New Game: After logging in, you are ready to start a new game! Click on "Start New Game".

  • Play and Have Fun: Once the game has started, enjoy the excitement of Briscola! Use the cards at your disposal to beat your opponent.

  • Explore Features: Don't forget to explore all the features offered by JBriscola, such as score management, customization options and more. You can also take a look at the leaderboard to see how you compare to other players. See the section briscola Features

DEMO Video

https://www.youtube.com/watch?v=46mEq1oxnNQ

License

This software is released under the MIT license. See the file LICENSE for further information.

Questions or problems?

If you have questions or encounter issues, please use issue tracker in the repository to report them.

Good fun!

Now that you're ready, all that's left to do is play! Challenge your friends, improve your skills, and enjoy every moment of gameplay. May the cards always be in your favor!

About

JBriscola è stato concepito come una soluzione sofisticata per gli amanti dei giochi di carte e degli appassionati di programmazione Java. Il suo nome, "JBriscola", nasce dalla combinazione della lettera "J", che rappresenta il linguaggio di programmazione Java, e il famoso gioco di carte italiano, la "briscola".

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages