Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save WolfgangSenff/48952babda5e9c1b752dcfe9a2e00c28 to your computer and use it in GitHub Desktop.
Save WolfgangSenff/48952babda5e9c1b752dcfe9a2e00c28 to your computer and use it in GitHub Desktop.
Sec_Ras tree
extends Sprite2D
const MoveSpeed = 50
var _initial_y
func _ready():
_initial_y = global_position.y
func _process(delta: float) -> void:
var scale_y = global_position.y - _initial_y
scale = Vector2(scale_y, scale_y) * delta
global_position.y = move_toward(global_position.y, 70, delta * MoveSpeed)
if is_zero_approx(global_position.y - 70.0):
hide()
set_process(false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment