Rewriting ships: Added some player interface and started rewriting star system

This commit is contained in:
2ndbeam 2024-04-30 16:22:55 +03:00
commit 4172b336c1
20 changed files with 300 additions and 139 deletions

View file

@ -28,6 +28,9 @@ class_name Hull
else:
ship.destroyed.emit()
## Length of linear_velocity vector
var scalar_velocity: float = 0.0
## Adds amount to ammunition, returns true if it was successful
func add_ammunition(which: String, value: float) -> bool:
if ammunition[which] + value < 0:
@ -41,3 +44,4 @@ func add_ammunition(which: String, value: float) -> bool:
func _physics_process(_delta):
ship.position = position
ship.rotation = rotation
scalar_velocity = linear_velocity.length()