pickup item values are assigned through level editor and spawn correctly, now need to implement non random spawns
This commit is contained in:
@@ -10,6 +10,7 @@ extends Node3D
|
||||
@onready var cannonparticles = $cannonparticles
|
||||
@onready var cannon_dir = $RayCast3D
|
||||
@onready var fire_audio = $Audio/FireAudio
|
||||
@onready var level_control = get_tree().current_scene
|
||||
|
||||
var fire = true
|
||||
|
||||
@@ -33,12 +34,11 @@ func _on_timer_timeout():
|
||||
|
||||
# Shoot that shit
|
||||
var pickup_spawn = item_pickup.instantiate()
|
||||
var item_stats = level_control.pickup_spawn()
|
||||
##SET VARIABLES
|
||||
var type = randi_range(0,3)
|
||||
pickup_spawn.pickup_type = type
|
||||
if type == 0:
|
||||
pickup_spawn.ammo_type = randi_range(0,4)
|
||||
pickup_spawn.value = randi_range(1,10)
|
||||
pickup_spawn.pickup_type = item_stats["pickup_type"]
|
||||
pickup_spawn.ammo_type = item_stats["ammo_type"]
|
||||
pickup_spawn.value = item_stats["value"]
|
||||
|
||||
pickup_spawn.position = cannon_dir.global_position
|
||||
pickup_spawn.transform.basis = cannon_dir.global_transform.basis
|
||||
|
||||
Reference in New Issue
Block a user