Skip to content

Commit

Permalink
feat: improve tween animation
Browse files Browse the repository at this point in the history
  • Loading branch information
wlywlywlywly committed Jun 22, 2024
1 parent 6798bbf commit 31cfea4
Show file tree
Hide file tree
Showing 3 changed files with 351 additions and 370 deletions.
7 changes: 6 additions & 1 deletion scripts/bullets/enchanted_beam.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ extends Area2D
func _ready():
rotation = PI / 4 + Vector2(0, 0).angle_to_point(direction)
direction = direction.normalized()
var color = modulate
modulate.a = 0
create_tween().set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_QUAD).tween_property(
self, "modulate", color, 0.1
)
$OutScreen.screen_exited.connect(queue_free)


Expand All @@ -24,7 +29,7 @@ var is_bound = false
func _process(delta):
# 没用过正常移动
if !is_bound:
position += delta * speed * direction * (1.0 if $Start.time_left == 0 else (1.0 / 6.0))
position += delta * speed * direction
else:
position -= delta * speed * direction

Expand Down
3 changes: 2 additions & 1 deletion scripts/global.gd
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
extends GlobalClass
#extends GlobalClass
extends Node
Loading

0 comments on commit 31cfea4

Please sign in to comment.