mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
added piranha plant rotation + a small optimization to playing custom levels?
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=20 format=3 uid="uid://1rxw4k4wq3ni"]
|
[gd_scene load_steps=22 format=3 uid="uid://1rxw4k4wq3ni"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://dbq6cn2hp6ijx" path="res://Assets/Sprites/Enemies/PiranhaPlant.png" id="1_2imih"]
|
[ext_resource type="Texture2D" uid="uid://dbq6cn2hp6ijx" path="res://Assets/Sprites/Enemies/PiranhaPlant.png" id="1_2imih"]
|
||||||
[ext_resource type="Script" uid="uid://d23hoj2qc2whq" path="res://Scripts/Classes/Entities/Enemies/PiranhaPlant.gd" id="1_jbk0f"]
|
[ext_resource type="Script" uid="uid://d23hoj2qc2whq" path="res://Scripts/Classes/Entities/Enemies/PiranhaPlant.gd" id="1_jbk0f"]
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
[ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="10_uohcg"]
|
[ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="10_uohcg"]
|
||||||
[ext_resource type="Script" uid="uid://d0mqkvopasu8k" path="res://Scripts/Classes/Components/SecondQuestReplaceComponent.gd" id="10_xreuf"]
|
[ext_resource type="Script" uid="uid://d0mqkvopasu8k" path="res://Scripts/Classes/Components/SecondQuestReplaceComponent.gd" id="10_xreuf"]
|
||||||
[ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="11_8y1e5"]
|
[ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="11_8y1e5"]
|
||||||
|
[ext_resource type="Script" uid="uid://ctfbuoxtnnl0q" path="res://Scripts/Classes/Components/EditorPropertyExposer.gd" id="12_ofvpu"]
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xp8sq"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_xp8sq"]
|
||||||
atlas = ExtResource("1_2imih")
|
atlas = ExtResource("1_2imih")
|
||||||
@@ -180,6 +181,14 @@ _data = {
|
|||||||
&"Rise": SubResource("Animation_t8k64")
|
&"Rise": SubResource("Animation_t8k64")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[sub_resource type="GDScript" id="GDScript_ofvpu"]
|
||||||
|
script/source = "extends Node
|
||||||
|
|
||||||
|
func _process(_delta: float) -> void:
|
||||||
|
if Global.level_editor != null:
|
||||||
|
owner.global_rotation_degrees = [0, 180, 90, -90][owner.pipe_direction]
|
||||||
|
"
|
||||||
|
|
||||||
[node name="PirannhaPlant" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
|
[node name="PirannhaPlant" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
|
||||||
z_index = -5
|
z_index = -5
|
||||||
script = ExtResource("1_jbk0f")
|
script = ExtResource("1_jbk0f")
|
||||||
@@ -279,6 +288,15 @@ script = ExtResource("11_8y1e5")
|
|||||||
hitbox = NodePath("../Sprite/Hitbox")
|
hitbox = NodePath("../Sprite/Hitbox")
|
||||||
metadata/_custom_type_script = "uid://ba18grqjixded"
|
metadata/_custom_type_script = "uid://ba18grqjixded"
|
||||||
|
|
||||||
|
[node name="EditorPropertyExposer" type="Node" parent="."]
|
||||||
|
script = ExtResource("12_ofvpu")
|
||||||
|
properties = Array[String](["pipe_direction"])
|
||||||
|
metadata/_custom_type_script = "uid://ctfbuoxtnnl0q"
|
||||||
|
|
||||||
|
[node name="Node" type="Node" parent="."]
|
||||||
|
process_mode = 3
|
||||||
|
script = SubResource("GDScript_ofvpu")
|
||||||
|
|
||||||
[connection signal="timeout" from="Timer" to="." method="on_timeout"]
|
[connection signal="timeout" from="Timer" to="." method="on_timeout"]
|
||||||
[connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
|
[connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
|
||||||
[connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
|
[connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
|
||||||
|
@@ -36,7 +36,7 @@ tracks/0/path = NodePath("Sprite:scale")
|
|||||||
tracks/0/interp = 2
|
tracks/0/interp = 2
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
"times": PackedFloat32Array(0, 0.033333335, 0.1, 0.16666667),
|
"times": PackedFloat32Array(0, 0.010294806, 0.06666667, 0.16666667),
|
||||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
"update": 0,
|
"update": 0,
|
||||||
"values": [Vector2(1, 1), Vector2(0.8, 0.8), Vector2(1.2, 1.2), Vector2(1, 1)]
|
"values": [Vector2(1, 1), Vector2(0.8, 0.8), Vector2(1.2, 1.2), Vector2(1, 1)]
|
||||||
|
@@ -282,7 +282,8 @@ func parse_tiles() -> void:
|
|||||||
for i in entity_layer_nodes:
|
for i in entity_layer_nodes:
|
||||||
if is_instance_valid(i) == false:
|
if is_instance_valid(i) == false:
|
||||||
continue
|
continue
|
||||||
saved_entity_layers[idx] = i.duplicate(DUPLICATE_USE_INSTANTIATION)
|
if load_play == false:
|
||||||
|
saved_entity_layers[idx] = i.duplicate(DUPLICATE_USE_INSTANTIATION)
|
||||||
if i is Player:
|
if i is Player:
|
||||||
i.direction = 1
|
i.direction = 1
|
||||||
i.velocity = Vector2.ZERO
|
i.velocity = Vector2.ZERO
|
||||||
|
@@ -2,6 +2,8 @@ extends Enemy
|
|||||||
|
|
||||||
@export var player_range := 24
|
@export var player_range := 24
|
||||||
|
|
||||||
|
@export_enum("Up", "Down", "Left", "Right") var pipe_direction := 0
|
||||||
|
|
||||||
func _enter_tree() -> void:
|
func _enter_tree() -> void:
|
||||||
$Animation.play("Hide")
|
$Animation.play("Hide")
|
||||||
|
|
||||||
@@ -13,5 +15,8 @@ func _ready() -> void:
|
|||||||
|
|
||||||
func on_timeout() -> void:
|
func on_timeout() -> void:
|
||||||
var player = get_tree().get_first_node_in_group("Players")
|
var player = get_tree().get_first_node_in_group("Players")
|
||||||
if abs(player.global_position.x - global_position.x) >= player_range:
|
if pipe_direction < 2:
|
||||||
$Animation.play("Rise")
|
if abs(player.global_position.x - global_position.x) >= player_range:
|
||||||
|
$Animation.play("Rise")
|
||||||
|
elif (abs(player.global_position.y - global_position.y) >= player_range and abs(player.global_position.x - global_position.x) >= player_range * 2):
|
||||||
|
$Animation.play("Rise")
|
||||||
|
Reference in New Issue
Block a user