Giter Site home page Giter Site logo

hoangsonww / bouncing-ball-game Goto Github PK

View Code? Open in Web Editor NEW
7.0 9.0 8.0 40 KB

๐ŸŽฎ This repository hosts a Bouncing Ball game coded in JavaFX, offering a fun and interactive gameplay experience. It showcases object movement, collision detection, and score tracking, serving as a great example for developers interested in game development using JavaFX.

Home Page: https://hoangsonww.github.io/Bouncing-Ball-Game/

License: MIT License

Java 100.00%
bounce bouncing-ball bouncing-ball-2player-game bouncing-ball-java bouncing-balls bouncingball java java-8 javafx bouncing-ball-game

bouncing-ball-game's Introduction

Bouncing Ball Game with JavaFX

Overview

The Bouncing Ball game is a simple, interactive JavaFX application where a ball bounces around the screen. Users can control the speed of the ball using the up and down arrow keys. The game demonstrates the use of JavaFX animation and event handling capabilities.

User Interface

Bouncing Ball Game Interface

Features

  • Ball speed control with keyboard inputs (UP to increase speed, DOWN to decrease speed).
  • Dynamic color change of the ball upon collision with the screen boundaries.
  • Display of current ball speed on the screen.

Prerequisites

  • JDK 11 or above.
  • JavaFX SDK (compatible with your JDK version).

Setup and Installation

  1. Download JavaFX SDK: Download the JavaFX SDK from the OpenJFX website and extract it to a known location on your machine.
  2. Clone the Repository: Clone this repository to your local machine using git clone <repository-url>.

Configuration

Before running the application, ensure that JavaFX is properly configured in your IDE (e.g., IntelliJ IDEA, Eclipse):

  • IntelliJ IDEA:

    1. Go to File > Project Structure > Libraries and add the JavaFX SDK as a library to the project.
    2. In the Run configurations, add the VM options to include the JavaFX modules:
      --module-path "path/to/javafx-sdk/lib" --add-modules javafx.controls,javafx.fxml
      
      Replace "path/to/javafx-sdk/lib" with the actual path to the JavaFX SDK lib directory on your machine.
  • Eclipse:

    1. Right-click on the project > Properties > Java Build Path > Libraries and add the JavaFX SDK as an external JAR.
    2. In the run configurations, add the VM arguments similar to the IntelliJ setup.

Running the Application

To run the application, navigate to the src/com/example/bouncingballgamejavafx directory and compile the BouncingBall.java file. Then, execute the main method within the BouncingBall class.

Contributing

Contributions to the Bouncing Ball game are welcome. Please feel free to fork the repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT license. See LICENSE for more details.


Created with โค๏ธ by Son Nguyen in 2024.

bouncing-ball-game's People

Contributors

hoangsonww avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.