From e218f3c10b3b675a7c1eac80056e4d24eee114f4 Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Thu, 5 Dec 2024 02:35:40 -0500 Subject: [PATCH] beta gameplay in beta levels ;) --- maps/cave.tscn | 1 + maps/hills.tscn | 1 + objects/player/player.gd | 11 +++++++++-- objects/player/player.tscn | 19 +++++++++++++++---- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/maps/cave.tscn b/maps/cave.tscn index ab72f3f..66b0830 100644 --- a/maps/cave.tscn +++ b/maps/cave.tscn @@ -66,6 +66,7 @@ tile_data = PoolIntArray( 65571, 0, 0, 131107, 0, 0, 131155, 0, 65537, 131156, 0 [node name="Player" parent="." instance=ExtResource( 1 )] position = Vector2( 32, 176 ) +beta_gameplay = true [node name="Ladder" type="TileMap" parent="."] tile_set = ExtResource( 22 ) diff --git a/maps/hills.tscn b/maps/hills.tscn index 4a237d0..a06cddd 100644 --- a/maps/hills.tscn +++ b/maps/hills.tscn @@ -66,6 +66,7 @@ tile_data = PoolIntArray( 196660, 2, 2, 196661, 2, 2, 196668, 0, 0, 196669, 0, 0 [node name="Player" parent="." instance=ExtResource( 26 )] position = Vector2( 32, 176 ) +beta_gameplay = true [node name="Death" type="TileMap" parent="."] tile_set = ExtResource( 9 ) diff --git a/objects/player/player.gd b/objects/player/player.gd index 06e3688..22b8818 100644 --- a/objects/player/player.gd +++ b/objects/player/player.gd @@ -33,6 +33,8 @@ export var jump_release_force: float = 0.25 export var double_jump_force: float = 122.0 ## if on turn on oxygentimer to kill player export var underwater = false +## old player controls +export var beta_gameplay = false # velocity var velocity: Vector2 = Vector2.ZERO @@ -92,6 +94,7 @@ func _ready() -> void: state_chart.set_guard_property("can_respawn", true) state_chart.set_guard_property("use_iframes", use_iframes) state_chart.set_guard_property("red_feather", false) + state_chart.set_guard_property("beta_gameplay", beta_gameplay) # state chart debug $StateDebugLayer/StateChartDebug.target = state_chart # set lung size @@ -470,10 +473,10 @@ func _process_climbing(delta: float) -> void: # if sign(_attached_ladder.middle - global_position.x) != horizontal_dir: # global_position.x -= graphics.scale.x * 3.0 # state_chart.send_event("ladder_detach")# - elif Input.is_action_just_pressed("move_left") and _attached_ladder.can_climb_left: + elif Input.is_action_just_pressed("move_left") and _attached_ladder.can_climb_left and not beta_gameplay: global_position.x = _attached_ladder.left_snap graphics.scale.x = 1.0 - elif Input.is_action_just_pressed("move_right") and _attached_ladder.can_climb_right: + elif Input.is_action_just_pressed("move_right") and _attached_ladder.can_climb_right and not beta_gameplay: global_position.x = _attached_ladder.right_snap graphics.scale.x = -1.0 else: @@ -595,3 +598,7 @@ func _on_ShieldTimer_timeout(): func _on_ShieldCooldown_timeout(): can_shield = true Audio.play_sound(Audio.a_shield_cooldown,Audio.ac_boss) + + +func _on_BetaFalling_state_entered() -> void: + velocity.x = 0.0 diff --git a/objects/player/player.tscn b/objects/player/player.tscn index 5e7e3fe..a05b632 100644 --- a/objects/player/player.tscn +++ b/objects/player/player.tscn @@ -1094,6 +1094,12 @@ __meta__ = { } initial_state = NodePath("CanWalk") +[node name="On AirborneBeta" type="Node" parent="StateChart/Root/Movement/Grounded"] +script = ExtResource( 10 ) +to = NodePath("../../Airborne/Falling/BetaFalling") +event = "airborne" +guard_expression = "beta_gameplay" + [node name="On Airborne" type="Node" parent="StateChart/Root/Movement/Grounded"] script = ExtResource( 10 ) to = NodePath("../../Airborne/Falling/CoyoteFalling") @@ -1330,6 +1336,9 @@ delay = 0.067 [node name="NormalFalling" type="Node" parent="StateChart/Root/Movement/Airborne/Falling"] script = ExtResource( 11 ) +[node name="BetaFalling" type="Node" parent="StateChart/Root/Movement/Airborne/Falling"] +script = ExtResource( 11 ) + [node name="ScaredFalling" type="Node" parent="StateChart/Root/Movement/Airborne/Falling"] script = ExtResource( 11 ) @@ -1534,8 +1543,8 @@ one_shot = true [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"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded" to="." method="_process_grounded"] -[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_can_walk"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_horizontal_movement_grounded"] +[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_can_walk"] [connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Still" to="." method="_on_Still_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Walking" to="." method="_on_Walking_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Blinking" to="." method="_on_Blinking_state_entered"] @@ -1546,11 +1555,11 @@ one_shot = true [connection signal="state_entered" from="StateChart/Root/Movement/Grounded/Shooting" to="." method="_on_Shooting_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Grounded/Pushing" to="." method="_on_Pushing_state_entered"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/Pushing" to="." method="_process_pushing"] -[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="reset_fall_speed"] +[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne" to="." method="_process_gravity"] -[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"] +[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_entered"] [connection signal="state_exited" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_exited"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/LadderJump" to="." method="_on_LadderJump_state_entered"] @@ -1558,9 +1567,11 @@ one_shot = true [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Falling/CoyoteFalling" to="." method="_process_horizontal_movement"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Falling/NormalFalling" to="." method="_on_NormalFalling_state_entered"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Falling/NormalFalling" to="." method="_process_horizontal_movement"] +[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Falling/BetaFalling" to="." method="_on_NormalFalling_state_entered"] +[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Falling/BetaFalling" to="." method="_on_BetaFalling_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Falling/ScaredFalling" to="." method="_on_ScaredFalling_state_entered"] -[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/DoubleJump" to="." method="reset_fall_speed"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne/DoubleJump" to="." method="_on_DoubleJump_state_entered"] +[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/DoubleJump" to="." method="reset_fall_speed"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/DoubleJump" to="." method="_process_horizontal_movement"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne/AirShooting" to="." method="_on_AirShooting_state_entered"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/AirShooting" to="." method="_process_horizontal_movement"]