Skip to content

Commit

Permalink
Mario levels initial cut (#136)
Browse files Browse the repository at this point in the history
Merging the initial level layout (world_overall and copper_kettle_interior scenes)
  • Loading branch information
mmergola authored Dec 9, 2024
1 parent 8350c12 commit 2099a11
Show file tree
Hide file tree
Showing 9 changed files with 430 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ mono_crash.*.json

# personal configs
.vscode/

#Builds Folder
builds/
251 changes: 250 additions & 1 deletion Art/Environment/ext_simple_tileset.tres
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
[gd_resource type="TileSet" load_steps=7 format=3 uid="uid://c72m3jled4jfg"]
[gd_resource type="TileSet" load_steps=13 format=3 uid="uid://c72m3jled4jfg"]

[ext_resource type="Texture2D" uid="uid://bw8g5hunfu3yq" path="res://Art/Environment/simple_tileset_ext.png" id="1_rluj2"]
[ext_resource type="Texture2D" uid="uid://v8wedauptprb" path="res://ZZ_Scratch/GreyboxingTools/template_tileset.png" id="2_xidid"]

[sub_resource type="TileMapPattern" id="TileMapPattern_f1vp3"]
tile_data = PackedInt32Array(65536, 1, 2, 1, 1, 2, 65537, 131073, 1)

[sub_resource type="TileMapPattern" id="TileMapPattern_5ikqu"]
tile_data = PackedInt32Array(0, 131073, 2, 65536, 65537, 1, 65537, 131073, 2)

[sub_resource type="TileMapPattern" id="TileMapPattern_8adh4"]
tile_data = PackedInt32Array(0, 1, 4, 1, 131073, 0, 65537, 1, 4)

[sub_resource type="TileMapPattern" id="TileMapPattern_x7xjg"]
tile_data = PackedInt32Array(0, 65537, 0, 65536, 131073, 4, 1, 131073, 4)

[sub_resource type="OccluderPolygon2D" id="OccluderPolygon2D_jit1n"]

Expand Down Expand Up @@ -61,8 +74,244 @@ texture_region_size = Vector2i(32, 32)
2:1/0/physics_layer_0/angular_velocity = 0.0
2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)

[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_vy1vm"]
texture = ExtResource("2_xidid")
texture_region_size = Vector2i(32, 32)
9:0/size_in_atlas = Vector2i(3, 3)
9:0/0 = 0
9:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
9:0/0/physics_layer_0/angular_velocity = 0.0
9:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 16, -16, 40, 16, 40, 16, 16)
9:3/size_in_atlas = Vector2i(3, 3)
9:3/0 = 0
9:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
9:3/0/physics_layer_0/angular_velocity = 0.0
5:5/0 = 0
5:5/0/physics_layer_0/linear_velocity = Vector2(0, 0)
5:5/0/physics_layer_0/angular_velocity = 0.0
4:5/0 = 0
4:5/0/physics_layer_0/linear_velocity = Vector2(0, 0)
4:5/0/physics_layer_0/angular_velocity = 0.0
3:5/0 = 0
3:5/0/physics_layer_0/linear_velocity = Vector2(0, 0)
3:5/0/physics_layer_0/angular_velocity = 0.0
2:5/0 = 0
2:5/0/physics_layer_0/linear_velocity = Vector2(0, 0)
2:5/0/physics_layer_0/angular_velocity = 0.0
1:5/0 = 0
1:5/0/physics_layer_0/linear_velocity = Vector2(0, 0)
1:5/0/physics_layer_0/angular_velocity = 0.0
0:5/0 = 0
0:5/0/physics_layer_0/linear_velocity = Vector2(0, 0)
0:5/0/physics_layer_0/angular_velocity = 0.0
0:2/0 = 0
0:2/0/terrain_set = 0
0:2/0/terrain = 0
0:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
0:2/0/physics_layer_0/angular_velocity = 0.0
0:2/0/terrains_peering_bit/bottom_right_corner = 0
1:2/0 = 0
1:2/0/terrain_set = 0
1:2/0/terrain = 0
1:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
1:2/0/physics_layer_0/angular_velocity = 0.0
1:2/0/terrains_peering_bit/bottom_right_corner = 0
1:2/0/terrains_peering_bit/bottom_left_corner = 0
2:2/0 = 0
2:2/0/terrain_set = 0
2:2/0/terrain = 0
2:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
2:2/0/physics_layer_0/angular_velocity = 0.0
2:2/0/terrains_peering_bit/bottom_left_corner = 0
2:3/0 = 0
2:3/0/terrain_set = 0
2:3/0/terrain = 0
2:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
2:3/0/physics_layer_0/angular_velocity = 0.0
2:3/0/terrains_peering_bit/bottom_left_corner = 0
2:3/0/terrains_peering_bit/top_left_corner = 0
1:3/0 = 0
1:3/0/terrain_set = 0
1:3/0/terrain = 0
1:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
1:3/0/physics_layer_0/angular_velocity = 0.0
1:3/0/terrains_peering_bit/bottom_right_corner = 0
1:3/0/terrains_peering_bit/bottom_left_corner = 0
1:3/0/terrains_peering_bit/top_left_corner = 0
1:3/0/terrains_peering_bit/top_right_corner = 0
0:3/0 = 0
0:3/0/terrain_set = 0
0:3/0/terrain = 0
0:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
0:3/0/physics_layer_0/angular_velocity = 0.0
0:3/0/terrains_peering_bit/bottom_right_corner = 0
0:3/0/terrains_peering_bit/top_right_corner = 0
0:4/0 = 0
0:4/0/terrain_set = 0
0:4/0/terrain = 0
0:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
0:4/0/physics_layer_0/angular_velocity = 0.0
0:4/0/terrains_peering_bit/top_right_corner = 0
1:4/0 = 0
1:4/0/terrain_set = 0
1:4/0/terrain = 0
1:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
1:4/0/physics_layer_0/angular_velocity = 0.0
1:4/0/terrains_peering_bit/top_left_corner = 0
1:4/0/terrains_peering_bit/top_right_corner = 0
2:4/0 = 0
2:4/0/terrain_set = 0
2:4/0/terrain = 0
2:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
2:4/0/physics_layer_0/angular_velocity = 0.0
2:4/0/terrains_peering_bit/top_left_corner = 0
3:4/0 = 0
3:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
3:4/0/physics_layer_0/angular_velocity = 0.0
4:4/0 = 0
4:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
4:4/0/physics_layer_0/angular_velocity = 0.0
5:4/0 = 0
5:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
5:4/0/physics_layer_0/angular_velocity = 0.0
3:2/0 = 0
3:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
3:2/0/physics_layer_0/angular_velocity = 0.0
4:2/0 = 0
4:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
4:2/0/physics_layer_0/angular_velocity = 0.0
4:3/0 = 0
4:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
4:3/0/physics_layer_0/angular_velocity = 0.0
5:3/0 = 0
5:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
5:3/0/physics_layer_0/angular_velocity = 0.0
5:2/0 = 0
5:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
5:2/0/physics_layer_0/angular_velocity = 0.0
6:4/0 = 0
6:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
6:4/0/physics_layer_0/angular_velocity = 0.0
7:4/0 = 0
7:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
7:4/0/physics_layer_0/angular_velocity = 0.0
8:4/0 = 0
8:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
8:4/0/physics_layer_0/angular_velocity = 0.0
8:3/0 = 0
8:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
8:3/0/physics_layer_0/angular_velocity = 0.0
7:3/0 = 0
7:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
7:3/0/physics_layer_0/angular_velocity = 0.0
6:3/0 = 0
6:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
6:3/0/physics_layer_0/angular_velocity = 0.0
7:2/0 = 0
7:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
7:2/0/physics_layer_0/angular_velocity = 0.0
8:2/0 = 0
8:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
8:2/0/physics_layer_0/angular_velocity = 0.0
6:2/0 = 0
6:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
6:2/0/physics_layer_0/angular_velocity = 0.0
8:1/0 = 0
8:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
8:1/0/physics_layer_0/angular_velocity = 0.0
8:0/0 = 0
8:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
8:0/0/physics_layer_0/angular_velocity = 0.0
7:0/0 = 0
7:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
7:0/0/physics_layer_0/angular_velocity = 0.0
7:1/0 = 0
7:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
7:1/0/physics_layer_0/angular_velocity = 0.0
6:0/0 = 0
6:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
6:0/0/physics_layer_0/angular_velocity = 0.0
5:0/0 = 0
5:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
5:0/0/physics_layer_0/angular_velocity = 0.0
6:1/0 = 0
6:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
6:1/0/physics_layer_0/angular_velocity = 0.0
5:1/0 = 0
5:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
5:1/0/physics_layer_0/angular_velocity = 0.0
4:1/0 = 0
4:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
4:1/0/physics_layer_0/angular_velocity = 0.0
4:0/0 = 0
4:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
4:0/0/physics_layer_0/angular_velocity = 0.0
3:0/0 = 0
3:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
3:0/0/physics_layer_0/angular_velocity = 0.0
3:1/0 = 0
3:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
3:1/0/physics_layer_0/angular_velocity = 0.0
2:1/0 = 0
2:1/0/terrain_set = 0
2:1/0/terrain = 0
2:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
2:1/0/physics_layer_0/angular_velocity = 0.0
2:1/0/terrains_peering_bit/bottom_right_corner = 0
2:1/0/terrains_peering_bit/bottom_left_corner = 0
2:1/0/terrains_peering_bit/top_right_corner = 0
2:0/0 = 0
2:0/0/terrain_set = 0
2:0/0/terrain = 0
2:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
2:0/0/physics_layer_0/angular_velocity = 0.0
2:0/0/terrains_peering_bit/bottom_right_corner = 0
2:0/0/terrains_peering_bit/top_left_corner = 0
2:0/0/terrains_peering_bit/top_right_corner = 0
1:1/0 = 0
1:1/0/terrain_set = 0
1:1/0/terrain = 0
1:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
1:1/0/physics_layer_0/angular_velocity = 0.0
1:1/0/terrains_peering_bit/bottom_right_corner = 0
1:1/0/terrains_peering_bit/bottom_left_corner = 0
1:1/0/terrains_peering_bit/top_left_corner = 0
0:1/0 = 0
0:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
0:1/0/physics_layer_0/angular_velocity = 0.0
0:0/0 = 0
0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
0:0/0/physics_layer_0/angular_velocity = 0.0
1:0/0 = 0
1:0/0/terrain_set = 0
1:0/0/terrain = 0
1:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
1:0/0/physics_layer_0/angular_velocity = 0.0
1:0/0/terrains_peering_bit/bottom_left_corner = 0
1:0/0/terrains_peering_bit/top_left_corner = 0
1:0/0/terrains_peering_bit/top_right_corner = 0
3:3/0 = 0
3:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
3:3/0/physics_layer_0/angular_velocity = 0.0
3:8/0 = 0
3:8/0/physics_layer_0/linear_velocity = Vector2(0, 0)
3:8/0/physics_layer_0/angular_velocity = 0.0
2:6/size_in_atlas = Vector2i(2, 2)
2:6/0 = 0
2:6/0/physics_layer_0/linear_velocity = Vector2(0, 0)
2:6/0/physics_layer_0/angular_velocity = 0.0
2:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)

[resource]
tile_size = Vector2i(32, 32)
occlusion_layer_0/light_mask = 2
physics_layer_0/collision_layer = 1
terrain_set_0/mode = 1
terrain_set_0/terrain_0/name = "path"
terrain_set_0/terrain_0/color = Color(0.929412, 0.247059, 0.921569, 1)
sources/0 = SubResource("TileSetAtlasSource_d3tyy")
sources/1 = SubResource("TileSetAtlasSource_vy1vm")
pattern_0 = SubResource("TileMapPattern_f1vp3")
pattern_1 = SubResource("TileMapPattern_5ikqu")
pattern_2 = SubResource("TileMapPattern_8adh4")
pattern_3 = SubResource("TileMapPattern_x7xjg")
2 changes: 1 addition & 1 deletion Scenes/Driver.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=3 uid="uid://d4cnh54npmjiv"]
[gd_scene load_steps=17 format=3 uid="uid://cobsc7v0oqc8l"]

[ext_resource type="Script" path="res://Scripts/Driver.gd" id="1_agcjs"]
[ext_resource type="Script" path="res://Scripts/AudioManager.gd" id="2_4seev"]
Expand Down
97 changes: 97 additions & 0 deletions Scenes/Levels/copper_kettle_interior.tscn

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions Scenes/Levels/world_overall.tscn

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Scripts/Driver.gd
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ func free_previous_level() -> void:

## Loads a new level into the game world. Connected to SerilizationManager.gd: load_saved_level
func load_level(target_level_name: String, target_name: String) -> void:
assert(target_level_name != "", "Level to load must not be empty")

var packed_level: PackedScene
var new_level: LevelBase

Expand Down
26 changes: 26 additions & 0 deletions Scripts/Utils.gd
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ static func _angle_to_direction_4(angle_rad: float) -> Enums.Direction:
return Enums.Direction.SOUTH


static func level_path_to_name(path: String) -> String:
if path.begins_with("res://"):
path = path.substr(0, Utils.LEVEL_DIR.length())
path = path.substr(0, path.length() - 5)
return path


## Used for getting persistent levels and loading saved levels [b]NOT[/b] the original levels
static func level_to_path_binary(level_name: String) -> String:
return USER_DATA_DIR + SAVE_FOLDER + LEVEL_FOLDER + level_name + LEVEL_EXT_BIN
Expand All @@ -115,3 +122,22 @@ static func user_level_dir() -> String:

static func user_inventory_dir() -> String:
return USER_DATA_DIR + SAVE_FOLDER + INVENTORY_FOLDER


static func walk_directory(root: String, pred_fn: Callable) -> Array[String]:
var da := DirAccess.open(root)
if da == null:
printerr("Unable to open %s: %s", [root, DirAccess.get_open_error()])
return []

var results: Array[String] = []

da.list_dir_begin()
var file_name := da.get_next()
while file_name != "":
if pred_fn == null || pred_fn.call(file_name):
results.append(file_name)
file_name = da.get_next()
da.list_dir_end()

return results
11 changes: 10 additions & 1 deletion ZZ_Scratch/ScratchScenes.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,13 @@ const SCENES = {"Greyboxing": "BadLevelA"}
## [br]
## For details of how this works see Driver.request_debug_load
static func get_scenes() -> Dictionary:
return SCENES
var opts := Utils.walk_directory(
Utils.LEVEL_DIR, func(s: String) -> bool: return s.ends_with(".tscn")
)

var result := {}
for a in opts:
var v := Utils.level_path_to_name(a)
result[v] = v

return result
4 changes: 2 additions & 2 deletions addons/tgo_greyboxing/plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var _interactable_plugin: EditorInspectorPlugin
func _enter_tree() -> void:
_load_scene()
_editor = get_editor_interface()
_interactable_plugin = preload("res://addons_tgo/editors/tgo_inspector_interactable.gd").new()
_interactable_plugin = load("res://addons_tgo/editors/tgo_inspector_interactable.gd").new()
add_inspector_plugin(_interactable_plugin)


Expand All @@ -39,4 +39,4 @@ func reload() -> void:

func _exit_tree() -> void:
_unload_scene()
remove_inspector_plugin(_interactable_plugin)
remove_inspector_plugin(_interactable_plugin)

0 comments on commit 2099a11

Please sign in to comment.