40 lines
492 B
C++
40 lines
492 B
C++
#include "gdexample.h"
|
|
|
|
|
|
namespace godot {
|
|
|
|
|
|
#pragma region GodotRT
|
|
void GDExample::_bind_methods()
|
|
{
|
|
}
|
|
|
|
// void GDExample::_init()
|
|
// {
|
|
// time_passed = 0.f;
|
|
// }
|
|
|
|
void GDExample::_process(double delta)
|
|
{
|
|
time_passed += delta;
|
|
|
|
Vector2
|
|
newPos = Vector2(
|
|
10.0 + (10.0 * sin(time_passed * 2.0)),
|
|
10.0 + (10.0 * cos(time_passed * 1.5))
|
|
);
|
|
|
|
set_position(newPos);
|
|
}
|
|
#pragma endregion GodotRT
|
|
|
|
GDExample::GDExample()
|
|
{
|
|
time_passed = 0.f;
|
|
}
|
|
|
|
GDExample::~GDExample()
|
|
{}
|
|
|
|
|
|
} // godot
|