tp work and first steep for menu
This commit is contained in:
@@ -3,6 +3,8 @@ extends RigidBody2D
|
||||
var SPEED : float
|
||||
var direction : Vector2
|
||||
var type:= 1
|
||||
var is_in := false
|
||||
var delay_dup := 0.0
|
||||
|
||||
@export var particles := load("res://scene/destroy.tscn")
|
||||
|
||||
@@ -16,7 +18,10 @@ func _ready() -> void:
|
||||
SPEED = randf() / 50 +50
|
||||
rotation = randf_range(0.0, 360.0)
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
func _process(delta: float) -> void:
|
||||
|
||||
if delay_dup < 1:
|
||||
delay_dup += delta
|
||||
linear_velocity = direction * SPEED
|
||||
|
||||
func split():
|
||||
@@ -58,7 +63,6 @@ func _on_body_entered(body: Node) -> void:
|
||||
if body.is_in_group("asteroid"):
|
||||
get_parent()._add_collision(body, self)
|
||||
elif body.is_in_group("shoot"):
|
||||
body.destroy = true
|
||||
body.queue_free()
|
||||
split()
|
||||
else:
|
||||
direction = -direction
|
||||
|
||||
Reference in New Issue
Block a user