mirror of
https://github.com/godotengine/gdnative-demos.git
synced 2025-12-30 21:49:05 +03:00
Update README files
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
These demos show how to use the GDNative C bindings.
|
||||
|
||||
Language: [GDNative C](https://docs.godotengine.org/en/latest/tutorials/scripting/gdnative/index.html)
|
||||
|
||||
Dependencies:
|
||||
* You need [Godot headers](https://github.com/godotengine/godot-headers),
|
||||
this is now a Git submodule of this repo.
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
This is a small example using C to create a GDNative script that
|
||||
exposes a very small part of the GLFW API.
|
||||
|
||||
Language: [GDNative C](https://docs.godotengine.org/en/latest/tutorials/scripting/gdnative/index.html)
|
||||
|
||||
Renderer: GLES 2
|
||||
|
||||
Dependencies:
|
||||
* You need [Godot headers](https://github.com/godotengine/godot-headers),
|
||||
this is now a Git submodule of this repo.
|
||||
@@ -20,7 +24,6 @@ scons platform=PLATFORM
|
||||
|
||||
Where PLATFORM is: `windows`, `linuxbsd`, or `macos`.
|
||||
|
||||
|
||||
## Manually compiling
|
||||
|
||||
### Linux
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Instance binding demo using C
|
||||
|
||||
Language: [GDNative C](https://docs.godotengine.org/en/latest/tutorials/scripting/gdnative/index.html)
|
||||
|
||||
Renderer: GLES 2
|
||||
|
||||
Dependencies:
|
||||
* You need [Godot headers](https://github.com/godotengine/godot-headers),
|
||||
this is now a Git submodule of this repo.
|
||||
@@ -14,7 +18,6 @@ scons platform=PLATFORM
|
||||
|
||||
Where PLATFORM is: `windows`, `linuxbsd`, or `macos`.
|
||||
|
||||
|
||||
## Manually compiling
|
||||
|
||||
### Linux
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
This is a small example using C to create a GDNative script
|
||||
that just showcases some very simple bare bones calls.
|
||||
|
||||
Language: [GDNative C](https://docs.godotengine.org/en/latest/tutorials/scripting/gdnative/index.html)
|
||||
|
||||
Renderer: GLES 2
|
||||
|
||||
Dependencies:
|
||||
* You need [Godot headers](https://github.com/godotengine/godot-headers),
|
||||
this is now a Git submodule of this repo.
|
||||
@@ -17,7 +21,6 @@ scons platform=PLATFORM
|
||||
|
||||
Where PLATFORM is: `windows`, `linuxbsd`, or `macos`.
|
||||
|
||||
|
||||
## Manually compiling
|
||||
|
||||
### Linux
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
These demos show how to use the GDNative C++ bindings.
|
||||
|
||||
Language: [GDNative C++](https://docs.godotengine.org/en/latest/tutorials/scripting/gdnative/index.html)
|
||||
|
||||
Dependencies:
|
||||
* You need [godot-cpp](https://github.com/godotengine/godot-cpp),
|
||||
this is now a Git submodule of this repo.
|
||||
|
||||
@@ -8,7 +8,7 @@ This is a finished version of the game featured in the
|
||||
tutorial in the documentation. For more details,
|
||||
consider following the tutorial in the documentation.
|
||||
|
||||
Language: GDScript
|
||||
Language: [GDNative C++](https://docs.godotengine.org/en/latest/tutorials/scripting/gdnative/index.html)
|
||||
|
||||
Renderer: GLES 3 (particles are not available in GLES 2)
|
||||
|
||||
@@ -26,7 +26,7 @@ scons platform=PLATFORM
|
||||
|
||||
Where PLATFORM is: `windows`, `linux`, or `osx`.
|
||||
|
||||
This creates the file `libsimple` in the respective
|
||||
This creates the file `libdodgethecreeps` in the respective
|
||||
subfolders in the `project/gdnative` directory.
|
||||
|
||||
Dependencies:
|
||||
|
||||
1
cpp/dodge_the_creeps/godot-cpp
Submodule
1
cpp/dodge_the_creeps/godot-cpp
Submodule
Submodule cpp/dodge_the_creeps/godot-cpp added at e08ecdc28c
@@ -1,20 +1,18 @@
|
||||
#include "player.hpp"
|
||||
|
||||
#include <Input.hpp>
|
||||
|
||||
void Player::_ready() {
|
||||
_animated_sprite = get_node<godot::AnimatedSprite>("AnimatedSprite");
|
||||
_collision_shape = get_node<godot::CollisionShape2D>("CollisionShape2D");
|
||||
_input = godot::Input::get_singleton();
|
||||
_screen_size = get_viewport_rect().size;
|
||||
hide();
|
||||
}
|
||||
|
||||
void Player::_process(const double p_delta) {
|
||||
godot::Input *input = godot::Input::get_singleton();
|
||||
godot::Vector2 velocity(0, 0);
|
||||
|
||||
velocity.x = input->get_action_strength("move_right") - input->get_action_strength("move_left");
|
||||
velocity.y = input->get_action_strength("move_down") - input->get_action_strength("move_up");
|
||||
velocity.x = _input->get_action_strength("move_right") - _input->get_action_strength("move_left");
|
||||
velocity.y = _input->get_action_strength("move_down") - _input->get_action_strength("move_up");
|
||||
|
||||
if (velocity.length() > 0) {
|
||||
velocity = velocity.normalized() * speed;
|
||||
|
||||
@@ -5,12 +5,14 @@
|
||||
#include <Area2D.hpp>
|
||||
#include <CollisionShape2D.hpp>
|
||||
#include <Godot.hpp>
|
||||
#include <Input.hpp>
|
||||
|
||||
class Player : public godot::Area2D {
|
||||
GODOT_CLASS(Player, godot::Area2D)
|
||||
|
||||
godot::AnimatedSprite *_animated_sprite;
|
||||
godot::CollisionShape2D *_collision_shape;
|
||||
godot::Input *_input;
|
||||
godot::Vector2 _screen_size; // Size of the game window.
|
||||
|
||||
public:
|
||||
|
||||
@@ -4,7 +4,7 @@ A simple Pong game, made with GDNative C++. This demo shows best practices
|
||||
for game development in Godot, including
|
||||
[signals](https://docs.godotengine.org/en/latest/getting_started/step_by_step/signals.html).
|
||||
|
||||
Language: C++
|
||||
Language: [GDNative C++](https://docs.godotengine.org/en/latest/tutorials/scripting/gdnative/index.html)
|
||||
|
||||
Renderer: GLES 2
|
||||
|
||||
@@ -24,7 +24,7 @@ scons platform=PLATFORM
|
||||
|
||||
Where PLATFORM is: `windows`, `linux`, or `osx`.
|
||||
|
||||
This creates the file `libsimple` in the respective
|
||||
This creates the file `libpong` in the respective
|
||||
subfolders in the `project/gdnative` directory.
|
||||
|
||||
Dependencies:
|
||||
|
||||
1
cpp/pong/godot-cpp
Submodule
1
cpp/pong/godot-cpp
Submodule
Submodule cpp/pong/godot-cpp added at e08ecdc28c
@@ -3,7 +3,7 @@
|
||||
This is a small example using C++ to create a GDNative script
|
||||
that just showcases some very simple bare bones calls.
|
||||
|
||||
Language: C++
|
||||
Language: [GDNative C++](https://docs.godotengine.org/en/latest/tutorials/scripting/gdnative/index.html)
|
||||
|
||||
Renderer: GLES 2
|
||||
|
||||
|
||||
1
cpp/simple/godot-cpp
Submodule
1
cpp/simple/godot-cpp
Submodule
Submodule cpp/simple/godot-cpp added at e08ecdc28c
Reference in New Issue
Block a user