Added slight weapon bounce, and more machete tweaks

This commit is contained in:
derek
2025-01-29 15:35:21 -06:00
parent 211b27e87b
commit f5546531a5
4 changed files with 25 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
extends CharacterBody3D
const JUMP_VELOCITY = 5
const JUMP_WEAPON_DIP = Vector3(0,-5,0)
const WALK_TRANSITION_SPEED = 7
const MAX_AIR_DASH = 1
const FLASHLIGHT_BRIGHTNESS = 30
@@ -79,6 +80,7 @@ var bullet_damage
var def_weapon_holder_pos : Vector3
var weapon_holder_start_rot
var weapon_holder_start_pos
var weapon_dip_pos = Vector3(0,0,0)
var gun_folded = false
var recoiling_fade = 0
var bullet_destination
@@ -214,6 +216,7 @@ func _physics_process(delta):
# Handle jump.
if Input.is_action_just_pressed("jump") and is_on_floor() and !is_climbing:
velocity.y += JUMP_VELOCITY
weapon_dip_pos += JUMP_WEAPON_DIP
crouched = false
elif Input.is_action_just_pressed("jump") and double_jump == true and !is_climbing:
velocity.y += JUMP_VELOCITY
@@ -705,6 +708,7 @@ func weapon_sway(delta):
func weapon_bob(vel : float, delta):
if weapon_holder:
weapon_holder.global_position.y += -clamp(velocity.y * .15,-1,1) * delta
if vel > 2 and is_on_floor():
var speed_adjust = speed/WALK_SPEED
var bob_amount : float = 0.05