changed the way the fall sprite works
This commit is contained in:
parent
67e9a93b2b
commit
929b63c454
10 changed files with 179 additions and 42 deletions
|
@ -52,7 +52,7 @@ onready var ladder_detector: RayCast2D = $"%LadderDetector"
|
|||
onready var death_splatter_position: Position2D = $"%DeathSplatterPosition"
|
||||
onready var pushable_detector: RayCast2D = $"%PushableDetector"
|
||||
onready var oxygen_timer = $OxygenTimer
|
||||
onready var oxygen_origin = oxygen_timer.wait_time
|
||||
onready var low_oxygen_label = $LowOxygenLabel
|
||||
|
||||
# OVERRIDES #
|
||||
func _ready() -> void:
|
||||
|
@ -100,6 +100,15 @@ func _physics_process(delta: float) -> void:
|
|||
if ladder_detector.is_colliding():
|
||||
state_chart.send_event("ladder_touched")
|
||||
|
||||
# show oxygen count on low oxygen
|
||||
if underwater:
|
||||
if oxygen_timer.time_left < 5:
|
||||
low_oxygen_label.text = str(floor(oxygen_timer.time_left) + 1)
|
||||
else:
|
||||
low_oxygen_label.text = ""
|
||||
else:
|
||||
low_oxygen_label.text = ""
|
||||
|
||||
#Cheats
|
||||
#CFox mode
|
||||
if Debug.cfox_mode == true:
|
||||
|
@ -175,7 +184,7 @@ func _on_NormalJump_state_exited() -> void:
|
|||
func _on_LadderJump_state_entered() -> void:
|
||||
velocity.y = -jump_force
|
||||
Audio.play_sound(Audio.a_jump, Audio.ac_jump)
|
||||
animation_player.play("jump")
|
||||
animation_player.play("ladder_jump")
|
||||
|
||||
func _on_DoubleJump_state_entered() -> void:
|
||||
velocity.y = -double_jump_force
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=45 format=2]
|
||||
[gd_scene load_steps=48 format=2]
|
||||
|
||||
[ext_resource path="res://objects/player/player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://graphics/player/palettes/default.png" type="Texture" id=2]
|
||||
|
@ -24,6 +24,8 @@
|
|||
[ext_resource path="res://graphics/player/sg_blink.png" type="Texture" id=22]
|
||||
[ext_resource path="res://graphics/player/sg_stim.png" type="Texture" id=23]
|
||||
[ext_resource path="res://graphics/player/sg_duck.png" type="Texture" id=24]
|
||||
[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=25]
|
||||
[ext_resource path="res://graphics/player/sg_jump_ladder.png" type="Texture" id=26]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=1]
|
||||
shader = ExtResource( 3 )
|
||||
|
@ -515,6 +517,58 @@ tracks/3/keys = {
|
|||
"values": [ 0.0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=21]
|
||||
resource_name = "ladder_jump"
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Graphics/Sprite:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ ExtResource( 26 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Graphics/Sprite:hframes")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ 1 ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("Graphics/Sprite:frame")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ 0 ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("Graphics/Sprite:rotation_degrees")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ 0.0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=17]
|
||||
resource_name = "push"
|
||||
length = 0.8
|
||||
|
@ -910,6 +964,7 @@ anims/fall = SubResource( 15 )
|
|||
anims/fall_scared = SubResource( 14 )
|
||||
anims/idle = SubResource( 6 )
|
||||
anims/jump = SubResource( 8 )
|
||||
anims/ladder_jump = SubResource( 21 )
|
||||
anims/push = SubResource( 17 )
|
||||
anims/shoot_airborne = SubResource( 11 )
|
||||
anims/shoot_grounded = SubResource( 10 )
|
||||
|
@ -1260,6 +1315,18 @@ script = ExtResource( 8 )
|
|||
wait_time = 20.0
|
||||
autostart = true
|
||||
|
||||
[node name="JumpPeakTimer" type="Timer" parent="."]
|
||||
wait_time = 0.2
|
||||
|
||||
[node name="LowOxygenLabel" type="Label" parent="."]
|
||||
material = ExtResource( 25 )
|
||||
margin_left = -8.0
|
||||
margin_top = -32.0
|
||||
margin_right = 8.0
|
||||
margin_bottom = -18.0
|
||||
theme = ExtResource( 7 )
|
||||
align = 1
|
||||
|
||||
[connection signal="body_entered" from="Hitbox" to="." method="_on_Hitbox_body_entered"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement" to="." method="_process_movement"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded" to="." method="_on_Grounded_state_entered"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue