mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 23:48:11 +00:00
added the game
This commit is contained in:
14
Scripts/Parts/BetterAnimatedSprite.gd
Normal file
14
Scripts/Parts/BetterAnimatedSprite.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user