rearengement
This commit is contained in:
17
script/shoot.gd
Normal file
17
script/shoot.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends RigidBody2D
|
||||
|
||||
@export var SPEED : float = 100.0
|
||||
var direction: Vector2:
|
||||
set(val):
|
||||
direction = val.normalized() * SPEED
|
||||
var time := 0.0
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group("shoot")
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
linear_velocity = direction
|
||||
|
||||
time += delta
|
||||
#if time >= 2:
|
||||
# self.queue_free()
|
||||
Reference in New Issue
Block a user