diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-11-12 16:09:43 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-11-12 16:09:43 +0100 |
commit | 73127fd15a3b074cb3c964da448b6bb3d237ee73 (patch) | |
tree | d2f5bd2708fca0f44d767ee8f7cb0a5aeb00939e /src/example/collision.cpp | |
parent | d3c9a8afa68e79e7cf9a82ecd78be532751913dc (diff) |
added collision methodes
Diffstat (limited to 'src/example/collision.cpp')
-rw-r--r-- | src/example/collision.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/example/collision.cpp b/src/example/collision.cpp index dc97c81..e82b493 100644 --- a/src/example/collision.cpp +++ b/src/example/collision.cpp @@ -7,11 +7,24 @@ #include <crepe/api/BoxCollider.h> #include <crepe/api/Transform.h> #include <crepe/system/PhysicsSystem.h> +#include <crepe/system/RenderSystem.h> +#include <crepe/util/log.h> + +#include <crepe/api/AssetManager.h> +#include <crepe/api/Color.h> +#include <crepe/api/Sprite.h> +#include <crepe/api/Texture.h> +#include <crepe/api/Transform.h> +#include <crepe/api/Vector2.h> + +#include <chrono> +#include <memory> using namespace crepe; using namespace std; int main(int argc, char * argv[]) { + Color color(0, 0, 0, 0); GameObject game_object1(0, "Name", "Tag", Vector2{10, 10}, 0, 1); game_object1.add_component<Rigidbody>(Rigidbody::Data{ @@ -24,6 +37,10 @@ int main(int argc, char * argv[]) { .offset = {0,0} }); game_object1.add_component<BoxCollider>(Vector2{5, 5}, 5, 5); + // game_object1.add_component<Sprite>( + // make_shared<Texture>("/home/jaro/crepe/asset/texture/img.png"), color, + // FlipSettings{true, true}); + GameObject game_object2(1, "Name", "Tag", Vector2{20, 0}, 90, 1); game_object2.add_component<Rigidbody>(Rigidbody::Data{ @@ -36,7 +53,16 @@ int main(int argc, char * argv[]) { .offset = {0,0} }); game_object2.add_component<BoxCollider>(Vector2{5, 5}, 5, 5); + // game_object2.add_component<Sprite>( + // make_shared<Texture>("/home/jaro/crepe/asset/texture/img.png"), color, + // FlipSettings{true, true}); + CollisionSystem coltest; coltest.update(); + // auto & sys = crepe::RenderSystem::get_instance(); + // auto start = std::chrono::steady_clock::now(); + // while (std::chrono::steady_clock::now() - start < std::chrono::seconds(5)) { + // sys.update(); + // } return 0; } |