mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
added the game
This commit is contained in:
31
Scripts/Classes/Blocks/BrickBlock.gd
Normal file
31
Scripts/Classes/Blocks/BrickBlock.gd
Normal file
@@ -0,0 +1,31 @@
|
||||
class_name BrickBlock
|
||||
extends Block
|
||||
|
||||
var ticking_down := false
|
||||
|
||||
func _ready() -> void:
|
||||
$PSwitcher.enabled = item == null
|
||||
if item_amount == 10 and item.resource_path == "res://Scenes/Prefabs/Entities/Items/SpinningCoin.tscn" and is_instance_valid(Global.level_editor) == false:
|
||||
Global.log_warning("Coin Brick Block is wrong! please report!: " + name)
|
||||
|
||||
func on_block_hit(player: Player) -> void:
|
||||
if player.power_state.hitbox_size == "Big":
|
||||
if item == null:
|
||||
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
|
Reference in New Issue
Block a user