minor tweaks from last
This commit is contained in:
@@ -86,7 +86,8 @@ func shoot(player,delta):
|
||||
if !anim_player.is_playing():
|
||||
level_control.ammo_current[gun_index] -= 1
|
||||
#RECOIL --- fix later to happen over a period of time
|
||||
player.camera.rotation.x = clamp(lerp(player.camera.rotation.x, player.camera.rotation.x + recoil_amount, delta * 10), deg_to_rad(-90), deg_to_rad(60))
|
||||
#player.camera.rotation.x = clamp(lerp(player.camera.rotation.x, player.camera.rotation.x + recoil_amount, delta * 10), deg_to_rad(-90), deg_to_rad(60))
|
||||
player.weapon_recoil(delta)
|
||||
#(ADD PLAYER KICK HERE. RELATIVE TO GUN POSITION)
|
||||
audio_fire.pitch_scale = 1 + rng.randf_range(-fire_pitch_scale_amt,fire_pitch_scale_amt)
|
||||
audio_fire.play()
|
||||
|
||||
@@ -246,11 +246,6 @@ func weapon_sway(delta):
|
||||
weapon_holder.rotation.x = lerp(weapon_holder.rotation.x, mouse_input.y * weapon_rotation_amount, 5 * delta)
|
||||
weapon_holder.rotation.y = lerp(weapon_holder.rotation.y, mouse_input.x * weapon_rotation_amount, 5 * delta)
|
||||
|
||||
#crosshair.position.x = lerp(crosshair.position.x, mouse_input.x * 100, 2 * delta)
|
||||
|
||||
#crosshair.size.x = lerp(crosshair.size.x, clamp((abs(mouse_input.x * 10) + abs(mouse_input.y) * 1000),0.0,100.0), 1 * delta)
|
||||
#crosshair.size.y = lerp(crosshair.size.y, clamp((abs(mouse_input.x * 10) + abs(mouse_input.y) * 1000),0.0,100.0), 1 * delta)
|
||||
|
||||
func weapon_bob(vel : float, delta):
|
||||
if weapon_holder:
|
||||
if vel > 2 and is_on_floor():
|
||||
@@ -261,3 +256,7 @@ func weapon_bob(vel : float, delta):
|
||||
else:
|
||||
weapon_holder.position.y = lerp(weapon_holder.position.y, def_weapon_holder_pos.y, .1 * delta)
|
||||
weapon_holder.position.x = lerp(weapon_holder.position.x, def_weapon_holder_pos.x, .1 * delta)
|
||||
|
||||
func weapon_recoil(delta):
|
||||
var recoil_to = camera.rotation.x + gun.recoil_amount
|
||||
camera.rotation.x = clamp(lerp(camera.rotation.x,recoil_to, delta * 10), deg_to_rad(-90), deg_to_rad(60))
|
||||
|
||||
Reference in New Issue
Block a user