mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-26 17:30:54 +00:00
31 lines
727 B
GDScript
31 lines
727 B
GDScript
class_name BrickBlock
|
|
extends Block
|
|
|
|
var ticking_down := false
|
|
|
|
func check_brick_empty() -> void:
|
|
$PSwitcher.enabled = item == null
|
|
|
|
func on_block_hit(player: Player) -> void:
|
|
if player.power_state.hitbox_size == "Big":
|
|
if item == null:
|
|
self.add_collision_exception_with(player) # Don't bonk with physics, will be handled after block is broken
|
|
await get_tree().physics_frame
|
|
destroy()
|
|
Global.score += 50
|
|
if item != null:
|
|
if mushroom_if_small:
|
|
item = player_mushroom_check(player)
|
|
dispense_item()
|
|
|
|
func on_shell_block_hit(_shell: Shell) -> void:
|
|
if item == null:
|
|
await get_tree().physics_frame
|
|
destroy()
|
|
Global.score += 50
|
|
else:
|
|
dispense_item()
|
|
|
|
func set_coin_count() -> void:
|
|
item_amount = 2
|