same as below
This commit is contained in:
parent
2164eade29
commit
cb0ffac056
1674 changed files with 29651 additions and 93 deletions
|
@ -8,10 +8,17 @@ func hit(body):
|
|||
body.destroy()
|
||||
else:
|
||||
body.queue_free()
|
||||
spawn_explosion()
|
||||
queue_free()
|
||||
if body.name == "Border":
|
||||
queue_free()
|
||||
spawn_explosion()
|
||||
|
||||
func spawn_explosion():
|
||||
var explosion = load("res://explosion.tscn").instantiate()
|
||||
$"/root/Node2D".add_child(explosion)
|
||||
explosion.global_position = global_position
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _physics_process(delta):
|
||||
apply_central_force((global_position - player.global_position).normalized() * -900)
|
||||
apply_central_force((global_position - (player.global_position + player.linear_velocity * 3)).normalized() * -1200)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue