Invader can no longer shoot itself (hopefully)

This commit is contained in:
2024-05-16 13:43:51 -04:00
parent fed245fee2
commit 0b22409369
2 changed files with 29 additions and 28 deletions

View File

@ -32,7 +32,7 @@ func _process(delta: float) -> void:
if can_shoot:
# FIXME: Proper shoot angle and not able to sudoku
shoot($GunMarker.global_position, randf_range(90.0, 100.0))
shoot($GunMarker.global_position, randf_range(90.0, 92.0))
# "Die", if off screen
if position.x > viewport_size.x or position.x < 0:
@ -54,6 +54,7 @@ func shoot(pos : Vector2, rot : float) -> void:
var bullet := BULLET.instantiate()
bullet.position = pos
bullet.rotation = rot
bullet.life_span = 0.3
$Projectiles.add_child(bullet)
$ShootSound.play()
can_shoot = false