mirror of
https://github.com/mx42/my-gd-game.git
synced 2026-01-14 21:39:51 +01:00
feat: initial commit
This commit is contained in:
19
scenes/laser.gd
Normal file
19
scenes/laser.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
extends Area2D
|
||||
|
||||
@export var speed = 500;
|
||||
|
||||
func _ready() -> void:
|
||||
var tween = create_tween();
|
||||
tween.tween_property(
|
||||
$Sprite2D,
|
||||
'scale',
|
||||
Vector2(1.,1.),
|
||||
0.2
|
||||
).from(Vector2(0., 0.));
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
position.y -= speed * delta;
|
||||
|
||||
if position.y < 0:
|
||||
queue_free();
|
||||
Reference in New Issue
Block a user