Created
April 29, 2023 04:36
-
-
Save WolfgangSenff/48952babda5e9c1b752dcfe9a2e00c28 to your computer and use it in GitHub Desktop.
Sec_Ras tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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