did some tinkering with the hud
This commit is contained in:
@@ -29,8 +29,10 @@ gun_name = "blunderbus"
|
||||
gun_icon = ExtResource("4_sf1mx")
|
||||
path = "res://assets/blunderbus.tscn"
|
||||
weapon_type = 0
|
||||
reload_type = 0
|
||||
bullet = SubResource("Resource_gh6p6")
|
||||
fire_mode = 0
|
||||
hitscan_range = 100.0
|
||||
fov_zoom_amt = 0.98
|
||||
ads = false
|
||||
recoil_amount = Vector3(0.3, 0.05, 0.05)
|
||||
|
||||
@@ -240,7 +240,7 @@ offset_right = 0.0
|
||||
offset_bottom = 0.0
|
||||
|
||||
[node name="MoveableHolder" type="Node3D" parent="Head/Recoil/Camera3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.000759602, -1.79822)
|
||||
transform = Transform3D(1, -6.92921e-11, -5.23869e-10, 3.24007e-12, 1, 0, 5.23869e-10, 1.04774e-09, 1, -0.00028377, -0.710997, -1.11201)
|
||||
|
||||
[node name="MoveableRotation" type="Node3D" parent="Head/Recoil/Camera3D/MoveableHolder"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.73907)
|
||||
|
||||
@@ -14,6 +14,7 @@ weapon_type = 0
|
||||
reload_type = 1
|
||||
bullet = ExtResource("1_53e42")
|
||||
fire_mode = 1
|
||||
hitscan_range = 100.0
|
||||
fov_zoom_amt = 0.98
|
||||
ads = false
|
||||
recoil_amount = Vector3(0.05, 0.05, 0.05)
|
||||
|
||||
@@ -11,7 +11,7 @@ config_version=5
|
||||
[application]
|
||||
|
||||
config/name="First Person Test"
|
||||
run/main_scene="res://assets/blockout_2.tscn"
|
||||
run/main_scene="res://scenes/asset_checker.tscn"
|
||||
config/features=PackedStringArray("4.3", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
|
||||
@@ -72,8 +72,9 @@ func _process(delta: float) -> void:
|
||||
|
||||
if player != null:
|
||||
# Crosshair
|
||||
var velocity_adjust = clamp(player.velocity.length() * .1,1,3)
|
||||
crosshair_target = lerp(crosshair_target,CROSSHAIR_SIZE,delta * 5)
|
||||
crosshair.size = lerp(crosshair.size, crosshair_target,delta * 20)
|
||||
crosshair.size = lerp(crosshair.size, crosshair_target * velocity_adjust,delta * 20)
|
||||
crosshair.position = Vector2(viewportWidth/2,viewportHeight/2) + (crosshair.size/-2)
|
||||
crosshair_center.position = Vector2(viewportWidth/2,viewportHeight/2) + (crosshair_center.scale * crosshair_center.size/-2)
|
||||
stamina_bar.scale = (crosshair.size/CROSSHAIR_SIZE) * Vector2(.185,.185)
|
||||
@@ -218,5 +219,4 @@ func spawn_notifs():
|
||||
can_spawn = true
|
||||
|
||||
func player_hit():
|
||||
pass
|
||||
#self.position += wiggle_element(25)
|
||||
crosshair_size_change()
|
||||
|
||||
@@ -491,6 +491,7 @@ func _physics_process(delta):
|
||||
joypad_look()
|
||||
aim_down_sights(delta)
|
||||
flashlight_toggle()
|
||||
hud_wobble(delta)
|
||||
hold_item(delta)
|
||||
move_and_slide()
|
||||
crouch(delta)
|
||||
@@ -622,11 +623,19 @@ func grab_moveable(body):
|
||||
held_item.gravity_scale = 0
|
||||
held_item.set_collision_layer_value(1,false)
|
||||
|
||||
func hud_wobble(delta):
|
||||
const HUD_WOBBLE_MAX : float = 10
|
||||
const MOUSE_AMT = 0
|
||||
const VELOCITY_AMT = 10
|
||||
var dir = Vector2(-velocity.x * VELOCITY_AMT - mouse_input.x * MOUSE_AMT,velocity.y * VELOCITY_AMT - mouse_input.y * MOUSE_AMT)
|
||||
var dir_clamped = clamp(dir,Vector2(-HUD_WOBBLE_MAX,-HUD_WOBBLE_MAX),Vector2(HUD_WOBBLE_MAX,HUD_WOBBLE_MAX))
|
||||
hud.position = lerp(hud.position, dir_clamped, delta * 5)
|
||||
|
||||
func hold_item(_delta):
|
||||
# Move Held Items
|
||||
if held_item != null:
|
||||
interact_ray.look_at(held_item.global_position, Vector3.UP)
|
||||
var held_dir = (moveable_holder.global_position - held_item.global_position) #+ hold_offset
|
||||
var held_dir = (moveable_holder.global_position - held_item.global_position)
|
||||
held_item.linear_velocity = held_dir * 50
|
||||
held_item.rotation = Vector3(0,held_item_rotation,0) + Vector3(0,camera.global_rotation.y,0)
|
||||
#break when moved too far away
|
||||
|
||||
Reference in New Issue
Block a user