Skip to content

Atari's 1972 classic, implemented in Lua with LÖVE

Notifications You must be signed in to change notification settings

Kathuria/Pong_Game_CS50

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pong

Pong is a two-dimensional sports game which simulates table tennis. This implementation is built with Löve

CS50's Introduction to Game Development

Learn about the development of 2D and 3D interactive games in this hands-on course, as you explore the design of games such as Pong.

Course Link

Setup Details:

  1. To Build this game we used lua language similar to javascript manual
  2. Framework used is named LÖVE

    LÖVE is an awesome framework you can use to make 2D games in Lua. It's free, open-source, and works on Windows, Mac OS X, Linux, Android and iOS. Link to Download Docs

step-by-step guide will help to build pong game

  1. Display Text: Starting of game building with displaying a text in center of screen.
  2. Low resolution: Display text in low resolution using push library.
  3. Adding Rectangles: For pong game adding rectangle paddles on screen.
  4. Moving Paddles: Using dt - the most common shorthand for delta-time.
  5. Add Velocity to Ball: Using - math.randomseed(), os.time(), etc. And Starting game on keyPressed.
  6. Updating Code with OOPS!
  7. FPS Update: Frames Per Second, using love.window.setTitle(), love.timer.getFPS()
  8. Collision Detection: based on "axis-aligned bounding boxes"
  9. Adding Scoring
  10. Assigning Service to player after scoring
  11. Victory Updates for a player
  12. Adding Audio for scoring, ball hitting paddle or wall, using bfxr.net.
  13. Reszing Game window with push library, love.resize(width, height), push:resize

Few operands differnt in lua:

  1. concatenation (..) operation
  2. status == nil, kid of null
  3. a == b and 1 or 2 (kind of ternary a==b ? true : false )

About

Atari's 1972 classic, implemented in Lua with LÖVE

Topics

Resources

Stars

Watchers

Forks

Languages

  • Lua 100.0%