aboutsummaryrefslogtreecommitdiff
path: root/src/example
diff options
context:
space:
mode:
Diffstat (limited to 'src/example')
-rw-r--r--src/example/ecs.cpp14
-rw-r--r--src/example/particle.cpp1
-rw-r--r--src/example/scene_manager.cpp31
3 files changed, 24 insertions, 22 deletions
diff --git a/src/example/ecs.cpp b/src/example/ecs.cpp
index 6f9752e..7593faf 100644
--- a/src/example/ecs.cpp
+++ b/src/example/ecs.cpp
@@ -1,9 +1,9 @@
#include <iostream>
-#include "../crepe/ComponentManager.h"
-#include "../crepe/Metadata.h"
-#include "../crepe/api/GameObject.h"
-#include "../crepe/api/Transform.h"
+#include <crepe/ComponentManager.h>
+#include <crepe/api/GameObject.h>
+#include <crepe/api/Metadata.h>
+#include <crepe/api/Transform.h>
using namespace crepe;
using namespace std;
@@ -38,8 +38,8 @@ int main() {
// Print the Metadata and Transform components
for (auto & m : metadata) {
- cout << "Id: " << m.get().game_object_id << " Name: " << m.get().name
- << " Tag: " << m.get().tag << " Parent: " << m.get().parent
+ cout << "Id: " << m.get().GAME_OBJECT_ID << " Name: " << m.get().NAME
+ << " Tag: " << m.get().TAG << " Parent: " << m.get().parent
<< " Children: ";
for (auto & c : m.get().children) {
cout << c << " ";
@@ -47,7 +47,7 @@ int main() {
cout << endl;
}
for (auto & t : transform) {
- cout << "Id: " << t.get().game_object_id << " Position: ["
+ cout << "Id: " << t.get().GAME_OBJECT_ID << " Position: ["
<< t.get().position.x << ", " << t.get().position.y << "]" << endl;
}
diff --git a/src/example/particle.cpp b/src/example/particle.cpp
index 69da015..607530d 100644
--- a/src/example/particle.cpp
+++ b/src/example/particle.cpp
@@ -7,6 +7,7 @@
#include <crepe/Particle.h>
#include <crepe/api/GameObject.h>
#include <crepe/api/ParticleEmitter.h>
+#include <crepe/api/Point.h>
#include <crepe/facade/SDLApp.h>
#include <crepe/system/ParticleSystem.h>
diff --git a/src/example/scene_manager.cpp b/src/example/scene_manager.cpp
index 2fcdbec..bfa9479 100644
--- a/src/example/scene_manager.cpp
+++ b/src/example/scene_manager.cpp
@@ -1,17 +1,18 @@
#include <iostream>
-#include "../crepe/ComponentManager.h"
-#include "../crepe/Metadata.h"
-#include "../crepe/api/GameObject.h"
-#include "../crepe/api/Scene.h"
-#include "../crepe/api/SceneManager.h"
+#include <crepe/ComponentManager.h>
+#include <crepe/api/GameObject.h>
+#include <crepe/api/Metadata.h>
+#include <crepe/api/Point.h>
+#include <crepe/api/Scene.h>
+#include <crepe/api/SceneManager.h>
using namespace crepe;
using namespace std;
-class concreteScene1 : public Scene {
+class ConcreteScene1 : public Scene {
public:
- concreteScene1(string name) : Scene(name) {}
+ ConcreteScene1(string name) : Scene(name) {}
void load_scene() {
GameObject object1(0, "scene_1", "tag_scene_1", Point{0, 0}, 0, 1);
@@ -20,9 +21,9 @@ public:
}
};
-class concreteScene2 : public Scene {
+class ConcreteScene2 : public Scene {
public:
- concreteScene2(string name) : Scene(name) {}
+ ConcreteScene2(string name) : Scene(name) {}
void load_scene() {
GameObject object1(0, "scene_2", "tag_scene_2", Point{0, 0}, 0, 1);
@@ -36,8 +37,8 @@ int main() {
SceneManager & scene_mgr = SceneManager::get_instance();
// Add the scenes to the scene manager
- scene_mgr.add_scene<concreteScene1>("scene1");
- scene_mgr.add_scene<concreteScene2>("scene2");
+ scene_mgr.add_scene<ConcreteScene1>("scene1");
+ scene_mgr.add_scene<ConcreteScene2>("scene2");
// There is no need to call set_next_scene() at the beginnen, because the first scene will be automatically set as the next scene
// Load scene1 (the first scene added)
@@ -51,8 +52,8 @@ int main() {
cout << "Metadata components of Scene1:" << endl;
// Print the Metadata
for (auto & m : metadata) {
- cout << "Id: " << m.get().game_object_id << " Name: " << m.get().name
- << " Tag: " << m.get().tag << endl;
+ cout << "Id: " << m.get().GAME_OBJECT_ID << " Name: " << m.get().NAME
+ << " Tag: " << m.get().TAG << endl;
}
// Set scene2 as the next scene
@@ -66,8 +67,8 @@ int main() {
cout << "Metadata components of Scene2:" << endl;
// Print the Metadata
for (auto & m : metadata) {
- cout << "Id: " << m.get().game_object_id << " Name: " << m.get().name
- << " Tag: " << m.get().tag << endl;
+ cout << "Id: " << m.get().GAME_OBJECT_ID << " Name: " << m.get().NAME
+ << " Tag: " << m.get().TAG << endl;
}
return 0;