Changed the way the fades work, and brought back in the Player

This commit is contained in:
2024-01-22 17:00:30 -08:00
parent 630670d5b1
commit bde3cc5976
14 changed files with 626 additions and 36 deletions
+17
View File
@@ -0,0 +1,17 @@
extends Control
var in_p : Vector2
var out_p : Vector2
var width : float
@export var weight : float
# Called when the node enters the scene tree for the first time.
func _ready():
in_p = $"../in".position
out_p = $"../out".position
width = $TextureRect.texture.get_size().x
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
position = lerp(in_p -Vector2( width ,0 ), out_p +Vector2( width ,0 ),weight)
pass
+19
View File
@@ -0,0 +1,19 @@
extends ColorRect
@export var type: int = 0
@export var speed: float = 1
# Called when the node enters the scene tree for the first time.
func _ready():
if type == 0:
$AnimationPlayer.play("fade_in")
elif type == 1:
$AnimationPlayer.play("fade_out")
$AnimationPlayer.speed_scale = speed
await $AnimationPlayer.animation_finished
queue_free()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass