initial commit

This commit is contained in:
Derek
2024-07-14 13:13:05 -05:00
commit 9241836cf4
309 changed files with 15043 additions and 0 deletions

21
scripts/AmmoCounter.gd Normal file
View File

@@ -0,0 +1,21 @@
extends Label
const ASPECT_RATIO_STD = .5625 #9/16 for standard ratio
@export var padding_amount = .05 #multiplied by screen size
@onready var player = $"../../.."
@onready var gun_anim = $"../gun/GunAnims"
# 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
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)