fix projectiles not killing player

This commit is contained in:
Haze Weathers 2023-05-10 14:34:03 -04:00
parent 7b0fb8ece5
commit e1b5c498f3
6 changed files with 9 additions and 10 deletions

View file

@ -49,7 +49,7 @@ func _physics_process(delta):
if Game.get_sector(global_position) == Game.get_sector(collider.global_position):
if Game.is_easy_mode:
var easy_bullet = EasyBullet.instance()
easy_bullet.target_group = "player"
easy_bullet.target_group = "player_hitbox"
easy_bullet.direction = sign(shoot_position.global_position.x - global_position.x)
easy_bullet.global_position = shoot_position.global_position
easy_bullet.speed = 100

View file

@ -21,6 +21,7 @@ _data = [ Vector2( 0, 1 ), 0.0, -1.45746, 0, 0, Vector2( 1, 0 ), 0.00323196, 0.0
[node name="ArrowProjectile" type="Node2D"]
script = ExtResource( 3 )
target_group = "player_hitbox"
[node name="Sprite" type="Sprite" parent="."]
material = SubResource( 1 )

View file

@ -30,7 +30,7 @@ func spawn_bullet():
var arrow = ArrowProjectile.instance()
arrow.global_position = global_position + (shootpos.position * scale)
arrow.direction = sign(shootpos.position.x) * scale.x
arrow.target_group = "player"
arrow.target_group = "player_hitbox"
arrow.speed = arrow_speed
Game.get_map().add_child(arrow)
timer.start(shoot_time)

View file

@ -33,7 +33,7 @@ func spawn_arrow():
else:
arrow.global_position = global_position + arrow_spawn_l.position
arrow.direction = scale.x
arrow.target_group = "player"
arrow.target_group = "player_hitbox"
arrow.speed = arrow_speed
Game.get_map().add_child(arrow)
timer.start(shoot_time)