instancing start gun and assigned ammo to array

This commit is contained in:
derek
2024-07-15 12:16:54 -05:00
parent a18fb55e8d
commit 4da08f3df5
4 changed files with 39 additions and 19 deletions

View File

@@ -36,13 +36,16 @@ var cycle_count
@onready var player = $"../../../../"
var rng = RandomNumberGenerator.new()
var level_control
# Called when the node enters the scene tree for the first time.
func _ready():
start_position = self.position
start_rotation = self.rotation
random_spread_start = random_spread_amt
level_control = get_tree().get_root()
if fire_mode == 0:
cycle_count = 1
cycle_count_start = 1
@@ -103,7 +106,7 @@ func shoot(player,delta):
instance_casing.transform.basis = casing_ejector.global_transform.basis
get_tree().get_root().add_child(instance_casing)
if fire_mode == 1 or fire_mode == 2:
if fire_mode != 0:
cycle_count -= 1
elif !anim_player.is_playing() and cycle_count != 0: