mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
All-Stars Pose at Level End
This adds a new and optional animation for Characters called `PoseDoor`. When a character uses this animation, they stop at the entrance of the castle door to strike a pose like in All-Stars.
This commit is contained in:
@@ -175,6 +175,10 @@ collision_mask = 0
|
||||
position = Vector2(21, -9)
|
||||
shape = SubResource("RectangleShape2D_6fi1c")
|
||||
|
||||
[node name="PosePoint" type="Node2D" parent="Overlay/PlayerDetection"]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(-16, 0)
|
||||
|
||||
[node name="Overlay2" type="TileMapLayer" parent="Overlay"]
|
||||
show_behind_parent = true
|
||||
tile_map_data = PackedByteArray("AAAEAAAAAAAHABQAAAAEAAEAAAAHABQAAAAEAAIAAAAHABQAAAAEAAMAAAAHABQAAAAFAAAAAAAHABQAAAAFAAEAAAAHABQAAAAFAAIAAAAHABQAAAAFAAMAAAAHABQAAAAIAAAAAAAHABQAAAAIAAEAAAAHABQAAAAIAAIAAAAHABQAAAAIAAMAAAAHABQAAAAJAAAAAAAHABQAAAAJAAEAAAAHABQAAAAJAAIAAAAHABQAAAAJAAMAAAAHABQAAAA=")
|
||||
|
@@ -155,6 +155,10 @@ collision_mask = 0
|
||||
position = Vector2(21, -9)
|
||||
shape = SubResource("RectangleShape2D_4yifo")
|
||||
|
||||
[node name="PosePoint" type="Node2D" parent="Overlay/PlayerDetection"]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(-16, 0)
|
||||
|
||||
[node name="OverlaySprite" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
z_index = 10
|
||||
|
@@ -74,6 +74,7 @@ var pipe_move_direction := 1
|
||||
var stomp_combo := 0
|
||||
|
||||
var is_invincible := false
|
||||
var is_posing := false
|
||||
|
||||
const COMBO_VALS := [100, 200, 400, 500, 800, 1000, 2000, 4000, 5000, 8000, null]
|
||||
|
||||
@@ -82,6 +83,8 @@ const COMBO_VALS := [100, 200, 400, 500, 800, 1000, 2000, 4000, 5000, 8000, null
|
||||
@onready var normal_state: Node = $States/Normal
|
||||
@export var auto_death_pit := true
|
||||
|
||||
var can_pose := true
|
||||
|
||||
var can_hurt := true
|
||||
|
||||
var in_water := false
|
||||
|
@@ -7,6 +7,7 @@ func enter(_msg := {}) -> void:
|
||||
player.get_node("CameraCenterJoint/RightWall").set_collision_layer_value(1, false)
|
||||
|
||||
func physics_update(delta: float) -> void:
|
||||
if player.is_posing: return
|
||||
player.input_direction = 1
|
||||
player.can_run = false
|
||||
player.normal_state.handle_movement(delta)
|
||||
|
@@ -39,6 +39,18 @@ func _process(_delta: float) -> void:
|
||||
if get_node_or_null("Wall") != null:
|
||||
%Wall.visible = show_walls
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
for i: Player in get_tree().get_nodes_in_group("Players"):
|
||||
if not i.sprite.sprite_frames.has_animation("PoseDoor"): i.can_pose = false; continue
|
||||
if i.can_pose and i.global_position >= %PosePoint.global_position and i.sprite.sprite_frames.has_animation("PoseDoor"):
|
||||
i.is_posing = true; i.can_pose = false
|
||||
i.play_animation("PoseDoor")
|
||||
i.sprite.animation_finished.connect(on_pose_finished.bind(i))
|
||||
i.sprite.animation_looped.connect(on_pose_finished.bind(i))
|
||||
|
||||
func on_pose_finished(player: Player) -> void:
|
||||
player.is_posing = false
|
||||
|
||||
func on_music_finished() -> void:
|
||||
do_sequence()
|
||||
|
||||
|
Reference in New Issue
Block a user