Skip to main content
Public

Share visualization

Send this visualization to others.

The (Ping) Pong Game

Public visualization

By ax-va on VizHub

Choose how to deliver this visualization

Each option retains the visualization's existing access rules. Check the client's permissions and data license before handing it off.

LinkedIn caption

LinkedIn cannot prefill the post text. Copy the caption, then paste it in LinkedIn. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code

The embed preserves the visualization's visibility and project dataset permissions.

Download & exportHTML, source ZIP and authorized project data

Source ZIP contains editable visualization files; it does not include project datasets. Standalone HTML is available where authorized and packages readable referenced data for offline use. Dataset ZIP requires project read permission.

Standalone HTMLSource ZIP
Publishing & handoffCopy a client maintenance summary

Includes the canonical link, visibility, and available export formats. Confirm dataset attribution, licensing and maintenance responsibilities with the publisher.

The (Ping) Pong Game

0 stars1Public
AAxVa 🐍 💪
Last edited Nov 22, 2024
Created on Oct 5, 2024

The (Ping) Pong Game is a two-player arcade game rendered on a 300x300 HTML5 Canvas, where a ball bounces between a top paddle and a mouse-controlled bottom paddle. The simulation tracks collisions between the ball and paddle edges, adjusting the ball’s angle and speed upon edge hits, and increments scores until one player reaches 10 points. The code uses the Canvas API for drawing, JavaScript classes for game entities (GameView, Paddle, Ball, Play), and mouse event listeners for input. This example, based on the book *JavaScript Crash Course*, demonstrates interactive collision detection and score tracking in a minimal, browser-based setup.

AI-generated description

Play the (Ping) Pong game. Use the mouse to move the bottom paddle. Hit the ball with the edges of the paddle to change the angle and speed of the ball. The play stops when a player reaches 10 points.

This example is based on the book "JavaScript Crash Course: A Hands-On, Project-Based Introduction to Programming" by Nick Morgan, No Starch Press, 2024.

Visit also my repo https://github.com/ax-va/JavaScript-Crash-Course-Morgan-2024.

Comments

Sign in to join the discussion.

MIT Licensed