diff --git a/objects/enemy/roboturret.gd b/objects/enemy/roboturret.gd index c8bdcbc..22b3797 100644 --- a/objects/enemy/roboturret.gd +++ b/objects/enemy/roboturret.gd @@ -24,11 +24,8 @@ func _physics_process(delta): func spawn_bullet(): var arrow = ArrowProjectile.instance() - if scale.x > 0: - arrow.global_position = global_position + shootpos.position - else: - arrow.global_position = global_position + shootpos.position - arrow.direction = sign(shootpos.position.x) + arrow.global_position = global_position + (shootpos.position * scale) + arrow.direction = sign(shootpos.position.x) * scale.x arrow.target_group = "player" arrow.speed = arrow_speed Game.get_map().add_child(arrow) diff --git a/objects/enemy/roboturret.tscn b/objects/enemy/roboturret.tscn index 3fc24ae..deb7d32 100644 --- a/objects/enemy/roboturret.tscn +++ b/objects/enemy/roboturret.tscn @@ -155,7 +155,7 @@ autostart = true [node name="RayCast2D" type="RayCast2D" parent="."] position = Vector2( 3, 3 ) enabled = true -cast_to = Vector2( 45, 0 ) +cast_to = Vector2( 48, 0 ) collision_mask = 8 collide_with_areas = true