Added autoshooting
This commit is contained in:
@@ -24,11 +24,6 @@ func _add_weapon(weapon: AbstractWeapon, weapon_position: Vector2) -> void:
|
||||
weapon.set_belonging(AbstractWeapon.Belonging.ENEMY)
|
||||
|
||||
|
||||
func _on_enemy_controller_shoot() -> void:
|
||||
for weapon in _weapons:
|
||||
weapon.shoot(velocity)
|
||||
|
||||
|
||||
func _on_visible_on_screen_notifier_2d_screen_entered() -> void:
|
||||
is_on_screen = true
|
||||
|
||||
|
||||
@@ -16,6 +16,6 @@ ship = NodePath("..")
|
||||
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="." index="5"]
|
||||
|
||||
[connection signal="accelerate" from="EnemyController" to="." method="accelerate"]
|
||||
[connection signal="shoot" from="EnemyController" to="." method="_on_enemy_controller_shoot"]
|
||||
[connection signal="shoot" from="EnemyController" to="." method="shoot"]
|
||||
[connection signal="screen_entered" from="VisibleOnScreenNotifier2D" to="." method="_on_visible_on_screen_notifier_2d_screen_entered"]
|
||||
[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"]
|
||||
|
||||
Reference in New Issue
Block a user