https://github.com/omrawaley/moon-pong
Moon Pong is a Pong clone made with Lua and LÖVE/Love2D.
https://github.com/omrawaley/moon-pong
love2d love2d-game lua lua-game lua-pong pong pong-game
Last synced: 22 days ago
JSON representation
Moon Pong is a Pong clone made with Lua and LÖVE/Love2D.
- Host: GitHub
- URL: https://github.com/omrawaley/moon-pong
- Owner: omrawaley
- License: apache-2.0
- Created: 2023-11-26T02:59:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-31T10:27:58.000Z (29 days ago)
- Last Synced: 2025-03-31T11:29:16.943Z (29 days ago)
- Topics: love2d, love2d-game, lua, lua-game, lua-pong, pong, pong-game
- Language: Lua
- Homepage:
- Size: 32.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Moon Pong
Moon Pong is a Pong clone made with Lua and LÖVE/Love2D. This is my first project with Lua and LÖVE.
![]()
## Customization
Modules are included that are useful to create multiple paddles, controlled via the keyboard or a the A.I.The full list:
- `playerModule`
- `paddleModule`
- `keyboardPaddleLogicModule`
- `aiPaddleLogicModule`The `playerModule` returns a table containing a `paddle` and a `paddleLogic`. The `paddle` can be initialized via the `paddleModule`, and the `paddleLogic` can be initialized via the `keyboardPaddleLogicModule` or the `aiPaddleLogicModule`.
`paddleModule` stores the paddle's data such as the location, velocity, etc. It excepts a single parameter for the `x` value of the paddle.
`keyboardPaddleLogicModule` allows the paddle to be controlled via the keyboard. It excepts a two parameters: the up and down key.
`aiPaddleLogicModule` allows the paddle to be controlled via the A.I. It excepts one parameter: difficulty. The higher the number you provide for this parameter, the easier the harder the A.I. will be. This is set at 7 by default.
The window resolution and such can be modified in the `conf.lua` file.
Since version 1.1.0, you can now change the color of the ball to any RGB value (line 122 of `game.lua`).
## How to Run
1. Firstly, make sure LÖVE is installed. You can download it [here](https://love2d.org/).2. Next, you can download either the source code or the `.love` file from the [releases section](https://github.com/omrawaley/moon-pong/releases). I recommend the former as you can modify it however you want.
3. If you downloaded the source code, make the MoonPong folder (Note, this is not the folder with `-master` at the end) the current directory and then run `love ./`. (Note, on MacOS you will have to create the `love` alias in your `.zshrc`. See [getting started](https://love2d.org/wiki/Getting_Started) for more information. If you downloaded the `.love` file, simply double click it and Moon Pong will start up.
## Credits
Thanks to @Pharap for reviewing the code and making several design suggestions.