Giter VIP home page Giter VIP logo

pong-javascript-pat's Introduction

Pong Game

This is a simple implementation of the classic Pong game using HTML canvas and JavaScript. Inspired by Marcin's Monskała Book "JavaScript from scratch".

Gameplay

The game is played by two players, each controlling a paddle on opposite sides of the canvas. The objective is to hit the ball with the paddle and prevent it from reaching the player's side. The ball will bounce off the top and bottom walls as well as the paddles. When the ball passes the paddles and reaches a player's side, the opponent scores a point. The game continues until one player reaches a certain number of points, typically 10.

Controls

  • Player 1 (left paddle):

    • Move Up: W key
    • Move Down: S key
  • Player 2 (right paddle):

    • Move Up: Up Arrow key
    • Move Down: Down Arrow key
  • Pause/Resume: B key

Demo

To try the game, open the index.html file in a web browser. Use the controls mentioned above to move the paddles and hit the ball. Press the B key to pause or resume the game.

Acknowledgments

This project was inspired by the classic Pong game and was created as a learning exercise. It utilizes HTML canvas and JavaScript to implement the game mechanics. The code was developed based on Marcin's Monskała Book "JavaScript from scratch".

Author

Oskar Kalbarczyk https://linktr.ee/codewithoskar

Feel free to reach out if you have any questions or feedback.

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.