added breakable blocks

This commit is contained in:
Booklordofthedings 2024-08-18 18:41:22 +02:00
parent 886c7a7233
commit 1c540be7c3
3 changed files with 44 additions and 6 deletions

View file

@ -0,0 +1,14 @@
extends CharacterBody2D
func _physics_process(delta: float) -> void:
move_and_slide()
if(get_slide_collision_count() > 0):
for i in get_slide_collision_count():
var box = get_slide_collision(i).get_collider() as Node2D
if box.scale.x == 2:
var timer = Timer.new()
self.add_child(timer)
timer.connect("timeout", queue_free)
timer.set_wait_time(1)
timer.start()