Improve code style (#1021)

* Remove unnecessary use of `self`
* Connect to signals directly over `connect("name")`
* Use `call_deferred` on callables over `call_deferred("name"))`
* Emit signals directly over `emit_signal("name"...)`
This commit is contained in:
A Thousand Ships
2024-03-25 17:06:52 +01:00
committed by GitHub
parent 523c7d34c0
commit 82913393a8
70 changed files with 211 additions and 211 deletions

View File

@@ -191,7 +191,7 @@ func _shot_bullet() -> void:
else:
speed_scale = 1.0
bullet.position = self.position + bullet_shoot.position * Vector2(speed_scale, 1.0)
bullet.position = position + bullet_shoot.position * Vector2(speed_scale, 1.0)
get_parent().add_child(bullet)
bullet.linear_velocity = Vector2(400.0 * speed_scale, -40)
@@ -204,5 +204,5 @@ func _shot_bullet() -> void:
func _spawn_enemy_above() -> void:
var enemy := Enemy.instantiate() as RigidBody2D
enemy.position = self.position + 50 * Vector2.UP
enemy.position = position + 50 * Vector2.UP
get_parent().add_child(enemy)