Comets.gd/scenes/comet.gd

23 lines
425 B
GDScript3
Raw Normal View History

2024-05-12 00:47:14 -04:00
extends Area2D
@export var movement_speed := 600
var rotation_speed : int
var rotaion_direction : int
func _ready() -> void:
rotaion_direction = randi_range(-1, 1)
rotation_speed = randi_range(50, 250)
func _physics_process(delta: float) -> void:
rotate(deg_to_rad(rotaion_direction * rotation_speed * delta))
2024-05-12 01:03:18 -04:00
func _on_body_entered(body: Node2D) -> void:
print(body)
if body.is_in_group("ship"):
body.crash()