started working on bullets
This commit is contained in:
@@ -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"]
|
||||
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"]
|
||||
length = 0.001
|
||||
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)]
|
||||
}
|
||||
|
||||
[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"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_w5uyq"),
|
||||
|
||||
@@ -11,7 +11,7 @@ config_version=5
|
||||
[application]
|
||||
|
||||
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/icon="res://icon.svg"
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ func _ready():
|
||||
|
||||
|
||||
# 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
|
||||
rotation.x = clamp(rotation.x - delta * bullet_drop,deg_to_rad(-90),deg_to_rad(90))
|
||||
|
||||
|
||||
@@ -178,8 +178,8 @@ func _physics_process(delta):
|
||||
velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5)
|
||||
#movement in air
|
||||
else:
|
||||
velocity.x = lerp(velocity.x, direction.x * speed, delta * 3)
|
||||
velocity.z = lerp(velocity.z, direction.z * speed, delta * 3)
|
||||
velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5)
|
||||
velocity.z = lerp(velocity.z, direction.z * speed, delta * 6.5)
|
||||
|
||||
# Head bob
|
||||
t_bob += delta * velocity.length() * float(is_on_floor())
|
||||
|
||||
Reference in New Issue
Block a user