added the game

This commit is contained in:
JHDev2006
2025-09-13 16:30:32 +01:00
parent 5ef689109b
commit 3773bdaf64
3616 changed files with 263702 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
extends Block
var active := false
static var has_hit := false
func _ready() -> void:
can_hit = true
has_hit = false
func on_block_hit() -> void:
if can_hit == false or has_hit:
return
has_hit = true
AudioManager.play_sfx("switch", global_position)
can_hit = false
get_tree().call_group("BooBlocks", "on_switch_hit")
await get_tree().create_timer(0.25, false).timeout
can_hit = true
has_hit = false
func on_switch_hit() -> void:
active = not active
if active:
$Sprite.play("On")
else:
$Sprite.play("Off")
func on_boo_hit() -> void:
if active:
return
AudioManager.play_global_sfx("switch")
get_tree().call_group("BooBlocks", "on_switch_hit")