Files
gdnative-demos/cpp/pong/README.md
2021-07-12 00:33:48 -04:00

1.4 KiB

Pong with GDNative C++

A simple Pong game, made with GDNative C++. This demo shows best practices for game development in Godot, including signals.

Language: GDNative C++

Renderer: GLES 2

Note: There is a GDScript version available here.

Note: There is a C# version available here.

Note: There is a VisualScript version available here.

Compiling

You can use SCons to compile the library:

scons platform=PLATFORM

Where PLATFORM is: windows, linux, or osx.

This creates the file libpong in the respective subfolders in the project/gdnative directory.

Dependencies:

  • You need godot-cpp, this is now a Git submodule of this repo.
  • clang, gcc, or any decent C compiler that's C++14 compatible.

How does it work?

The walls, paddle, and ball are all Area2D nodes. When the ball touches the walls or the paddles, they emit signals and modify the ball.

Screenshots

Screenshot