diff options
author | Fredia Huya-Kouadio <fhuya@meta.com> | 2023-08-17 11:49:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 11:49:20 -0700 |
commit | 1f04b16320add64cea98e33fe541b426ff321713 (patch) | |
tree | 741a6563c1795437c0ad5b80c6121b5476861361 /plugins/hello_gdextension/src/main/cpp/gdexample.cpp | |
parent | e61f1555b696b62152787d0fee14435325aee62b (diff) | |
parent | 37e27e3db22c0b33d098a0ac1fb2dfe8861be0fb (diff) | |
download | godot-android-samples-1f04b16320add64cea98e33fe541b426ff321713.tar.gz godot-android-samples-1f04b16320add64cea98e33fe541b426ff321713.tar.bz2 godot-android-samples-1f04b16320add64cea98e33fe541b426ff321713.zip |
Merge pull request #2 from m4gr3d/add_gdextension_plugin_sample
Add an Android GDExtension plugin sample
Diffstat (limited to 'plugins/hello_gdextension/src/main/cpp/gdexample.cpp')
-rw-r--r-- | plugins/hello_gdextension/src/main/cpp/gdexample.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/hello_gdextension/src/main/cpp/gdexample.cpp b/plugins/hello_gdextension/src/main/cpp/gdexample.cpp new file mode 100644 index 0000000..1652936 --- /dev/null +++ b/plugins/hello_gdextension/src/main/cpp/gdexample.cpp @@ -0,0 +1,22 @@ +#include "gdexample.h" +#include <godot_cpp/core/class_db.hpp> + +using namespace godot; + +void GDExample::_bind_methods() { + +} + +GDExample::GDExample() { + time_passed = 0.0; +} + +GDExample::~GDExample() {} + +void GDExample::_process(double delta) { + time_passed += delta; + + Vector2 new_position = Vector2(10.0 + (10.0 * sin(time_passed * 2.0)), 10.0 + (10.0 * cos(time_passed * 1.5))); + + set_position(new_position); +} |