mirror of
https://codeberg.org/Melon-Bread/Comets.gd.git
synced 2025-02-17 14:33:03 -05:00
23 lines
425 B
GDScript
23 lines
425 B
GDScript
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))
|
|
|
|
|
|
|
|
|
|
|
|
func _on_body_entered(body: Node2D) -> void:
|
|
print(body)
|
|
if body.is_in_group("ship"):
|
|
body.crash()
|