2024-04-11 13:15:34 -04:00
2024-03-06 13:09:06 -06:00
2024-04-11 13:15:34 -04:00
2024-02-26 21:38:54 -05:00
2024-03-18 13:22:12 -04:00
2024-03-20 00:07:23 -04:00
2024-03-10 21:55:09 -05:00
2024-03-20 00:07:23 -04:00
2025-07-18 14:19:19 -04:00
2024-04-11 13:13:06 -04:00
2024-03-20 00:07:23 -04:00
2024-03-26 10:06:34 -04:00

Netpong - A Pong game for the internet era

Netpong is a network-enabled Pong game, written in C++. It enables two players to play against each other, provided an IP address and a port. It also supports a single-player mode.

How it works

The game has only one runtime dependency: The raylib graphics library. In order to write idiomatic C++, I chose to use the raylib-cpp wrapper, which provides an object-oriented interface to the Raylib library.

Building

This application uses Meson as a build system. To build the application:

  1. Install meson from the link above.

  2. Clone the repository.

  3. Update all submodules:

    git submodule update --init --recursive
    
  4. Set up the build directory.

    meson setup build
    
  5. Compile the application. Meson should use a system installation of raylib, if it exists. If not, it falls back to a bundled version.

    meson compile -C build
    
  6. You can also create a statically-linked version of the game (with no runtime dependencies) on Linux by running the following commands:

    meson configure -Ddefault_library=static build/
    meson compile -C build -Ddefault_library=static
    

Running

  • To run in single-player mode:

    • Run the application with no arguments: build/pong
    • Left paddle is controlled with W and S keys, right paddle is controlled with Up and Down arrow keys.
  • To run in multi-player mode:

    • One player runs the application in Server mode, specifying their IP address and a port: build/pong -S <ip_address> <port>
    • The other player connects to the first player by running in Client mode, specifying the first player's IP address and port: build/pong -C <ip_address> <port>.
    • The server controls the left paddle by default (WIP to allow the user to modify this), and the client controls the right paddle.

TODO

See todo.txt.

Description
A network-based Pong game, written in C++.
Readme 2.2 MiB
Netpong v0.2 Latest
2024-03-19 09:59:28 -05:00
Languages
C 55.4%
C++ 43.7%
Meson 0.5%
Shell 0.4%