diff options
-rw-r--r-- | game/GameScene.cpp | 2 | ||||
-rw-r--r-- | game/prefab/ZapperObject.cpp | 23 | ||||
-rw-r--r-- | src/crepe/api/Vector2.hpp | 1 |
3 files changed, 10 insertions, 16 deletions
diff --git a/game/GameScene.cpp b/game/GameScene.cpp index 71612e3..dc0038b 100644 --- a/game/GameScene.cpp +++ b/game/GameScene.cpp @@ -19,8 +19,8 @@ #include "MoveCameraManualyScript.h" #include "StartGameScript.h" -#include "background/BackgroundSubScene.h" #include "PlayerSubScene.h" +#include "background/BackgroundSubScene.h" #include "prefab/ZapperObject.h" using namespace crepe; diff --git a/game/prefab/ZapperObject.cpp b/game/prefab/ZapperObject.cpp index f70415c..8df2075 100644 --- a/game/prefab/ZapperObject.cpp +++ b/game/prefab/ZapperObject.cpp @@ -1,7 +1,7 @@ #include <crepe/api/Transform.h> -#include "ZapperObject.h" #include "Config.h" +#include "ZapperObject.h" using namespace crepe; @@ -73,18 +73,14 @@ ZapperObject::ZapperObject(crepe::GameObject && base) .glow_end = add_component<Animator>( sprite.glow_end, ivec2(128, 128), uvec2(16, 1), animator.glow_start.data ), - }, - body { - add_component<Rigidbody>(Rigidbody::Data { - .body_type = Rigidbody::BodyType::KINEMATIC, - .kinematic_collision = false, - }) - }, - collider { - add_component<BoxCollider>(vec2(0, 0)) - } { - this->place(this->transform.position, 0, 300); - } + }, + body {add_component<Rigidbody>(Rigidbody::Data { + .body_type = Rigidbody::BodyType::KINEMATIC, + .kinematic_collision = false, + })}, + collider {add_component<BoxCollider>(vec2(0, 0))} { + this->place(this->transform.position, 0, 300); +} void ZapperObject::place(const crepe::vec2 & position, float rotation, float length) { this->transform.position = position; @@ -101,4 +97,3 @@ void ZapperObject::place(const crepe::vec2 & position, float rotation, float len this->collider.dimensions = offset.rotate(rotation) * 2 + vec2(30, 30) * SCALE; } - diff --git a/src/crepe/api/Vector2.hpp b/src/crepe/api/Vector2.hpp index a4ce641..5709f46 100644 --- a/src/crepe/api/Vector2.hpp +++ b/src/crepe/api/Vector2.hpp @@ -177,5 +177,4 @@ Vector2<T> Vector2<T>::rotate(float deg) const { }; } - } // namespace crepe |