mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
Update PiranhaPlant.tscn
This commit is contained in:
@@ -184,14 +184,18 @@ _data = {
|
|||||||
[sub_resource type="GDScript" id="GDScript_ofvpu"]
|
[sub_resource type="GDScript" id="GDScript_ofvpu"]
|
||||||
script/source = "extends Node
|
script/source = "extends Node
|
||||||
|
|
||||||
@onready var starting_position: Vector2 = owner.global_position
|
var starting_position = Vector2(-1, -1)
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
if starting_position == Vector2(-1, -1):
|
||||||
|
starting_position = owner.global_position
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
func _process(_delta: float) -> void:
|
||||||
const OFFSETS = [Vector2.ZERO, Vector2(0, -16), Vector2(-16, 0), Vector2.ZERO]
|
const OFFSETS = [Vector2.ZERO, Vector2(0, -16), Vector2(-16, 0), Vector2.ZERO]
|
||||||
if Global.level_editor != null:
|
if Global.level_editor != null:
|
||||||
owner.global_rotation_degrees = [0, 180, 90, -90][owner.plant_direction]
|
owner.global_rotation_degrees = [0, 180, 90, -90][owner.plant_direction]
|
||||||
var offset = OFFSETS[owner.plant_direction]
|
var offset = OFFSETS[owner.plant_direction]
|
||||||
owner.global_position = starting_position + offset
|
owner.global_position = Vector2((owner.get_meta(\"tile_position\") + Vector2i(1, 1)) * 16) + offset
|
||||||
"
|
"
|
||||||
|
|
||||||
[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"]]
|
||||||
|
Reference in New Issue
Block a user