Compare commits
No commits in common. "f240651ef24ee33f9c4cbff0eaea0f79bf40c5c4" and "83381f8311a42b2e48340e95a6bd4df606812cac" have entirely different histories.
f240651ef2
...
83381f8311
BIN
blends/levels/meat_creek_cage.png (Stored with Git LFS)
BIN
blends/levels/meat_creek_cage.png (Stored with Git LFS)
Binary file not shown.
BIN
blends/levels/side_tunnel_1.blend (Stored with Git LFS)
BIN
blends/levels/side_tunnel_1.blend (Stored with Git LFS)
Binary file not shown.
|
@ -1,3 +1,3 @@
|
||||||
source_md5="36158356a783eb08fdc11e6407f104eb"
|
source_md5="0fd4b06bb4f9ac715836d05cb4e85e7b"
|
||||||
dest_md5="0dddb11d864bd4c870b083fc31fbd6d8"
|
dest_md5="0dddb11d864bd4c870b083fc31fbd6d8"
|
||||||
|
|
||||||
|
|
BIN
godot/assets/meat_creek/MeatCreekCage.material (Stored with Git LFS)
BIN
godot/assets/meat_creek/MeatCreekCage.material (Stored with Git LFS)
Binary file not shown.
BIN
godot/assets/meat_creek/creek_cage.glb (Stored with Git LFS)
BIN
godot/assets/meat_creek/creek_cage.glb (Stored with Git LFS)
Binary file not shown.
|
@ -5,6 +5,7 @@ onready var util = get_node("/root/Util")
|
||||||
export var gravity: float = 6.0
|
export var gravity: float = 6.0
|
||||||
# When falling, gravity is artificially increased
|
# When falling, gravity is artificially increased
|
||||||
export var gravity_downwards_factor: float = 3
|
export var gravity_downwards_factor: float = 3
|
||||||
|
export var float_factor = 0.5
|
||||||
export var ground_gravity: float = 3.1
|
export var ground_gravity: float = 3.1
|
||||||
# Rate of gaining speed
|
# Rate of gaining speed
|
||||||
export var velocity_acceleration_xz: float = 3
|
export var velocity_acceleration_xz: float = 3
|
||||||
|
@ -20,8 +21,6 @@ export var walk_factor: float = 2.0
|
||||||
|
|
||||||
export var can_glide: bool = false
|
export var can_glide: bool = false
|
||||||
export var can_float: bool = false
|
export var can_float: bool = false
|
||||||
export var float_factor = 0.5
|
|
||||||
|
|
||||||
|
|
||||||
"public" var velocity: Vector3 = Vector3.ZERO
|
"public" var velocity: Vector3 = Vector3.ZERO
|
||||||
# Value changed by code only to add slow down or speed up effects
|
# Value changed by code only to add slow down or speed up effects
|
||||||
|
@ -46,10 +45,11 @@ func process_velocity(delta: float):
|
||||||
# Uses the input from MovementInput to compute and update this node's velocity
|
# Uses the input from MovementInput to compute and update this node's velocity
|
||||||
# velocity_acceleration controls gradual speedup whereas velocity_friction
|
# velocity_acceleration controls gradual speedup whereas velocity_friction
|
||||||
# controls gradual slowdown
|
# controls gradual slowdown
|
||||||
|
if Dialogic.get_variable("enable_glide") == "true":
|
||||||
|
can_glide = true
|
||||||
# Gravity
|
# Gravity
|
||||||
# You can buffer jumps by pressing releaseing the space bar and then pressing it again
|
# You can buffer jumps by pressing releaseing the space bar and then pressing it again
|
||||||
if not is_on_floor():
|
if not is_on_floor():
|
||||||
$FloatFactorAnimation.advance(delta)
|
|
||||||
var grav = -gravity
|
var grav = -gravity
|
||||||
if can_glide and Input.is_action_pressed("player_jump"):
|
if can_glide and Input.is_action_pressed("player_jump"):
|
||||||
grav /= 4
|
grav /= 4
|
||||||
|
@ -60,8 +60,6 @@ func process_velocity(delta: float):
|
||||||
gdf = float_factor
|
gdf = float_factor
|
||||||
target_velocity.y *= util.clamped_lerp(gdf, 1.0, velocity.y/2, 0.0)
|
target_velocity.y *= util.clamped_lerp(gdf, 1.0, velocity.y/2, 0.0)
|
||||||
else:
|
else:
|
||||||
$FloatFactorAnimation.stop()
|
|
||||||
$FloatFactorAnimation.play("float_anim")
|
|
||||||
velocity.y = max(0.0, velocity.y)
|
velocity.y = max(0.0, velocity.y)
|
||||||
target_velocity.y = max(0.0, max(target_velocity.y, jump_power * $"../MovementInput".jump_intent * jump_permission))
|
target_velocity.y = max(0.0, max(target_velocity.y, jump_power * $"../MovementInput".jump_intent * jump_permission))
|
||||||
if target_velocity.y == 0.0 and velocity.y == 0.0:
|
if target_velocity.y == 0.0 and velocity.y == 0.0:
|
||||||
|
|
|
@ -4,6 +4,7 @@ onready var active_physics_node: Spatial = $OnFootPhysics
|
||||||
|
|
||||||
export var can_glide: bool = false
|
export var can_glide: bool = false
|
||||||
export var can_float: bool = false
|
export var can_float: bool = false
|
||||||
|
export var float_factor = 0.5
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
Util.player = self
|
Util.player = self
|
||||||
|
@ -35,10 +36,8 @@ func objective_distance() -> float:
|
||||||
return $ObjectiveTracker.objective_distance
|
return $ObjectiveTracker.objective_distance
|
||||||
|
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
if Dialogic.get_variable("enable_glide") == "true":
|
|
||||||
can_float = true
|
|
||||||
$OnFootPhysics.can_glide = can_glide
|
$OnFootPhysics.can_glide = can_glide
|
||||||
$OnFootPhysics.can_float = can_float
|
$OnFootPhysics.can_float = can_float
|
||||||
|
$OnFootPhysics.float_factor = float_factor
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=34 format=2]
|
[gd_scene load_steps=33 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://player/CameraController.gd" type="Script" id=1]
|
[ext_resource path="res://player/CameraController.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://player/OnFootPhysics.gd" type="Script" id=2]
|
[ext_resource path="res://player/OnFootPhysics.gd" type="Script" id=2]
|
||||||
|
@ -57,22 +57,6 @@ tracks/0/keys = {
|
||||||
|
|
||||||
[sub_resource type="CylinderShape" id=4]
|
[sub_resource type="CylinderShape" id=4]
|
||||||
|
|
||||||
[sub_resource type="Animation" id=14]
|
|
||||||
resource_name = "float_anim"
|
|
||||||
length = 5.0
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/path = NodePath(".:float_factor")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PoolRealArray( 0, 3 ),
|
|
||||||
"transitions": PoolRealArray( 1, 1 ),
|
|
||||||
"update": 0,
|
|
||||||
"values": [ 0.5, 3.0 ]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="SphereShape" id=5]
|
[sub_resource type="SphereShape" id=5]
|
||||||
|
|
||||||
[sub_resource type="Animation" id=10]
|
[sub_resource type="Animation" id=10]
|
||||||
|
@ -220,7 +204,6 @@ anims/fov = SubResource( 9 )
|
||||||
|
|
||||||
[node name="OnFootPhysics" type="KinematicBody" parent="."]
|
[node name="OnFootPhysics" type="KinematicBody" parent="."]
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
float_factor = 3.0
|
|
||||||
|
|
||||||
[node name="CollisionShape" type="CollisionShape" parent="OnFootPhysics"]
|
[node name="CollisionShape" type="CollisionShape" parent="OnFootPhysics"]
|
||||||
transform = Transform( 0.4, 0, 0, 0, 0.440932, 0, 0, 0, 0.4, 0, 0, 0 )
|
transform = Transform( 0.4, 0, 0, 0, 0.440932, 0, 0, 0, 0.4, 0, 0, 0 )
|
||||||
|
@ -229,11 +212,6 @@ shape = SubResource( 4 )
|
||||||
[node name="Floor" type="RayCast" parent="OnFootPhysics"]
|
[node name="Floor" type="RayCast" parent="OnFootPhysics"]
|
||||||
script = ExtResource( 10 )
|
script = ExtResource( 10 )
|
||||||
|
|
||||||
[node name="FloatFactorAnimation" type="AnimationPlayer" parent="OnFootPhysics"]
|
|
||||||
autoplay = "float_anim"
|
|
||||||
playback_process_mode = 2
|
|
||||||
anims/float_anim = SubResource( 14 )
|
|
||||||
|
|
||||||
[node name="ElevatorPhysics" type="Spatial" parent="."]
|
[node name="ElevatorPhysics" type="Spatial" parent="."]
|
||||||
script = ExtResource( 7 )
|
script = ExtResource( 7 )
|
||||||
|
|
||||||
|
|
|
@ -47,4 +47,4 @@ shape = SubResource( 2 )
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource( 1 )]
|
[node name="Player" parent="." instance=ExtResource( 1 )]
|
||||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.566872, 2.73697 )
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.566872, 2.73697 )
|
||||||
can_float = true
|
can_glide = true
|
||||||
|
|
Loading…
Reference in New Issue