mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 07:28:14 +00:00
15 lines
364 B
GDScript
15 lines
364 B
GDScript
class_name BetterAnimatedSprite2D
|
|
extends AnimatedSprite2D
|
|
|
|
@export var do_offset := true
|
|
|
|
func _process(_delta: float) -> void:
|
|
if do_offset:
|
|
on_frame_changed()
|
|
|
|
func on_frame_changed() -> void:
|
|
if sprite_frames == null: return
|
|
var texture = sprite_frames.get_frame_texture(animation, frame)
|
|
if texture != null:
|
|
position.y = -(texture.get_height() / 2.0)
|