Table of Contents
Pong is a classic game that simulates table tennis, released for Atari in 1972. The game features two paddles, controlled by the players, which move vertically across the left and right sides of the screen. Additionally, the game features a ball, which travels across the screen, bouncing off the top and bottom edges and the paddles. Players must try to hit the ball with their paddles to prevent it from falling off the vertical edges of the screen. A player scores when the opposing player fails to catch the ball. The first player to score 11 points wins.
This project implements Pong with the Lua programming language, using the LÖVE2D framework. It is inspired by Harvard's University 2018 CDS0 course, taught by Colton Ogden. The lectures are available on this Youtube playlist.
![]() |
Lua a lightweight scripting language. |
![]() |
LÖVE2D a framework for 2D game development in Lua. |
To get a local copy up and running follow these simple example steps.
The MacOS version of the game runs natively on Intel-based Macs. It has been tested on MacOS Monterey 12.2.1.
The .love release file can be used in conjunction with the Love app in any system that supports Love. For details on how to install Love for your specific platform, consult the LÖVE2D webpage. Once Love is installed, just double click the .love file.
- Clone the repo
git clone https://github.com/Marlon-Gomes/pong-lua.git path/to/your/repo
- Run the build script:
- Build for Love
or,
cd path/to/your/repo ./build.sh -t love
- Build for MacOS
cd path/to/your/repo ./build.sh -t macos
- Build for Love
For more info on build.sh
, use the help flag
cd path/to/your/repo
./build.sh -h
The game is played with 5 keys:
- W, S for player 1
- Up, Down for player 2
- Enter/Return to cycle between game stages.
Pressing Enter/Return from the welcome screen initializes play mode.
Players must use their controls to hit the ball with the paddle. If a player misses, the other player scores; the scoring player serves the next round.
The first player to score 11 points wins!
- Add unit tests.
- Add build systems for other platforms.
See the open issues for a full list of proposed features (and known issues).
Any contributions you make are greatly appreciated.If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch by branching from develop (
git checkout -b feature/AmazingFeature develop
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Pong-lua is distributed under the MIT License. See LICENSE.txt
for more information.
Pong-lua relies on source code and media files that are subject to licenses of their own. Please consult the third-party licenses README.md for a list containing links to individual licenses.
Marlon de Oliveira Gomes - 72144990+Marlon-Gomes@users.noreply.github.com
Project Link: https://github.com/Marlon-Gomes/pong-lua
- This code is based on Colton Ogden's interpretation of the game. It was the subject of a lecture in his CS50 course at Harvard in 2018. The original repo can be found at https://github.com/games50/pong.
- Classes are not native to the Lua languange. The implementation of classes used here,
class.lua
, is part of the hump package, a suite of tools for game development in the LÖVE framework due to Matthias Richter. - Sound effects were generated with jsfxr. Many thanks to the contributors of the project.