Skip to content

omrawaley/Moon-Pong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

image

image

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

image

How to Run

  1. Firstly, make sure LÖVE is installed. You can download it here.

  2. Next, you can download either the source code or the .love file from the releases section. 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 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.

About

Moon Pong is a Pong clone made with Lua and LÖVE/Love2D.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy