added some functions
This commit is contained in:
Binary file not shown.
11
src/main.cpp
11
src/main.cpp
@@ -1,5 +1,6 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <godot_cpp/core/class_db.hpp>
|
#include <godot_cpp/core/class_db.hpp>
|
||||||
|
#include <godot_cpp/variant/utility_functions.hpp>
|
||||||
|
|
||||||
using namespace godot;
|
using namespace godot;
|
||||||
|
|
||||||
@@ -15,10 +16,10 @@ DiscordRPC::~DiscordRPC() {
|
|||||||
// add your cleanup here
|
// add your cleanup here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DiscordRPC::_ready() {
|
||||||
|
UtilityFunctions::print("Hello mom");
|
||||||
|
}
|
||||||
|
|
||||||
void DiscordRPC::_process(float delta) {
|
void DiscordRPC::_process(float 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);
|
|
||||||
}
|
}
|
10
src/main.h
10
src/main.h
@@ -1,12 +1,13 @@
|
|||||||
#ifndef DISCORDRPC_H
|
#ifndef DISCORDRPC_H
|
||||||
#define DISCORDRPC_H
|
#define DISCORDRPC_H
|
||||||
|
|
||||||
#include <godot_cpp/classes/sprite2d.hpp>
|
|
||||||
|
#include <godot_cpp/classes/node.hpp>
|
||||||
|
|
||||||
namespace godot {
|
namespace godot {
|
||||||
|
|
||||||
class DiscordRPC : public Sprite2D {
|
class DiscordRPC : public Node {
|
||||||
GDCLASS(DiscordRPC, Sprite2D)
|
GDCLASS(DiscordRPC, Node)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float time_passed;
|
float time_passed;
|
||||||
@@ -18,9 +19,10 @@ public:
|
|||||||
DiscordRPC();
|
DiscordRPC();
|
||||||
~DiscordRPC();
|
~DiscordRPC();
|
||||||
|
|
||||||
|
void _ready();
|
||||||
void _process(float delta);
|
void _process(float delta);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
Reference in New Issue
Block a user