aboutsummaryrefslogtreecommitdiff
path: root/game/enemy/EnemyScript.h
diff options
context:
space:
mode:
authorheavydemon21 <48092678+heavydemon21@users.noreply.github.com>2025-01-10 19:35:08 +0100
committerGitHub <noreply@github.com>2025-01-10 19:35:08 +0100
commitb9d00961a8894356c7cff7597de424a12d2841a6 (patch)
treeaa033307a742df0c22131482858749bcf480ba38 /game/enemy/EnemyScript.h
parent20f6f8ddf013e5d18770bd0a01474a845843bdd7 (diff)
parentf3413f3d0fbffee0cc363096cd873a8be766ad64 (diff)
Merge pull request #123 from lonkaars/wouter/game-improvements
some extra features
Diffstat (limited to 'game/enemy/EnemyScript.h')
-rw-r--r--game/enemy/EnemyScript.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/game/enemy/EnemyScript.h b/game/enemy/EnemyScript.h
index 42ecac4..be71a78 100644
--- a/game/enemy/EnemyScript.h
+++ b/game/enemy/EnemyScript.h
@@ -13,19 +13,25 @@ public:
EnemyScript();
void init() override;
void fixed_update(crepe::duration_t dt) override;
- void shoot(const crepe::vec2 & position, float angle);
+ void shoot(const crepe::vec2 & position);
bool on_collide(const crepe::CollisionEvent & collisionData);
void despawn_enemy();
bool spawn_enemy(const SpawnEnemyEvent & e);
+ void death();
+ void set_hit_blink(bool status);
private:
std::random_device rd;
std::default_random_engine engine;
bool alive = false;
+ bool spawned = false;
float speed = 50;
- const float MIN_SPEED = 10;
- const float MAX_SPEED = 130;
- const float MAX_DISTANCE = 100;
+ int health = 2;
+ const float MIN_SPEED = 20;
+ const float MAX_SPEED = 150;
+ const float MAX_DISTANCE = 200;
std::chrono::time_point<std::chrono::steady_clock> last_fired;
+ std::chrono::time_point<std::chrono::steady_clock> last_hit;
std::chrono::duration<float> shot_delay = std::chrono::duration<float>(0);
+ std::chrono::duration<float> blink_time = std::chrono::duration<float>(0.1);
};