re-implemented the respawning blocks + items fix, and got rid of a few annoying prints + removed the warning from the resource pack menu in the settings, as its no longer needed

This commit is contained in:
JoeMama
2025-10-10 11:26:09 +01:00
parent 437f98884d
commit 57a659ba34
6 changed files with 154 additions and 40 deletions

View File

@@ -86,6 +86,8 @@ func spawn_empty_block() -> void:
if get_parent().get_parent() is TrackRider:
get_parent().get_parent().attached_entity = block
block_emptied.emit()
if get_parent() is TileMapLayer:
get_parent().erase_cell(get_parent().local_to_map(position))
queue_free()
func destroy() -> void:
@@ -94,5 +96,7 @@ func destroy() -> void:
AudioManager.play_sfx("block_break", global_position)
var particles = destruction_particle_scene.instantiate()
particles.global_position = global_position
if get_parent() is TileMapLayer:
get_parent().erase_cell(get_parent().local_to_map(position))
add_sibling(particles)
queue_free()

View File

@@ -57,7 +57,6 @@ func update_resource() -> void:
cache.clear()
property_cache.clear()
if node_to_affect != null:
print(resource_json.data)
var resource = get_resource(resource_json)
node_to_affect.set(property_name, resource)
if node_to_affect is AnimatedSprite2D:
@@ -210,7 +209,6 @@ func get_variation_json(json := {}) -> Dictionary:
var campaign = Global.current_campaign
if force_properties.has("Campaign"):
is_random = true
campaign = force_properties.Campaign
if json.has(campaign) == false:
campaign = "SMB1"
@@ -226,9 +224,7 @@ func get_variation_json(json := {}) -> Dictionary:
var world = "World" + str(Global.world_num)
if force_properties.has("World"):
is_random = true
world = "World" + str(force_properties.World)
print(world)
if json.has(world) == false:
world = "World1"
if json.has(world):
@@ -332,8 +328,6 @@ func load_image_from_path(path := "") -> Texture2D:
return null
return load(path)
var image = Image.new()
if path == "":
print([path, owner.name])
image.load(path)
return ImageTexture.create_from_image(image)

View File

@@ -16,7 +16,6 @@ func _ready() -> void:
texture_changed.connect(update)
func update() -> void:
print(name)
var source = tile_map.tile_set.get_source(atlas_id)
if source != null:
source.texture = texture

View File

@@ -24,12 +24,16 @@ func collect() -> void:
$Sprite.queue_free()
else:
queue_free()
if get_parent() is TileMapLayer:
get_parent().erase_cell(get_parent().local_to_map(position))
func summon_block_coin() -> void:
var node = spinning_coin_scene.instantiate()
node.global_position = global_position
add_sibling(node)
queue_free()
if get_parent() is TileMapLayer:
get_parent().erase_cell(get_parent().local_to_map(position))
func summon_particle() -> void:
var node = COIN_SPARKLE.instantiate()