fix projectiles not killing player
This commit is contained in:
parent
7b0fb8ece5
commit
e1b5c498f3
6 changed files with 9 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
extends Node2D
|
||||
|
||||
# speed to fly at
|
||||
export var speed = 240.0
|
||||
|
||||
# group to kill
|
||||
var target_group = "enemy_hitbox"
|
||||
export var target_group = "enemy_hitbox"
|
||||
# direction to fly
|
||||
var direction = 1.0
|
||||
|
||||
export var direction = 1.0
|
||||
# whether or not it frees on wall collision
|
||||
var breaks_on_wall = true
|
||||
export var breaks_on_wall = true
|
||||
|
||||
#Edge to check culling, if this edge is offscreen, delete the arrow
|
||||
onready var cull_edge = Vector2(5 * direction,0)
|
||||
onready var player = get_parent().get_node("Player")
|
||||
onready var initial_sector = Game.current_sector
|
||||
|
||||
func _ready():
|
||||
|
|
|
@ -936,8 +936,8 @@ script = ExtResource( 8 )
|
|||
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/Shooting" to="." method="_on_Shooting_state_entered"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne" to="." method="_process_gravity"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_entered"]
|
||||
[connection signal="state_exited" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_exited"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/LadderJump" to="." method="_on_LadderJump_state_entered"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue