aboutsummaryrefslogtreecommitdiff
path: root/game/enemy/EnemySubScene.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2025-01-10 19:51:02 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2025-01-10 19:51:02 +0100
commit16917357837916d1ef88b6122218fa0d567d1ddc (patch)
treeeefa561b81c48549277950692fdad714a2f501f2 /game/enemy/EnemySubScene.cpp
parent0b19fe5a9168368d4be0993407dd3fc3bdfa0611 (diff)
parentb9d00961a8894356c7cff7597de424a12d2841a6 (diff)
Merge remote-tracking branch 'origin/master' into niels/game
Diffstat (limited to 'game/enemy/EnemySubScene.cpp')
-rw-r--r--game/enemy/EnemySubScene.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/game/enemy/EnemySubScene.cpp b/game/enemy/EnemySubScene.cpp
index 607b9a9..c6aecec 100644
--- a/game/enemy/EnemySubScene.cpp
+++ b/game/enemy/EnemySubScene.cpp
@@ -31,8 +31,9 @@ int EnemySubScene::create(Scene & scn, int enemy_counter) {
.collision_layer = COLL_LAY_ENEMY,
});
+ // normal body
Asset enemy_body_asset {"asset/workers/worker2Body.png"};
- enemy.add_component<BoxCollider>(vec2(50, 50));
+ enemy.add_component<BoxCollider>(vec2(40, 60));
Sprite & enemy_body_sprite = enemy.add_component<Sprite>(
enemy_body_asset,
Sprite::Data {
@@ -52,7 +53,7 @@ int EnemySubScene::create(Scene & scn, int enemy_counter) {
}
);
body_animator.pause();
- enemy.add_component<BoxCollider>(vec2(40, 60), vec2(-20, 0));
+
Asset enemy_head_asset {"asset/workers/worker2Head.png"};
Sprite & enemy_head_sprite = enemy.add_component<Sprite>(
enemy_head_asset,
@@ -71,7 +72,9 @@ int EnemySubScene::create(Scene & scn, int enemy_counter) {
.looping = true,
}
);
- enemy.add_component<CircleCollider>(25, vec2(0, -20));
+
+ //jetpack
+ //enemy.add_component<CircleCollider>(25, vec2(0, -20));
Asset enemy_jetpack_asset {"asset/barry/jetpackDefault.png"};
Sprite & enemy_jetpack_sprite = enemy.add_component<Sprite>(
enemy_jetpack_asset,
@@ -91,11 +94,24 @@ int EnemySubScene::create(Scene & scn, int enemy_counter) {
.looping = true,
}
);
+ //gun
+ Asset enemy_pistol_asset {"asset/workers/gun.png"};
+ Sprite & enemy_pistol_sprite = enemy.add_component<Sprite>(
+ enemy_pistol_asset,
+ Sprite::Data {
+ .flip = {false, false},
+ .sorting_in_layer = SORT_IN_LAY_WORKERS_FRONT,
+ .order_in_layer = 2,
+ .size = vec2(0, 20),
+ .position_offset = vec2(-20, 0),
+ }
+ );
enemy.add_component<AudioSource>(Asset("asset/sfx/bike_gun_2.ogg")).volume = 0.1;
AI & ai_component = enemy.add_component<AI>(3000);
ai_component.path_follow_on();
+ ai_component.active = false;
BehaviorScript & enemy_script
= enemy.add_component<BehaviorScript>().set_script<EnemyScript>();
- enemy_script.active = false;
+ //enemy_script.active = false;
return enemy_counter;
}