major rework on pickups, hud now shows the number and icon of pickup

This commit is contained in:
derek
2025-01-16 17:04:13 -06:00
parent ad89e9813c
commit 5c6f010fdc
30 changed files with 1134 additions and 59 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://sejtwkyo0gud"
path="res://.godot/imported/health.png-575c2a7a539cccc3e9e8faf465448f98.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Textures/ObjectTextures/health.png"
dest_files=["res://.godot/imported/health.png-575c2a7a539cccc3e9e8faf465448f98.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b78u3lgx12beh"
path="res://.godot/imported/light_ammo.png-ecedb7822d9b26f07643f77fa25aeaea.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Textures/ObjectTextures/light_ammo.png"
dest_files=["res://.godot/imported/light_ammo.png-ecedb7822d9b26f07643f77fa25aeaea.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bt6utik8unkxa"
path="res://.godot/imported/money.png-0c7bd269242ca0e7919fce1578029628.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Textures/ObjectTextures/money.png"
dest_files=["res://.godot/imported/money.png-0c7bd269242ca0e7919fce1578029628.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cmnhd40dvn3l3"
path="res://.godot/imported/rocket.png-f48667c8e74138b1121c9aaa249e2648.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Textures/ObjectTextures/rocket.png"
dest_files=["res://.godot/imported/rocket.png-f48667c8e74138b1121c9aaa249e2648.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dcyt3k3jl6ick"
path="res://.godot/imported/stamina.png-abaab6a291d46ce1aecf01bde6dd6d30.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Textures/ObjectTextures/stamina.png"
dest_files=["res://.godot/imported/stamina.png-abaab6a291d46ce1aecf01bde6dd6d30.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

329
assets/item_pickup.tscn Normal file

File diff suppressed because one or more lines are too long

View File

@@ -235,7 +235,7 @@ points = PackedVector3Array(-0.899645, -0.235985, -0.176739, 0.797351, 0.356305,
[sub_resource type="SphereShape3D" id="SphereShape3D_87tum"]
radius = 1.26183
[node name="mac10_pickup" type="RigidBody3D" node_paths=PackedStringArray("collision_shape") groups=["pickup"]]
[node name="mac10_pickup" type="RigidBody3D" node_paths=PackedStringArray("collision_shape") groups=["pickup", "weapon_pickup"]]
collision_layer = 17
collision_mask = 17
script = ExtResource("1_46utd")

View File

@@ -702,7 +702,7 @@ audio_empty = NodePath("Audio/Empty")
audio_reload = NodePath("Audio/Reload")
[node name="mac10" parent="." index="0"]
transform = Transform3D(-1.08301e-06, -8.05106e-08, -0.3, -0.0225093, 0.299154, 9.75562e-10, 0.299154, 0.0225093, -1.086e-06, -0.00876398, 0.0748287, -0.0557729)
transform = Transform3D(-1.08301e-06, -8.05104e-08, -0.3, -0.0225093, 0.299154, 9.75766e-10, 0.299154, 0.0225093, -1.086e-06, -0.00876398, 0.0748287, -0.0557729)
cast_shadow = 0
lod_bias = 10.0
mesh = SubResource("ArrayMesh_pcg38")

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,46 @@
[gd_scene load_steps=4 format=3 uid="uid://x3uwmwbobkoy"]
[ext_resource type="Script" path="res://scripts/pickup_item_indicator.gd" id="1_3ji4d"]
[ext_resource type="Texture2D" uid="uid://cmnhd40dvn3l3" path="res://assets/Textures/ObjectTextures/rocket.png" id="1_xksdo"]
[ext_resource type="Theme" uid="uid://buma708jpxqrn" path="res://Clean_theme.tres" id="3_etc64"]
[node name="PickupItemIndicator" type="Control"]
z_index = -1
layout_mode = 3
anchors_preset = 0
offset_right = 250.0
offset_bottom = 250.0
script = ExtResource("1_3ji4d")
[node name="image" type="TextureRect" parent="."]
layout_mode = 2
offset_left = -226.0
offset_top = -131.0
offset_right = 286.0
offset_bottom = 381.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 4
texture = ExtResource("1_xksdo")
[node name="Label" type="Label" parent="image"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -100.0
offset_top = -42.0
offset_right = 86.0
offset_bottom = 63.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
theme = ExtResource("3_etc64")
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 19
theme_override_font_sizes/font_size = 100
text = "999"
horizontal_alignment = 1

View File

@@ -1460,10 +1460,12 @@ transform = Transform3D(4.17223e-07, 5.99699e-19, 2.10229, -2.98023e-07, -2.1022
transform = Transform3D(4.17223e-07, 7.04731e-19, 2.10229, -2.98023e-07, -2.10229, -5.96046e-08, 2.1023, -2.38418e-07, -2.98033e-07, 0.126097, 0.1392, -0.0677698)
[node name="hammer" parent="revolver1" index="1"]
cast_shadow = 0
mesh = SubResource("ArrayMesh_0w43n")
[node name="Trigger" parent="revolver1" index="2"]
transform = Transform3D(0.207537, -0.978227, 4.27597e-08, 0, -4.37114e-08, -1, 0.978227, 0.207537, -9.07173e-09, 0.226752, 0, -0.00209358)
cast_shadow = 0
mesh = SubResource("ArrayMesh_ahftj")
[node name="flare" type="MeshInstance3D" parent="revolver1" index="3"]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -161,6 +161,7 @@ layout_mode = 2
theme = ExtResource("1_22trs")
theme_type_variation = &"TextShadow"
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 15
text = "Gun Name"
horizontal_alignment = 2
@@ -174,17 +175,19 @@ alignment = 2
[node name="AmmoCurrent" type="Label" parent="GunInfo/VBoxContainer/HBoxContainer"]
layout_mode = 2
theme = ExtResource("1_22trs")
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 15
text = "XXX"
horizontal_alignment = 2
[node name="Label" type="Label" parent="GunInfo/VBoxContainer/HBoxContainer"]
layout_mode = 2
theme_override_constants/outline_size = 15
text = "-"
[node name="AmmoReserve" type="Label" parent="GunInfo/VBoxContainer/HBoxContainer"]
layout_mode = 2
theme = ExtResource("1_22trs")
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 15
text = "YYY"
horizontal_alignment = 2

View File

@@ -57,6 +57,7 @@ spawned=""
persist=""
breakable=""
leak="will leak if damaged"
item_pickup=""
[input]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=25 format=3 uid="uid://breenfpt04iua"]
[gd_scene load_steps=26 format=3 uid="uid://breenfpt04iua"]
[ext_resource type="Script" path="res://scripts/LevelManager.gd" id="1_8g3mj"]
[ext_resource type="PackedScene" uid="uid://xerc06hjfnbf" path="res://assets/LevelBlockouts/blockout4.blend" id="1_038d8"]
@@ -20,6 +20,7 @@
[ext_resource type="PackedScene" uid="uid://dyu46bns8mesv" path="res://assets/mac10_pickup.tscn" id="18_c33jr"]
[ext_resource type="PackedScene" uid="uid://dws4iro7820fc" path="res://assets/pistol1_pickup.tscn" id="19_1o424"]
[ext_resource type="PackedScene" uid="uid://clu76sc4uoswn" path="res://assets/rocketlauncher_pickup.tscn" id="20_4cdch"]
[ext_resource type="PackedScene" uid="uid://dws2vwfxubqvb" path="res://assets/cannon.tscn" id="21_24v0y"]
[sub_resource type="Environment" id="Environment_q4t3f"]
ssr_enabled = true
@@ -34,7 +35,7 @@ fog_density = 0.0005
[sub_resource type="ShaderMaterial" id="ShaderMaterial_sc3mk"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hs00l"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_tk3rh"]
render_priority = 0
next_pass = SubResource("ShaderMaterial_sc3mk")
shader = ExtResource("17_s06ug")
@@ -51,7 +52,7 @@ shader_parameter/grazing_angle_mask_power = 1.0
shader_parameter/grazing_angle_modulation_factor = 50.0
[sub_resource type="QuadMesh" id="QuadMesh_nmuj5"]
material = SubResource("ShaderMaterial_hs00l")
material = SubResource("ShaderMaterial_tk3rh")
flip_faces = true
size = Vector2(2, 2)
@@ -673,3 +674,9 @@ transform = Transform3D(0.44329, 0.896378, 0, -0.896378, 0.44329, 0, 0, 0, 1, -2
[node name="rocketlauncher1_pickup" parent="." instance=ExtResource("20_4cdch")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -17.4244, 1.087, -30.9826)
[node name="cannon" parent="." instance=ExtResource("21_24v0y")]
transform = Transform3D(0.978792, -0.185004, 0.0879728, 0, 0.42944, 0.903096, -0.204855, -0.883943, 0.420332, 31.5816, 0.696903, -7.64441)
CANNON_MIN_POWER = 20
CANNON_MAX_POWER = 50
TIMER_MAX = 1.0

View File

@@ -2,24 +2,15 @@ extends Node3D
@export var CANNON_MIN_POWER = 7
@export var CANNON_MAX_POWER = 20
@export var TIMER_MIN = 0
@export var TIMER_MAX = 20
@export var stamina : Resource
@export var ammo : Resource
@export var jump : Resource
@export var money : Resource
@export var TIMER_MIN = 0.0
@export var TIMER_MAX = 20.0
@onready var item_pickup = preload("res://assets/item_pickup.tscn")
@onready var timer = $Timer
@onready var cannonparticles = $cannonparticles
@onready var cannon_dir = $RayCast3D
@onready var fire_audio = $Audio/FireAudio
var rand_item
var rand_select
var rng = RandomNumberGenerator.new()
var rand_rot_y
var fire = true
@@ -34,27 +25,23 @@ func _process(delta):
func _on_timer_timeout():
# Random Variables
var lv_y = rng.randf_range(CANNON_MIN_POWER,CANNON_MAX_POWER)
var rand_selector = int(round(rng.randf_range(1,3)))
var rand_timer = rng.randf_range(TIMER_MIN,TIMER_MAX)
match rand_selector:
1:
rand_select = stamina
2:
rand_select = ammo
3:
rand_select = money
var lv_y = randf_range(CANNON_MIN_POWER,CANNON_MAX_POWER)
var rand_timer = randf_range(TIMER_MIN,TIMER_MAX)
# Reset Timer
timer.wait_time = rand_timer #rand_timer
# Shoot that shit
rand_item = rand_select.instantiate()
rand_item.position = cannon_dir.global_position
rand_item.transform.basis = cannon_dir.global_transform.basis
rand_item.linear_velocity += cannon_dir.global_transform.basis * Vector3(0,lv_y,0)
#cannonparticles.emitting = true
#fir_audio.pitch_scale =
var pickup_spawn = item_pickup.instantiate()
##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.position = cannon_dir.global_position
pickup_spawn.transform.basis = cannon_dir.global_transform.basis
pickup_spawn.linear_velocity += cannon_dir.global_transform.basis * Vector3(0,lv_y,0)
fire_audio.play()
get_parent().add_child(rand_item)
get_parent().add_child(pickup_spawn)

View File

@@ -26,6 +26,7 @@ var crosshair_target
@onready var money: Label = $Money
@onready var crosshair: TextureRect = $Crosshair
@onready var crosshair_center: TextureRect = $CrosshairCenter
@onready var pickup_item_indicator = preload("res://assets/pickup_item_indicator.tscn")
const FULL_WHITE = Color(1, 1, 1, 1)
const TRANSPARENT = Color(1, 1, 1, 0)
@@ -36,6 +37,9 @@ const GREEN_COLOR = Color(0, 0.608, 0.172)
const STAM_BAR_MAX_OPACITY = 1.0
const CROSSHAIR_SIZE = Vector2(40,40)
var pickup_notifs = []
var can_spawn = true
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
# Get Viewport size
@@ -62,6 +66,7 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
player = level_control.player
if player != null:
# Crosshair
crosshair_target = lerp(crosshair_target,CROSSHAIR_SIZE,delta * 5)
@@ -157,6 +162,9 @@ func _process(delta: float) -> void:
## FADE ELEMENTS IN AND OUT
fade_in_out(current_stam_bar,STAM_BAR_MAX_OPACITY,stam_bar_visible,5,delta)
## SPAWN NOTIFICATIONS
spawn_notifs()
func crosshair_size_change():
crosshair_target += Vector2(20,20)
@@ -184,6 +192,23 @@ func fade_in_out(element,MAX_OPACITY,visible,speed,delta):
else:
element.modulate = lerp(element_color, Color(element_color.r,element_color.g,element_color.b,0),(delta * speed)/Engine.time_scale)
func pick_up_notif(type,ammo_type,value):
var pickup_notif = pickup_item_indicator.instantiate()
pickup_notif.pickup_type = type
pickup_notif.ammo_type = ammo_type
pickup_notif.value = value
pickup_notif.position = money.position + Vector2(150,-50)
pickup_notif.scale = Vector2(1,1)
pickup_notifs.append(pickup_notif)
func spawn_notifs():
if pickup_notifs.size() > 0 and can_spawn:
can_spawn = false
var msg = pickup_notifs.pop_front()
add_child(msg)
await get_tree().create_timer(.2).timeout
can_spawn = true
func player_hit():
pass
#self.position += wiggle_element(25)

100
scripts/item_pickup_v2.gd Normal file
View File

@@ -0,0 +1,100 @@
extends RigidBody3D
var despawning = false
var despawn_time_s = 10
var value
@export_enum("Ammo", "Stamina", "Health", "Money","Weapon") var pickup_type: int
var ammo_type
@onready var collision_shape: CollisionShape3D = $CollisionShape3D2
@onready var timer: Timer = $Timer
## MESHES
#AMMO
@onready var light_ammo: MeshInstance3D = $Meshes/Ammo/light_ammo
@onready var rocket: MeshInstance3D = $Meshes/Ammo/rocket
@onready var stamina: MeshInstance3D = $Meshes/stamina
@onready var health: MeshInstance3D = $Meshes/health
@onready var money: Node3D = $Meshes/money
var magnetable = true #false
var pickupable = false
var pick_up = false
var rand_amt
var player_follow
var player
# Called when the node enters the scene tree for the first time.
func _ready():
add_to_group("spawned")
add_to_group("persist")
#Enable mesh
match pickup_type:
0:
match ammo_type:
0:
light_ammo.visible = true
1:
light_ammo.visible = true #medium
2:
light_ammo.visible = true #heavy
3:
light_ammo.visible = true #shotgun
4:
rocket.visible = true #rocket
1:
stamina.visible = true
2:
health.visible = true
3:
money.visible = true
if despawning == true:
timer.wait_time = despawn_time_s
timer.start()
func _physics_process(delta):
if player_follow != null:
if !pick_up:
despawning = false
angular_velocity = lerp(angular_velocity, Vector3(0,0,0), delta)
position = lerp(position, player.item_holder.global_position, 25 * delta)
if abs(position - player.item_holder.global_position) < Vector3(.5,.5,.5):
await get_tree().create_timer(1).timeout
position = lerp(position, player.camera.global_position, .01 * delta)
await get_tree().create_timer(.01).timeout
player.pickup_apply(pickup_type,ammo_type,value)
queue_free()
func _on_timer_timeout() -> void:
if despawning == true:
collision_shape.disabled = true
await get_tree().create_timer(1).timeout
self.queue_free()
func save():
var save_dict = {
"filename" : get_scene_file_path(),
"parent" : get_parent().get_path(),
"pos_x" : position.x,
"pos_y" : position.y,
"pos_z" : position.z,
"rot_x" : rotation.x,
"rot_y" : rotation.y,
"rot_z" : rotation.z,
"pickup_type" : pickup_type,
"ammo_type" : ammo_type,
"value" : value
}
return save_dict
func _on_magnet_timer_timeout() -> void:
magnetable = true

View File

@@ -0,0 +1,66 @@
extends Control
@onready var image: TextureRect = $image
@onready var label: Label = $image/Label
## ITEM TEXTURES
#AMMO
const LIGHT_AMMO = preload("res://assets/Textures/ObjectTextures/light_ammo.png")
const ROCKET = preload("res://assets/Textures/ObjectTextures/rocket.png")
const MONEY = preload("res://assets/Textures/ObjectTextures/money.png")
const HEALTH = preload("res://assets/Textures/ObjectTextures/health.png")
const STAMINA = preload("res://assets/Textures/ObjectTextures/stamina.png")
var pickup_type
var ammo_type
var value
var random_point
var alpha_amt : float = 1.0
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
random_point = get_random_point()
match pickup_type:
0:
match ammo_type:
0:
image.texture = LIGHT_AMMO
1:
image.texture = LIGHT_AMMO #medium
2:
image.texture = LIGHT_AMMO #heavy
3:
image.texture = LIGHT_AMMO #shotgun
4:
image.texture = ROCKET
1:
image.texture = STAMINA
2:
image.texture = HEALTH
3:
image.texture = MONEY
if pickup_type == 3:
label.text = str("$",value)
else:
label.text = str(value)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
alpha_amt = lerp(alpha_amt, 0.0,delta * 1)
modulate = Color(1, 1, 1, alpha_amt)
position += random_point * delta * 2
scale -= Vector2(.2,.2) * delta
if alpha_amt <= .01:
queue_free()
func get_random_point():
var x_pos = randf_range(-50,50)
var y_pos = randf_range(-250,-300)
return Vector2(x_pos,y_pos)

View File

@@ -621,18 +621,41 @@ func add_ammo(new_gun,gun_name,ammo_type,max_ammo,start_mags):
func _on_pick_up_detection_body_entered(body):
if body.is_in_group("pickup"):
if body.pickupable:
body.picked_up()
if body.is_in_group("item_pickup"):
pass
#if body.pickupable:
#pickup_apply(body.pickup_type,body.ammo_type,body.value)
if body.is_in_group("weapon_pickup"):
body.picked_up()
weapon_pickup_audio.play()
Input.start_joy_vibration(0,.1,.1,.1)
func _on_pick_up_magnet_body_entered(body):
if body.is_in_group("pickup") and body.is_in_group("magnet"):
if body.is_in_group("item_pickup") and body.is_in_group("magnet"):
if body.magnetable == true:
body.player_follow = self
body.player = self
body.collision_shape.disabled = true
func pickup_apply(type,ammo_type,value):
pickup_sound.play()
Input.start_joy_vibration(0,.1,.1,.1)
hud.pick_up_notif(type,ammo_type,value)
match type:
0: #AMMO
if ammo_reserve.has(str(ammo_type)):
ammo_reserve[str(ammo_type)] += value
else:
ammo_reserve[str(ammo_type)] = value
1: #STAMINA
remaining_stamina = clamp(remaining_stamina + value,0,100)
2: #HEALTH
level_control.health += value
3: #MONEY
level_control.money += value
func weapon_tilt(input_x, delta):
if !ads:
if weapon_holder: