Giter Site home page Giter Site logo

moon-pong's Introduction

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

It uses around 200MB of RAM.

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.

moon-pong's People

Contributors

omrawaley avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.