Skip to content

sajjad-sisakhtpour/billiard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Billiard

A simple and interactive 2D billiard game built using JavaScript and HTML5 canvas, designed to showcase fundamental concepts in vector math, collision handling, and game mechanics.


GitHub top language GitHub license GitHub last commit GitHub contributors


Overview

This project demonstrates the mechanics of a billiard game, featuring realistic physics-based ball movement, collision detection, and user interaction with a virtual pool stick. It's intended as a portfolio sample to illustrate skills in game development and JavaScript programming.


Prerequisites

Before running the project, ensure you have the following:

  • A modern web browser with JavaScript enabled.
  • A local server to handle the file:// limitations when loading assets, or run directly in a browser extension allowing local file access.

Installation

  1. Clone the repository:

    git clone https://github.com/sajjad-sisakhtpour/billiard.git
  2. Navigate to the project folder:

    cd billiard
  3. Open index.html in a browser, or serve the project using a local server (e.g., Python's http.server):

    python -m http.server

Usage

  • Use the mouse to aim and adjust the stick's rotation.
  • Hold the left mouse button to charge power.
  • Release the button to shoot.

Examples

Here’s how the game looks in action:

Screenshots

Screenshot 1


Documentation

Key Features:

  • Physics-Based Ball Movement: Implements realistic velocity and friction.
  • Vector Operations: Includes custom vector math utilities.
  • User Interaction: Dynamic stick rotation and power control.

Code Highlights:

  • Asset Loading: Efficient sprite management through asynchronous loading.
  • Canvas Rendering: Smooth rendering of game objects using transformations.

Contributing

Contributions are welcome! Follow these steps:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature-name
  3. Commit your changes:
    git commit -m "Add feature"
  4. Push to the branch:
    git push origin feature-name
  5. Create a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Contact

For inquiries or feedback, reach out:


Live Demo

A live version of the game can be hosted and viewed on platforms like GitHub Pages. here

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published