Made kamikaze behavior and also fixed borders
This commit is contained in:
parent
ac263a1e65
commit
1ee0b529a8
10 changed files with 41 additions and 44 deletions
|
|
@ -52,9 +52,12 @@ func _physics_process(_delta):
|
|||
ship.rotation = rotation
|
||||
scalar_velocity = linear_velocity.length()
|
||||
|
||||
func _on_body_entered(_body):
|
||||
func _on_body_entered(body):
|
||||
if scalar_velocity >= velocity_collision_treshold:
|
||||
ship.shield.deal_damage(20.0 * (scalar_velocity / velocity_collision_treshold))
|
||||
var damage = collision_damage * (scalar_velocity / velocity_collision_treshold)
|
||||
ship.shield.deal_damage(damage)
|
||||
if body is Ship:
|
||||
body.shield.deal_damage(damage / 2)
|
||||
|
||||
func warp_to_position(location: Vector2):
|
||||
position = location
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue