From 929b63c454e549256ed62f14c00008d67fa61b68 Mon Sep 17 00:00:00 2001 From: pennyrigate Date: Tue, 20 Jun 2023 08:20:35 -0400 Subject: [PATCH] changed the way the fall sprite works --- graphics/player/sg_fall.png | Bin 2030 -> 2029 bytes graphics/player/sg_jump_ladder.png | Bin 0 -> 304 bytes graphics/player/sg_jump_ladder.png.import | 35 +++++++++ maps/abyss.tscn | 68 ++++++++--------- objects/environment/bubble/bubble.gd | 9 ++- objects/environment/bubble/bubble.tscn | 6 ++ .../environment/bubble/bubble_spawner.tscn | 11 +++ objects/hud/hud.gd | 10 +-- objects/player/player.gd | 13 +++- objects/player/player.tscn | 69 +++++++++++++++++- 10 files changed, 179 insertions(+), 42 deletions(-) create mode 100644 graphics/player/sg_jump_ladder.png create mode 100644 graphics/player/sg_jump_ladder.png.import create mode 100644 objects/environment/bubble/bubble_spawner.tscn diff --git a/graphics/player/sg_fall.png b/graphics/player/sg_fall.png index 45d2977932eee4d4ed6b993c4f3dd5ec6e8c87ec..72357aec037d9af4be73a376d06a0b14e37fbd64 100644 GIT binary patch delta 223 zcmaFI|CWElRz^p~0G|+728RC*4FCTFk;DH6hW`x?{~a9uGXPP;e}{(u3=9mbg0sVc z6n9CGU+{l8VDR#1{IvNOV+Lz|m8Xkih(>U3Z?urJB8Ri4xXaD|O{atR&V8n=k}l%# zKf}48^d0AX=V}%0U5T2}I~-j~PK&+!;AnJu8lMBd@JHU}UGL_eydajsyPeVISf;Ak ziK)^?-HwYiSpUvF!LK5j S$@_o~WbkzLb6Mw<&;$S-_hYyK delta 224 zcmaFM|BipdRz_Eq0G|+728RC*4FCTFk;DH6hW`x>{~H|sJ2?Dj0Fn*=8Gwj^VNLrH zDImpD666>B9|0JI?w>oi`5R*fYkj$=i(`mJaBgq3&`|{r=bclOPW}5H{bb?2%+G?8 zjFVaZUT881-KqD-Y^|`)%chkX@7M$jqfEYY>Z@$dc*sz4*X29sT)(-q4_;tfwCgrw zUhZ}g=_hAcXFg@^j1o>%%4gqlw*JNJNgrFZT)(^jYTH{bo9q&KetU?#dIqoGZtjh| QAXhSYy85}Sb4q9e0JIor^Z)<= diff --git a/graphics/player/sg_jump_ladder.png b/graphics/player/sg_jump_ladder.png new file mode 100644 index 0000000000000000000000000000000000000000..b5509c2fe2600bf194f738e49cc6678ba87fa1f3 GIT binary patch literal 304 zcmeAS@N?(olHy`uVBq!ia0vp^qChOd!3-orr?xQyDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheDgizrt_%$S9T@)q2O@|64GjMq8vZvp{C9Bp&j3UX{~a3s0~OZ#o-G7Y zJS9PX!T%9}LFoRub3k#<0*}aI1_r(ZAk3I`t& 15: oxygen_meter.scale.x = 15 diff --git a/objects/player/player.gd b/objects/player/player.gd index a6460f0..27937d5 100644 --- a/objects/player/player.gd +++ b/objects/player/player.gd @@ -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 diff --git a/objects/player/player.tscn b/objects/player/player.tscn index 85e639b..2ebfdab 100644 --- a/objects/player/player.tscn +++ b/objects/player/player.tscn @@ -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"]