same as below

This commit is contained in:
Ultrablob 2025-02-05 14:05:36 -05:00
parent 2164eade29
commit cb0ffac056
1674 changed files with 29651 additions and 93 deletions

View file

@ -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)