Rewriting ships: Added weapon base and changed hull parent to Node
This commit is contained in:
parent
95274d0a5b
commit
6957169ba5
13 changed files with 121 additions and 37 deletions
|
|
@ -2,8 +2,8 @@ extends RigidBody2D
|
|||
|
||||
class_name Hull
|
||||
|
||||
## Shortcut to get_parent()
|
||||
@onready var ship: Ship = get_parent()
|
||||
## Shortcut to get_parent().get_parent()
|
||||
@onready var ship: Ship = get_parent().get_parent()
|
||||
|
||||
## Hull ID to use with the Game.get_module func
|
||||
@export var id: String = "hull"
|
||||
|
|
@ -36,3 +36,8 @@ func add_ammunition(which: String, value: float) -> bool:
|
|||
if ammunition[which] > max_ammunition[which]:
|
||||
ammunition[which] = max_ammunition[which]
|
||||
return true
|
||||
|
||||
## Update ship's position and rotation
|
||||
func _physics_process(_delta):
|
||||
ship.position = position
|
||||
ship.rotation = rotation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue