made a lil asteroids game but now messing around with packed scenes so putting a save heere

This commit is contained in:
Tabby 2025-05-11 20:04:24 +10:00
parent caa2cd4c11
commit d5c27030c5
9 changed files with 129 additions and 16 deletions

View file

@ -0,0 +1,13 @@
extends RigidBody2D
@export var rotation_force = 1
@export var drag = 2
@export var top_speed = 6
func _process(delta: float) -> void:
var input = Input.get_axis("asteroids_left","asteroids_right")
angular_velocity += rotation_force * delta * input
print(angular_velocity)
angular_velocity = clampf(angular_velocity, -top_speed, top_speed)
if(input == 0):
angular_velocity = move_toward(angular_velocity, 0, delta * drag)