Marlon-Gomes / pong-lua

A replica of the Atari game Pong, written in the Lua language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contributors Forks Stargazers Issues MIT License


Logo

Pong-Lua

The classical Atari game, coded in Lua!
Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Product Name Screen Shot

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.

(back to top)

Built With

Lua Logo Lua a lightweight scripting language.
Love2D Logo LÖVE2D a framework for 2D game development in Lua.

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

MacOS

The MacOS version of the game runs natively on Intel-based Macs. It has been tested on MacOS Monterey 12.2.1.

Love App

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.

Build from Source

  1. Clone the repo
    git clone https://github.com/Marlon-Gomes/pong-lua.git path/to/your/repo
  2. Run the build script:
    • Build for Love
      cd path/to/your/repo
      ./build.sh -t love
      or,
    • Build for MacOS
      cd path/to/your/repo
      ./build.sh -t macos

For more info on build.sh, use the help flag

cd path/to/your/repo
./build.sh -h

(back to top)

Usage

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.

Gameplay screenshot

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.

Service screenshot

The first player to score 11 points wins!

Victory screenshot

(back to top)

Roadmap

  • Add unit tests.
  • Add build systems for other platforms.

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch by branching from develop (git checkout -b feature/AmazingFeature develop)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

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.

(back to top)

Contact

Marlon de Oliveira Gomes - 72144990+Marlon-Gomes@users.noreply.github.com

Project Link: https://github.com/Marlon-Gomes/pong-lua

(back to top)

Acknowledgments

  • 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.

(back to top)

About

A replica of the Atari game Pong, written in the Lua language.

License:MIT License


Languages

Language:Lua 74.5%Language:Shell 25.5%