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
|
|
@ -8,7 +8,7 @@ class_name Projectile
|
|||
@export var collider : Area2D
|
||||
@export var lifetime : float = 10
|
||||
|
||||
var faction = "none"
|
||||
var faction: Game.Faction = Game.Faction.None
|
||||
var destination_angle : float
|
||||
var target : Node2D = self
|
||||
|
||||
|
|
@ -34,10 +34,10 @@ func _physics_process(delta):
|
|||
func _on_collision(body):
|
||||
match body.collision_layer:
|
||||
1:
|
||||
if body.faction != faction:
|
||||
if body.ship.faction != faction:
|
||||
if target != self:
|
||||
target.queue_free()
|
||||
body.shield.deal_damage(damage,global_position)
|
||||
body.ship.shield.deal_damage(damage)
|
||||
queue_free()
|
||||
2:
|
||||
if target != self:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue