tweaked crouch slide
This commit is contained in:
@@ -897,7 +897,6 @@ _data = {
|
|||||||
[node name="BLOCKOUT2Test" type="Node3D" node_paths=PackedStringArray("player")]
|
[node name="BLOCKOUT2Test" type="Node3D" node_paths=PackedStringArray("player")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.016016, 0.0225029, -0.0192337)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.016016, 0.0225029, -0.0192337)
|
||||||
script = ExtResource("1_sbpvn")
|
script = ExtResource("1_sbpvn")
|
||||||
load_save = false
|
|
||||||
player = NodePath("Player")
|
player = NodePath("Player")
|
||||||
money = 50
|
money = 50
|
||||||
start_health = 5
|
start_health = 5
|
||||||
|
|||||||
@@ -233,12 +233,11 @@ points = PackedVector3Array(1.08763, -0.139178, -0.0800532, 1.08763, 0.175986, 0
|
|||||||
[sub_resource type="SphereShape3D" id="SphereShape3D_87tum"]
|
[sub_resource type="SphereShape3D" id="SphereShape3D_87tum"]
|
||||||
radius = 1.26183
|
radius = 1.26183
|
||||||
|
|
||||||
[node name="blunderbuss_pickup" type="RigidBody3D" node_paths=PackedStringArray("collision_shape") groups=["pickup", "weapon_pickup"]]
|
[node name="blunderbuss_pickup" type="RigidBody3D" groups=["pickup", "weapon_pickup"]]
|
||||||
collision_layer = 17
|
collision_layer = 17
|
||||||
collision_mask = 17
|
collision_mask = 17
|
||||||
script = ExtResource("1_jhhxn")
|
script = ExtResource("1_jhhxn")
|
||||||
gun_resource = ExtResource("2_lnwhe")
|
gun_resource = ExtResource("2_lnwhe")
|
||||||
collision_shape = NodePath("")
|
|
||||||
|
|
||||||
[node name="Blunderbus" type="MeshInstance3D" parent="."]
|
[node name="Blunderbus" type="MeshInstance3D" parent="."]
|
||||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0.132498)
|
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0.132498)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=48 format=4 uid="uid://f7e0v1r6ra6c"]
|
[gd_scene load_steps=51 format=4 uid="uid://f7e0v1r6ra6c"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/LevelManager.gd" id="1_saj4q"]
|
[ext_resource type="Script" path="res://scripts/LevelManager.gd" id="1_saj4q"]
|
||||||
[ext_resource type="PackedScene" uid="uid://b5eclfg0cmmal" path="res://assets/revolver_1.tscn" id="2_ntm2q"]
|
[ext_resource type="PackedScene" uid="uid://b5eclfg0cmmal" path="res://assets/revolver_1.tscn" id="2_ntm2q"]
|
||||||
@@ -27,6 +27,9 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://c7vrpfdh603kr" path="res://assets/bottle_1.tscn" id="25_fk5nr"]
|
[ext_resource type="PackedScene" uid="uid://c7vrpfdh603kr" path="res://assets/bottle_1.tscn" id="25_fk5nr"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c6bpysq1tjhy4" path="res://vendingmahcine.tscn" id="26_rsia7"]
|
[ext_resource type="PackedScene" uid="uid://c6bpysq1tjhy4" path="res://vendingmahcine.tscn" id="26_rsia7"]
|
||||||
[ext_resource type="PackedScene" uid="uid://8cwmkiwcoaji" path="res://terrain1.tscn" id="27_hlma7"]
|
[ext_resource type="PackedScene" uid="uid://8cwmkiwcoaji" path="res://terrain1.tscn" id="27_hlma7"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dyu46bns8mesv" path="res://assets/mac10_pickup.tscn" id="28_x7033"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cucqbjb8bcha5" path="res://assets/blunderbuss_pickup.tscn" id="29_kr1fy"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://clu76sc4uoswn" path="res://assets/rocketlauncher_pickup.tscn" id="30_msqcq"]
|
||||||
|
|
||||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_py8au"]
|
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_py8au"]
|
||||||
|
|
||||||
@@ -307,8 +310,6 @@ shadow_mesh = SubResource("ArrayMesh_7g1e1")
|
|||||||
script = ExtResource("1_saj4q")
|
script = ExtResource("1_saj4q")
|
||||||
load_save = false
|
load_save = false
|
||||||
player = NodePath("Player")
|
player = NodePath("Player")
|
||||||
gun_1 = ExtResource("2_ntm2q")
|
|
||||||
gun_2 = ExtResource("12_d3sh8")
|
|
||||||
|
|
||||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||||
environment = SubResource("Environment_tngkl")
|
environment = SubResource("Environment_tngkl")
|
||||||
@@ -524,3 +525,12 @@ transform = Transform3D(0.0288986, 0, 0.999582, 0, 1, 0, -0.999582, 0, 0.0288986
|
|||||||
|
|
||||||
[node name="Terrain" parent="." instance=ExtResource("27_hlma7")]
|
[node name="Terrain" parent="." instance=ExtResource("27_hlma7")]
|
||||||
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 1001.46, -70.327, 173.409)
|
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 1001.46, -70.327, 173.409)
|
||||||
|
|
||||||
|
[node name="mac10_pickup" parent="." instance=ExtResource("28_x7033")]
|
||||||
|
transform = Transform3D(0.735482, -0.677544, 0, 0.677544, 0.735482, 0, 0, 0, 1, 9.33994, 3.7532, 15.9239)
|
||||||
|
|
||||||
|
[node name="blunderbuss_pickup" parent="." instance=ExtResource("29_kr1fy")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 39.0626, 0.909491, 22.5097)
|
||||||
|
|
||||||
|
[node name="rocketlauncher1_pickup" parent="." instance=ExtResource("30_msqcq")]
|
||||||
|
transform = Transform3D(-0.136113, 0, 0.990693, 0, 1, 0, -0.990693, 0, -0.136113, 35.3662, 0.662383, 22.6891)
|
||||||
|
|||||||
@@ -71,14 +71,18 @@ func _process(delta: float) -> void:
|
|||||||
stam_bar_visible = true
|
stam_bar_visible = true
|
||||||
current_stam_bar.value = player.remaining_stamina
|
current_stam_bar.value = player.remaining_stamina
|
||||||
|
|
||||||
ammo.text = str(level_control.ammo_current[level_control.current_gun_index]) +" | " + str(level_control.ammo_reserve[level_control.current_gun_index])
|
if player.gun != null:
|
||||||
|
ammo.text = str(level_control.ammo_current[level_control.current_gun_index]) +" | " + str(level_control.ammo_reserve[level_control.current_gun_index])
|
||||||
|
lerp_color(ammo,RED_COLOR,FULL_WHITE,level_control.ammo_current[level_control.current_gun_index],player.gun.max_ammo,.5)
|
||||||
|
else:
|
||||||
|
fade_in_out(ammo,1,false,10,delta)
|
||||||
|
fade_in_out(crosshair,1,false,10,delta)
|
||||||
|
|
||||||
if player.gun != null:
|
if player.gun != null:
|
||||||
gun_name.text = player.gun.gun_name
|
gun_name.text = player.gun.gun_name
|
||||||
else:
|
else:
|
||||||
gun_name.visible = false
|
gun_name.visible = false
|
||||||
|
|
||||||
lerp_color(ammo,RED_COLOR,FULL_WHITE,level_control.ammo_current[level_control.current_gun_index],player.gun.max_ammo,.5)
|
|
||||||
|
|
||||||
if player.remaining_stamina < 25:
|
if player.remaining_stamina < 25:
|
||||||
change_color(current_stam_bar,RED_COLOR,10,delta)
|
change_color(current_stam_bar,RED_COLOR,10,delta)
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const STAND_POS = Vector3(0,0.889,0)
|
|||||||
const SLOWSPEED = .1
|
const SLOWSPEED = .1
|
||||||
const MAX_STAMINA : float = 100
|
const MAX_STAMINA : float = 100
|
||||||
const STAMINA_DRAIN = 20
|
const STAMINA_DRAIN = 20
|
||||||
|
const HEAD_TILT_AMT = .06
|
||||||
const BOB_FREQ = 1.7
|
const BOB_FREQ = 1.7
|
||||||
const BOB_AMP = 0.1
|
const BOB_AMP = 0.1
|
||||||
const ADS_POS = Vector3(0,-.05,-.45)
|
const ADS_POS = Vector3(0,-.05,-.45)
|
||||||
@@ -228,10 +229,11 @@ func _physics_process(delta):
|
|||||||
else:
|
else:
|
||||||
crouched = !crouched
|
crouched = !crouched
|
||||||
recoil.add_recoil(Vector3(.2,0,0),5,10)
|
recoil.add_recoil(Vector3(.2,0,0),5,10)
|
||||||
crouch_audio.play()
|
|
||||||
velocity.y -= 15
|
|
||||||
if is_on_floor():
|
if is_on_floor():
|
||||||
|
crouch_audio.play()
|
||||||
velocity += direction * 20
|
velocity += direction * 20
|
||||||
|
else:
|
||||||
|
velocity.y -= 15
|
||||||
|
|
||||||
#walking
|
#walking
|
||||||
if is_on_floor() and !is_climbing:
|
if is_on_floor() and !is_climbing:
|
||||||
@@ -454,8 +456,10 @@ func _headbob(time) -> Vector3:
|
|||||||
var pos = Vector3.ZERO
|
var pos = Vector3.ZERO
|
||||||
pos.y = sin(time * BOB_FREQ) * BOB_AMP
|
pos.y = sin(time * BOB_FREQ) * BOB_AMP
|
||||||
pos.x = cos(time * BOB_FREQ / 2) * BOB_AMP
|
pos.x = cos(time * BOB_FREQ / 2) * BOB_AMP
|
||||||
|
|
||||||
if pos.y >= .07 and is_on_floor() and velocity.length() >= 1 and !footstep_sound.is_playing():
|
if pos.y >= .07 and is_on_floor() and velocity.length() >= 1 and !footstep_sound.is_playing():
|
||||||
footstep_sound.play()
|
footstep_sound.play()
|
||||||
|
|
||||||
return pos
|
return pos
|
||||||
|
|
||||||
|
|
||||||
@@ -485,7 +489,7 @@ func weapon_tilt(input_x, delta):
|
|||||||
if weapon_holder:
|
if weapon_holder:
|
||||||
weapon_holder.rotation.z = lerp(weapon_holder.rotation.z, -input_x * weapon_rotation_amount * 10, 4 * delta)
|
weapon_holder.rotation.z = lerp(weapon_holder.rotation.z, -input_x * weapon_rotation_amount * 10, 4 * delta)
|
||||||
if camera:
|
if camera:
|
||||||
camera.rotation.z = lerp(camera.rotation.z, -input_x * .075, 5 * delta)
|
camera.rotation.z = lerp(camera.rotation.z, -input_x * HEAD_TILT_AMT, 5 * delta)
|
||||||
|
|
||||||
func weapon_sway(delta):
|
func weapon_sway(delta):
|
||||||
if !ads:
|
if !ads:
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ func picked_up():
|
|||||||
level_control.ammo_current.append(instance_gun.max_ammo)
|
level_control.ammo_current.append(instance_gun.max_ammo)
|
||||||
level_control.ammo_reserve.append(instance_gun.max_ammo * instance_gun.start_mags)
|
level_control.ammo_reserve.append(instance_gun.max_ammo * instance_gun.start_mags)
|
||||||
var weapon_id = level_control.held_guns.size() - 1
|
var weapon_id = level_control.held_guns.size() - 1
|
||||||
level_control.player.gun.anim_player.play("swap_out")
|
if level_control.player.gun != null:
|
||||||
|
level_control.player.gun.anim_player.play("swap_out")
|
||||||
level_control.gun_spawn(weapon_id)
|
level_control.gun_spawn(weapon_id)
|
||||||
queue_free()
|
queue_free()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user