diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2025-01-10 11:11:53 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2025-01-10 11:11:53 +0100 |
commit | 22d77b99d700e6317a7432e475330e4bb3c9745d (patch) | |
tree | 45e9c0daf3de091eb1ac655fc8e0da8c1908b3ab /game | |
parent | 9246924d2885cdf236a08d20945a4526000cfe39 (diff) |
make format
Diffstat (limited to 'game')
-rw-r--r-- | game/enemy/EnemyPool.h | 3 | ||||
-rw-r--r-- | game/enemy/EnemyScript.cpp | 8 | ||||
-rw-r--r-- | game/enemy/EnemySubScene.cpp | 2 |
3 files changed, 6 insertions, 7 deletions
diff --git a/game/enemy/EnemyPool.h b/game/enemy/EnemyPool.h index 25f7fb8..cfd0b1c 100644 --- a/game/enemy/EnemyPool.h +++ b/game/enemy/EnemyPool.h @@ -1,9 +1,8 @@ #pragma once -#include <crepe/api/Scene.h> #include "EnemyConfig.h" +#include <crepe/api/Scene.h> class EnemyPool { public: void create_enemies(crepe::Scene & scn); - }; diff --git a/game/enemy/EnemyScript.cpp b/game/enemy/EnemyScript.cpp index 77c9bd2..24583c0 100644 --- a/game/enemy/EnemyScript.cpp +++ b/game/enemy/EnemyScript.cpp @@ -99,7 +99,7 @@ bool EnemyScript::spawn_enemy(const SpawnEnemyEvent & e) { Transform & transform = this->get_component<Transform>(); Camera & camera = this->get_components_by_name<Camera>("camera").front(); Transform & cam_transform = this->get_components_by_name<Transform>("camera").front(); - Rigidbody& rb = this->get_component<Rigidbody>(); + Rigidbody & rb = this->get_component<Rigidbody>(); rb.data.collision_layers = {COLL_LAY_BOT_TOP, COLL_LAY_PLAYER_BULLET}; rb.data.collision_layer = COLL_LAY_ENEMY; vec2 half_screen = camera.viewport_size / 2; @@ -139,10 +139,10 @@ bool EnemyScript::on_collide(const CollisionEvent & e) { //Sprite& sprite; set_hit_blink(true); if (health <= 0) { - this->death(); - } + this->death(); + } } - + //body_animator.play(); return false; diff --git a/game/enemy/EnemySubScene.cpp b/game/enemy/EnemySubScene.cpp index d1117d8..c6aecec 100644 --- a/game/enemy/EnemySubScene.cpp +++ b/game/enemy/EnemySubScene.cpp @@ -53,7 +53,7 @@ int EnemySubScene::create(Scene & scn, int enemy_counter) { } ); body_animator.pause(); - + Asset enemy_head_asset {"asset/workers/worker2Head.png"}; Sprite & enemy_head_sprite = enemy.add_component<Sprite>( enemy_head_asset, |