/tennis-sdl

An arcade Pong clone in C using SDL that you can play in the browser.

Primary LanguageCCreative Commons Zero v1.0 UniversalCC0-1.0

Tennis

An attempt to recreate the Pong arcade game from 1972 with sound in C using only the SDL cross-platform multimedia library.

The window is resizable, desktop fullscreen can be toggled with the keyboard, gamepad and touch controls are supported, and you can play it natively on Windows, Linux and macOS or in a web browser here.

You can watch a video of 1972 Pong on Youtube here.

Screenshot

Screenshot

Controls

Keyboard

  • W and S moves the paddle on the left up and down
  • and moves the paddle on the right up and down
  • R restarts the round
  • M toggles sound
  • P toggles pause
  • F11 toggles fullscreen

Gamepad

  • D-pad up and D-pad down moves a paddle up and down

Touch

  • Tap either side of the screen to move a paddle.
  • Double tap on the middle of the screen to toggle fullscreen.

Build

You can build the project using either CMake or by simply running build.sh on an Unix-like system for a native build.

The only build requirements for a native build are the SDL library version 2 and a C compiler with support for C99. I have only built this project on Linux but it should be buildable on Windows and macOS as it is or with very minor changes.

For a WebAssembly build you only need to additionally install Emscripten and you can build using CMake with the help of the emcmake tool or by running build-wasm.sh.

The website for the Wasm build can be built with the assets in the assets folder by running the build-website.py script.

To build for Windows using MinGW it's helpful to use mingw64-cmake or mingw32-cmake in place of the default CMake executable.

License

Everything with the exception of the files mentioned in THIRD_PARTY_NOTICES.md is dedicated to the public domain under the CC0 1.0 Universal license included in the LICENSE.md file.

Acknowledgements