godot-shooter / asteroids / files / items / Asteroid.gd
Branch asteroids · default branch · all branches
Asteroid.gd
7ce36b32 2023-12-21 Pavel Safronov | 1 | extends KinematicBody2D |
56cadf84 2023-12-02 Pavel Safronov | 2 | class_name Asteroid |
| 3 | ||
| 4 | export var spin_rate = .1 | |
| 5 | export var velocity = Vector2.ZERO | |
| 6 | ||
| 7 | func _physics_process(delta: float) -> void: | |
7ce36b32 2023-12-21 Pavel Safronov | 8 | rotation += spin_rate * delta |
| 9 | velocity = move_and_slide(velocity) |