This commit is contained in:
pennyrigate 2023-11-05 21:07:16 -05:00
parent dfc203fa41
commit 436c604849
5 changed files with 1533 additions and 0 deletions

View file

@ -0,0 +1,25 @@
extends Node2D
const Bullet = preload("res://objects/enemy/2600_bullet.tscn")
export var shot_speed: float = 50
export var fire_rate: float = 1
onready var bullet_positions = $"%BulletPositions"
onready var shoot_timer = $ShootTimer
onready var anims = $AnimationPlayer
onready var head_sprite = $"%Head"
func _input(event):
if Input.is_action_pressed("shoot"):
shoot()
func shoot():
Audio.play_sound(Audio.a_bullet_barrage,Audio.ac_boss)
for pos in bullet_positions.get_children():
var bullet = Bullet.instance()
bullet.global_position = pos.global_position
bullet.direction = Vector2.LEFT.rotated(pos.rotation)
bullet.speed = shot_speed
get_parent().add_child(bullet)
shoot_timer.wait_time = fire_rate

File diff suppressed because it is too large Load diff