started working on bullets

This commit is contained in:
derek
2024-10-21 16:42:23 -05:00
parent 38da419c1c
commit d3d577a9c2
4 changed files with 19 additions and 19 deletions

View File

@@ -286,21 +286,6 @@ data = PackedVector3Array(-2.375, 3.4025, 0.125, 2.375, 3.4025, 0.125, -2.375, -
[sub_resource type="BoxMesh" id="BoxMesh_fd2rc"] [sub_resource type="BoxMesh" id="BoxMesh_fd2rc"]
size = Vector3(4.75, 6.805, 0.25) size = Vector3(4.75, 6.805, 0.25)
[sub_resource type="Animation" id="Animation_jmej3"]
resource_name = "open"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(4.43091, 3.29403, -50.9568), Vector3(4.43091, 9.85387, -50.9568)]
}
[sub_resource type="Animation" id="Animation_w5uyq"] [sub_resource type="Animation" id="Animation_w5uyq"]
length = 0.001 length = 0.001
tracks/0/type = "value" tracks/0/type = "value"
@@ -331,6 +316,21 @@ tracks/0/keys = {
"values": [Vector3(4.43091, 9.85387, -50.9568), Vector3(4.43091, 3.29403, -50.9568)] "values": [Vector3(4.43091, 9.85387, -50.9568), Vector3(4.43091, 3.29403, -50.9568)]
} }
[sub_resource type="Animation" id="Animation_jmej3"]
resource_name = "open"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(4.43091, 3.29403, -50.9568), Vector3(4.43091, 9.85387, -50.9568)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_pobrj"] [sub_resource type="AnimationLibrary" id="AnimationLibrary_pobrj"]
_data = { _data = {
"RESET": SubResource("Animation_w5uyq"), "RESET": SubResource("Animation_w5uyq"),

View File

@@ -11,7 +11,7 @@ config_version=5
[application] [application]
config/name="First Person Test" config/name="First Person Test"
run/main_scene="res://levels/blockout_3.tscn" run/main_scene="res://assets/blockout_2.tscn"
config/features=PackedStringArray("4.3", "Forward Plus") config/features=PackedStringArray("4.3", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"

View File

@@ -39,7 +39,7 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta): func _physics_process(delta):
position += transform.basis * Vector3(0, 0, -bullet_speed) * delta position += transform.basis * Vector3(0, 0, -bullet_speed) * delta
rotation.x = clamp(rotation.x - delta * bullet_drop,deg_to_rad(-90),deg_to_rad(90)) rotation.x = clamp(rotation.x - delta * bullet_drop,deg_to_rad(-90),deg_to_rad(90))

View File

@@ -178,8 +178,8 @@ func _physics_process(delta):
velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5) velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5)
#movement in air #movement in air
else: else:
velocity.x = lerp(velocity.x, direction.x * speed, delta * 3) velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5)
velocity.z = lerp(velocity.z, direction.z * speed, delta * 3) velocity.z = lerp(velocity.z, direction.z * speed, delta * 6.5)
# Head bob # Head bob
t_bob += delta * velocity.length() * float(is_on_floor()) t_bob += delta * velocity.length() * float(is_on_floor())