Commit 8d67ff9d authored by Kevin Balz's avatar Kevin Balz

kill bullets

parent 72bd3f4f
Pipeline #3390 failed with stage
in 4 minutes and 30 seconds
......@@ -23,5 +23,9 @@
"Rigid_body": {
"radius": 0.3
},
"Bullet": {}
"Bullet": {},
"Killable": {
"radius": 1,
"only_stationary": true
}
}
......@@ -23,7 +23,7 @@
"attack_width": 0.5
},
"Stationary_attack": {
"radius": 3
"radius": 7
},
"Rigid_body": {
"radius": 0.5
......
dummy
################################
#|------------------|#|-------|#
#| - b b b|#| G |#
#| p b bbb b|#| |#
#| b b b|#| -- |#
#|-------------| |#| --b-- |#
####|----------|b |#| b -- |#
####| b b |#| b |#
####| b b b|#| -- |#
####|b |-------| |#| -- |#
####| |-------|b |-| b |#
####| b b b |#
####| b b b b b - |#
####| b b b b |#
####|-------------------------|#
###################-----------|#
#|-------|#|-----|| b |#
##---- b|-| b -- b |#
#|p b b G|#
#|---- b|-| b -- b |#
######---|#|-----|| b |#
###################-----------|#
################################
\ No newline at end of file
......@@ -31,6 +31,9 @@ namespace phase_shifter::gameplay {
move.attack = false;
for(auto&& [entity, k_transform, kill] :
_ecs.list<Entity_handle, Transform_comp, Killable_comp>()) {
if(!kill.only_stationary) {
continue;
}
glm::vec2 k_position(k_transform.position.x, k_transform.position.z);
if(glm::length(position - k_position) < attack.radius + 1) {
auto attack_direction = glm::normalize(k_position - position);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment