Minor tweaks and bug fixes
This commit is contained in:
@@ -109,6 +109,8 @@ var pickupmsg
|
||||
@onready var crt_filter: ColorRect = $Head/Recoil/Camera3D/crtFilter
|
||||
@onready var moveable_holder: Node3D = $Head/MoveableHolder
|
||||
@onready var stand_check: RayCast3D = $StandCheck
|
||||
@onready var r_hand_test: MeshInstance3D = $Head/Recoil/Camera3D/WeaponHolder/RHandTest
|
||||
@onready var l_hand_test: MeshInstance3D = $Head/Recoil/Camera3D/WeaponHolder/LHandTest
|
||||
|
||||
|
||||
func _ready():
|
||||
@@ -160,6 +162,7 @@ func _physics_process(delta):
|
||||
if abs(velocity.y) >= .1:
|
||||
moving_fast = true
|
||||
|
||||
|
||||
# Handle jump.
|
||||
if Input.is_action_just_pressed("jump") and is_on_floor() and !is_climbing:
|
||||
velocity.y += JUMP_VELOCITY
|
||||
@@ -312,23 +315,28 @@ func _physics_process(delta):
|
||||
else:
|
||||
held_item_rotation.y -= deg_to_rad(45)
|
||||
|
||||
# Weapon Swap Number 1
|
||||
if Input.is_action_just_pressed("numb_1") and !gun.anim_player.is_playing():
|
||||
# Weapon Swap by Numbers
|
||||
if Input.is_action_just_pressed("numb_1"):
|
||||
weapon_select(0)
|
||||
|
||||
if Input.is_action_just_pressed("numb_2") and !gun.anim_player.is_playing():
|
||||
if Input.is_action_just_pressed("numb_2"):
|
||||
weapon_select(1)
|
||||
|
||||
if Input.is_action_just_pressed("numb_3") and !gun.anim_player.is_playing():
|
||||
if Input.is_action_just_pressed("numb_3"):
|
||||
weapon_select(2)
|
||||
|
||||
|
||||
if Input.is_action_just_pressed("numb_4") and !gun.anim_player.is_playing():
|
||||
if Input.is_action_just_pressed("numb_4"):
|
||||
weapon_select(3)
|
||||
|
||||
if Input.is_action_just_pressed("numb_5") and !gun.anim_player.is_playing():
|
||||
if Input.is_action_just_pressed("numb_5"):
|
||||
weapon_select(4)
|
||||
|
||||
if Input.is_action_just_pressed("numb_6"):
|
||||
weapon_select(5)
|
||||
if Input.is_action_just_pressed("numb_7"):
|
||||
weapon_select(6)
|
||||
if Input.is_action_just_pressed("numb_8"):
|
||||
weapon_select(7)
|
||||
if Input.is_action_just_pressed("numb_9"):
|
||||
weapon_select(8)
|
||||
if Input.is_action_just_pressed("numb_0"):
|
||||
weapon_select(9)
|
||||
|
||||
# Move Held Items
|
||||
if held_item != null:
|
||||
var held_force_dir = moveable_holder.global_position - held_item.global_position
|
||||
@@ -360,12 +368,10 @@ func _physics_process(delta):
|
||||
if interact_ray.is_colliding():
|
||||
if interact_ray.get_collider().is_in_group("scene_rigidbody"):
|
||||
kick_audio.play()
|
||||
interact_ray.get_collider().linear_velocity += transform.basis * Vector3(0,0, -KICK_AMOUNT)
|
||||
interact_ray.get_collider().linear_velocity += interact_ray.global_transform.basis * Vector3(0,0, -KICK_AMOUNT)
|
||||
if held_item != null:
|
||||
release_moveable()
|
||||
|
||||
|
||||
|
||||
if level_control.health <= 0:
|
||||
level_control.die()
|
||||
|
||||
@@ -391,7 +397,6 @@ func _on_pick_up_detection_body_entered(body):
|
||||
|
||||
|
||||
func ladder_collide(is_climbing):
|
||||
|
||||
if is_climbing == true:
|
||||
gravity = 0.0
|
||||
else:
|
||||
@@ -425,9 +430,10 @@ func weapon_bob(vel : float, delta):
|
||||
weapon_holder.position.x = lerp(weapon_holder.position.x, def_weapon_holder_pos.x, .1 * delta)
|
||||
|
||||
func weapon_select(gun_id):
|
||||
if level_control.held_guns.size() >= (gun_id + 1) and level_control.current_gun_index != gun_id:
|
||||
gun.anim_player.play("swap_out")
|
||||
level_control.gun_spawn(gun_id)
|
||||
if !gun.anim_player.is_playing():
|
||||
if level_control.held_guns.size() >= (gun_id + 1) and level_control.current_gun_index != gun_id:
|
||||
gun.anim_player.play("swap_out")
|
||||
level_control.gun_spawn(gun_id)
|
||||
|
||||
func enemy_hit():
|
||||
var hitmarker_spawn = hitmarker.instantiate()
|
||||
|
||||
Reference in New Issue
Block a user