generated from Persson-dev/Godot-Xmake
Initial commit
This commit is contained in:
28
src/gdexample.cpp
Normal file
28
src/gdexample.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
#include "gdexample.h"
|
||||
#include <godot_cpp/core/class_db.hpp>
|
||||
|
||||
using namespace godot;
|
||||
|
||||
void GDExample::_bind_methods() {
|
||||
// ClassDB::bind_method(D_METHOD("_process", "delta"), &GDExample::_process);
|
||||
}
|
||||
|
||||
GDExample::GDExample()
|
||||
{
|
||||
time_passed = 0.0;
|
||||
|
||||
}
|
||||
|
||||
GDExample::~GDExample() {}
|
||||
|
||||
void GDExample::_process(float delta)
|
||||
{
|
||||
time_passed += delta;
|
||||
|
||||
auto 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);
|
||||
}
|
||||
Reference in New Issue
Block a user