ammo working through weapon manager
This commit is contained in:
@@ -2,20 +2,20 @@ extends Label
|
||||
|
||||
const ASPECT_RATIO_STD = .5625 #9/16 for standard ratio
|
||||
@export var padding_amount = .05 #multiplied by screen size
|
||||
|
||||
@onready var level_control = $"../../../.."
|
||||
@onready var player = $"../../.."
|
||||
@onready var gun_anim = $"../gun/GunAnims"
|
||||
|
||||
var gun_index
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
var viewportWidth = get_viewport().size.x
|
||||
var viewportHeight = get_viewport().size.y
|
||||
var viewportHeightAdjusted = viewportWidth * ASPECT_RATIO_STD
|
||||
|
||||
gun_index = 0
|
||||
size = Vector2(viewportWidth - (padding_amount * viewportWidth), viewportHeight - (padding_amount * viewportHeightAdjusted))
|
||||
position = Vector2(0 - (padding_amount * viewportWidth) ,0 - (padding_amount * viewportHeightAdjusted))
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
text = "Ammo: " + str(player.ammo) +" " + str(player.ammo_reserve)
|
||||
text = "Ammo: " + str(level_control.ammo_current[gun_index]) +" " + str(level_control.ammo_reserve[gun_index])
|
||||
|
||||
Reference in New Issue
Block a user