{"id":19552243,"url":"https://github.com/simonewebdesign/pong","last_synced_at":"2025-04-26T20:31:39.472Z","repository":{"id":20455748,"uuid":"23732937","full_name":"simonewebdesign/pong","owner":"simonewebdesign","description":":space_invader: A super simple JavaScript implementation of Atari's game","archived":false,"fork":false,"pushed_at":"2020-05-31T10:57:06.000Z","size":1016,"stargazers_count":11,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T17:51:47.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.simonewebdesign.it/making-a-game-from-scratch-in-html5/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonewebdesign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-06T11:14:21.000Z","updated_at":"2021-09-01T16:00:49.000Z","dependencies_parsed_at":"2022-08-31T19:00:53.852Z","dependency_job_id":null,"html_url":"https://github.com/simonewebdesign/pong","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonewebdesign%2Fpong","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonewebdesign%2Fpong/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonewebdesign%2Fpong/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonewebdesign%2Fpong/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonewebdesign","download_url":"https://codeload.github.com/simonewebdesign/pong/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251051443,"owners_count":21528787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T04:17:22.812Z","updated_at":"2025-04-26T20:31:39.075Z","avatar_url":"https://github.com/simonewebdesign.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :video_game: Pong\n\n![screenshot]\n\nThis is a basic canvas implementation of Atari's popular game, first released in 1972.\n\nThere are two releases: the first one ([v1.0](https://github.com/simonewebdesign/pong/tree/a3eb56339880616e2983157fc2d5931bb9b32694)) is very lightweight (around 200 lines of code), no sound, no AI and no proper ball reflection with vectors.\n\nThe second release (that is in master branch) has a lot more stuff, check it out.\n\nIn both cases, there are no dependencies from external libraries. This means the game has been made from scratch.\n\n![screenshot2]\n\nYou can read a making-of article [here](https://www.simonewebdesign.it/making-a-game-from-scratch-in-html5/).\n\n## How to play\n\nYou can play a demo [here](https://www.simonewebdesign.it/games/pong/).\n\nIf you want to play it locally, fork or clone the repository as usual. It shouldn't need any server to run (just open `index.html`). However in some cases (e.g. using Chrome) it might not work if you don't use a web server.\n\n### Controls\n\nStart the game with spacebar.\n\n#### Player 1\n  - up: w\n  - down: s\n\n#### Player 2\n  - up: arrow up\n  - down: arrow down\n\n### Implementation details\n\nThe first implementation (v1.0) is simpler, but you don't have much control over the ball.\n\nIn the latter implementation I simulated a curved paddle by varying the normal vector of the paddle's surface. This allows the players to change the ball's movement angle by intercepting the ball in movement to get a steeper or shallower reflection angle.\n\nThe ball's collision is perfectly elastic, which means all of the kinetic energy in a collision will be transferred. This results in a constant game speed.\n\n\n## License\n\nLicensed under the WTFPL license.\n\n---\n\nI would like to thank Matt Hackett for his tutorial on [how to make a simple HTML5 canvas game](http://www.lostdecadegames.com/how-to-make-a-simple-html5-canvas-game/); I've learned a lot.\n\n[screenshot]: https://raw.githubusercontent.com/dudeOMG/pong/master/screenshots/pong.png\n[screenshot2]: https://raw.githubusercontent.com/dudeOMG/pong/master/screenshots/pong2.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonewebdesign%2Fpong","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonewebdesign%2Fpong","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonewebdesign%2Fpong/lists"}