diff options
Diffstat (limited to 'game/missile')
-rw-r--r-- | game/missile/AlertSubScene.cpp | 4 | ||||
-rw-r--r-- | game/missile/MissileScript.cpp | 12 | ||||
-rw-r--r-- | game/missile/MissileSubScene.cpp | 15 | ||||
-rw-r--r-- | game/missile/SpawnEvent.cpp | 4 |
4 files changed, 15 insertions, 20 deletions
diff --git a/game/missile/AlertSubScene.cpp b/game/missile/AlertSubScene.cpp index 8d59f97..5bce5ac 100644 --- a/game/missile/AlertSubScene.cpp +++ b/game/missile/AlertSubScene.cpp @@ -7,7 +7,7 @@ using namespace crepe; -MissileAlert::MissileAlert(Scene& scn){ +MissileAlert::MissileAlert(Scene & scn) { GameObject alert = scn.new_object("missile_alert", "missile_alert", {0, 0}, 0, 1); Asset missile_alert_ss {"asset/obstacles/missile/missileAlert.png"}; @@ -30,6 +30,4 @@ MissileAlert::MissileAlert(Scene& scn){ missile_alert_anim.set_anim(1); missile_alert_sprite.active = false; - - } diff --git a/game/missile/MissileScript.cpp b/game/missile/MissileScript.cpp index 797e1ac..bcc4f5b 100644 --- a/game/missile/MissileScript.cpp +++ b/game/missile/MissileScript.cpp @@ -2,17 +2,17 @@ #include "../Config.h" #include <cmath> -#include <crepe/api/CircleCollider.h> -#include <crepe/api/Rigidbody.h> -#include <crepe/api/BehaviorScript.h> +#include <crepe/api/AI.h> #include <crepe/api/Animator.h> #include <crepe/api/AudioSource.h> +#include <crepe/api/BehaviorScript.h> +#include <crepe/api/CircleCollider.h> +#include <crepe/api/KeyCodes.h> +#include <crepe/api/Rigidbody.h> +#include <crepe/api/Sprite.h> #include <crepe/api/Transform.h> #include <crepe/system/CollisionSystem.h> #include <crepe/types.h> -#include <crepe/api/AI.h> -#include <crepe/api/KeyCodes.h> -#include <crepe/api/Sprite.h> using namespace std; using namespace crepe; diff --git a/game/missile/MissileSubScene.cpp b/game/missile/MissileSubScene.cpp index 6df6c87..d325050 100644 --- a/game/missile/MissileSubScene.cpp +++ b/game/missile/MissileSubScene.cpp @@ -87,14 +87,13 @@ void MissileSubScene::create(crepe::Scene & scn) { missile_explosion_sprite.active = false; explosion_anim.active = false; - missle - .add_component<Rigidbody>(Rigidbody::Data { - .body_type = Rigidbody::BodyType::KINEMATIC, - .max_linear_velocity = Random::f(250, 200), - .kinematic_collision = false, - .collision_layers = {COLL_LAY_PLAYER, COLL_LAY_BOT_TOP}, - .collision_layer = COLL_LAY_MISSILE, - }); + missle.add_component<Rigidbody>(Rigidbody::Data { + .body_type = Rigidbody::BodyType::KINEMATIC, + .max_linear_velocity = Random::f(250, 200), + .kinematic_collision = false, + .collision_layers = {COLL_LAY_PLAYER, COLL_LAY_BOT_TOP}, + .collision_layer = COLL_LAY_MISSILE, + }); missle.add_component<CircleCollider>(3).active = false; diff --git a/game/missile/SpawnEvent.cpp b/game/missile/SpawnEvent.cpp index a54d0a5..c7209b7 100644 --- a/game/missile/SpawnEvent.cpp +++ b/game/missile/SpawnEvent.cpp @@ -1,12 +1,11 @@ #include "SpawnEvent.h" #include "Random.h" - -#include <crepe/api/CircleCollider.h> #include <crepe/api/Animator.h> #include <crepe/api/AudioSource.h> #include <crepe/api/BehaviorScript.h> #include <crepe/api/Camera.h> +#include <crepe/api/CircleCollider.h> #include <crepe/api/Sprite.h> #include <crepe/api/Transform.h> @@ -40,7 +39,6 @@ bool MissileSpawnEventHandler::on_event(const MissileSpawnEvent & event) { transform.position.x = camera_transform.position.x + this->MISSILE_OFFSET; transform.position.y = Random::i(this->MAX_RANGE, this->MIN_RANGE); - auto & alert_transform = alert_transforms[i].get(); auto & alert_sprite = alert_sprites[i].get(); alert_sprite.active = true; |