mirror of
				https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
				synced 2025-10-26 09:20:49 +00:00 
			
		
		
		
	 8b5d9afba9
			
		
	
	8b5d9afba9
	
	
	
		
			
			This PR adds animated tilesets! I spent the day working on these, and it wasn't easy. This is primarily to help animate the All-Stars' grass tiles. You should be able to animate the other tilesets as well, but I haven't tested them. JSONs are provided in the assets for Conveyer Belts and Liquids. There's two ways to animate the tilesets. The first is by the traditional way as used by `AnimatedSprite2D`, and the other is by how Godot animates tilesets normally as seen with the conveyer belts and liquids. The last thing is that while doing this, I actually managed to fix the Resource Pack bug where reloading also reloads the blocks! It was surprisingly straightforward. I just edited the `BlockClass.gd` file to erase the cells when a block is hit or destroyed. Let me know if you have any suggestions for things I should change or fix.
		
			
				
	
	
		
			93 lines
		
	
	
		
			3.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			93 lines
		
	
	
		
			3.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| [gd_scene load_steps=11 format=4 uid="uid://qn4g0qkjcuiy"]
 | |
| 
 | |
| [ext_resource type="Script" uid="uid://cdvxqkeqa7en5" path="res://Scripts/Parts/CastleVisual.gd" id="1_oxmfh"]
 | |
| [ext_resource type="Texture2D" uid="uid://dt0qtxu2l646n" path="res://Assets/Sprites/Tilesets/Terrain/Overworld.png" id="2_tt5sy"]
 | |
| [ext_resource type="Script" uid="uid://73oviwf6bbys" path="res://Scripts/Classes/Components/TilesetTextureSetter.gd" id="2_ulvy5"]
 | |
| [ext_resource type="JSON" path="res://Assets/Sprites/Tilesets/Terrain/TerrainTiles.json" id="5_my1op"]
 | |
| [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="7_vjwyw"]
 | |
| [ext_resource type="JSON" path="res://Assets/Sprites/Tilesets/SmallCastle.json" id="8_tt5sy"]
 | |
| 
 | |
| [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_80q5s"]
 | |
| texture = ExtResource("2_tt5sy")
 | |
| 5:10/0 = 0
 | |
| 6:10/0 = 0
 | |
| 6:7/0 = 0
 | |
| 7:7/0 = 0
 | |
| 3:10/0 = 0
 | |
| 4:10/0 = 0
 | |
| 
 | |
| [sub_resource type="TileSet" id="TileSet_0n6c4"]
 | |
| sources/0 = SubResource("TileSetAtlasSource_80q5s")
 | |
| 
 | |
| [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_oxmfh"]
 | |
| texture = ExtResource("2_tt5sy")
 | |
| texture_region_size = Vector2i(8, 8)
 | |
| 5:10/0 = 0
 | |
| 6:10/0 = 0
 | |
| 7:10/0 = 0
 | |
| 8:10/0 = 0
 | |
| 6:7/0 = 0
 | |
| 7:7/0 = 0
 | |
| 7:20/0 = 0
 | |
| 
 | |
| [sub_resource type="TileSet" id="TileSet_vjwyw"]
 | |
| tile_size = Vector2i(8, 8)
 | |
| sources/0 = SubResource("TileSetAtlasSource_oxmfh")
 | |
| 
 | |
| [node name="SmallCastleVisual" type="Node2D" node_paths=PackedStringArray("sprite")]
 | |
| process_mode = 3
 | |
| z_index = -5
 | |
| script = ExtResource("1_oxmfh")
 | |
| sprite = NodePath("Sprite")
 | |
| 
 | |
| [node name="Tiles" type="TileMapLayer" parent="."]
 | |
| position = Vector2(-8, 8)
 | |
| tile_map_data = PackedByteArray("AAD+////AAAGAAcAAAD+/wAAAAAHAAcAAAD+/wEAAAAHAAcAAAD///7/AAADAAoAAAD/////AAAFAAoAAAD//wAAAAAHAAcAAAD//wEAAAAHAAcAAAAAAP7/AAAHAAcAAAAAAP//AAAFAAoAAAAAAAAAAAAGAAoAAAABAP7/AAAEAAoAAAABAP//AAAFAAoAAAABAAAAAAAHAAcAAAABAAEAAAAHAAcAAAACAP//AAAGAAcAAAACAAAAAAAHAAcAAAACAAEAAAAHAAcAAAD///3/AAAGAAcAAAAAAP3/AAAGAAcAAAABAP3/AAAGAAcAAAA=")
 | |
| tile_set = SubResource("TileSet_0n6c4")
 | |
| 
 | |
| [node name="TilesetTextureSetter" type="Node" parent="Tiles" node_paths=PackedStringArray("tile_map", "resource_setter")]
 | |
| script = ExtResource("2_ulvy5")
 | |
| tile_map = NodePath("..")
 | |
| resource_setter = NodePath("ResourceSetterNew")
 | |
| metadata/_custom_type_script = "uid://73oviwf6bbys"
 | |
| 
 | |
| [node name="ResourceSetterNew" type="Node" parent="Tiles/TilesetTextureSetter" node_paths=PackedStringArray("node_to_affect")]
 | |
| script = ExtResource("7_vjwyw")
 | |
| node_to_affect = NodePath("..")
 | |
| property_name = "texture"
 | |
| mode = 1
 | |
| resource_json = ExtResource("5_my1op")
 | |
| metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
 | |
| 
 | |
| [node name="BG" type="TileMapLayer" parent="Tiles"]
 | |
| show_behind_parent = true
 | |
| tile_map_data = PackedByteArray("AAAAAAAAAAAHABQAAAAAAAEAAAAHABQAAAAAAAIAAAAHABQAAAAAAAMAAAAHABQAAAABAAAAAAAHABQAAAABAAEAAAAHABQAAAABAAIAAAAHABQAAAABAAMAAAAHABQAAAA=")
 | |
| tile_set = SubResource("TileSet_vjwyw")
 | |
| 
 | |
| [node name="TilesetTextureSetter" type="Node" parent="Tiles/BG" node_paths=PackedStringArray("tile_map", "resource_setter")]
 | |
| script = ExtResource("2_ulvy5")
 | |
| tile_map = NodePath("..")
 | |
| resource_setter = NodePath("ResourceSetterNew")
 | |
| metadata/_custom_type_script = "uid://73oviwf6bbys"
 | |
| 
 | |
| [node name="ResourceSetterNew" type="Node" parent="Tiles/BG/TilesetTextureSetter" node_paths=PackedStringArray("node_to_affect")]
 | |
| script = ExtResource("7_vjwyw")
 | |
| node_to_affect = NodePath("..")
 | |
| property_name = "texture"
 | |
| mode = 1
 | |
| resource_json = ExtResource("5_my1op")
 | |
| metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
 | |
| 
 | |
| [node name="Sprite" type="Sprite2D" parent="."]
 | |
| hframes = 2
 | |
| region_rect = Rect2(0, 0, 80, 80)
 | |
| 
 | |
| [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect", "property_node")]
 | |
| script = ExtResource("7_vjwyw")
 | |
| node_to_affect = NodePath("..")
 | |
| property_node = NodePath("../..")
 | |
| property_name = "texture"
 | |
| mode = 1
 | |
| resource_json = ExtResource("8_tt5sy")
 | |
| metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
 |