turning box into a scene

This commit is contained in:
OddlyTimbot 2024-09-09 17:36:34 -04:00
parent f9b3966231
commit f489fda77a
15 changed files with 223 additions and 32 deletions

View File

@ -175,4 +175,4 @@ Anim={
"zfar": 4000.01, "zfar": 4000.01,
"znear": 0.05 "znear": 0.05
} }
selected_nodes=Array[NodePath]([]) selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@16886/@Panel@13/@VBoxContainer@14/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@25/DockVSplitCenter/@VSplitContainer@52/@VBoxContainer@53/@PanelContainer@98/MainScreen/@CanvasItemEditor@9272/@VSplitContainer@9094/@HSplitContainer@9096/@HSplitContainer@9098/@Control@9099/@SubViewportContainer@9100/@SubViewport@9101/Game/Crate")])

View File

@ -175,4 +175,4 @@ Anim={
"zfar": 4000.01, "zfar": 4000.01,
"znear": 0.05 "znear": 0.05
} }
selected_nodes=Array[NodePath]([]) selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@16886/@Panel@13/@VBoxContainer@14/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@25/DockVSplitCenter/@VSplitContainer@52/@VBoxContainer@53/@PanelContainer@98/MainScreen/@CanvasItemEditor@9272/@VSplitContainer@9094/@HSplitContainer@9096/@HSplitContainer@9098/@Control@9099/@SubViewportContainer@9100/@SubViewport@9101/Game/Crate")])

View File

@ -0,0 +1,178 @@
[editor_states]
Anim={
"visible": false
}
2D={
"grid_offset": Vector2(0, 0),
"grid_snap_active": false,
"grid_step": Vector2(8, 8),
"grid_visibility": 1,
"ofs": Vector2(-165, -110),
"primary_grid_step": Vector2i(8, 8),
"show_group_gizmos": true,
"show_guides": true,
"show_helpers": false,
"show_lock_gizmos": true,
"show_origin": true,
"show_position_gizmos": true,
"show_rulers": true,
"show_transformation_gizmos": true,
"show_viewport": true,
"show_zoom_control": true,
"smart_snap_active": false,
"snap_guides": true,
"snap_node_anchors": true,
"snap_node_center": true,
"snap_node_parent": true,
"snap_node_sides": true,
"snap_other_nodes": true,
"snap_pixel": true,
"snap_relative": false,
"snap_rotation": false,
"snap_rotation_offset": 0.0,
"snap_rotation_step": 0.261799,
"snap_scale": false,
"snap_scale_step": 0.1,
"zoom": 1.0
}
3D={
"fov": 70.01,
"gizmos_status": {
"AudioListener3D": 0,
"AudioStreamPlayer3D": 0,
"CPUParticles3D": 0,
"CSGShape3D": 0,
"Camera3D": 0,
"CollisionObject3D": 0,
"CollisionPolygon3D": 0,
"CollisionShape3D": 0,
"Decal": 0,
"FogVolume": 0,
"GPUParticles3D": 0,
"GPUParticlesCollision3D": 0,
"Joint3D": 0,
"Light3D": 0,
"LightmapGI": 0,
"LightmapProbe": 0,
"Marker3D": 0,
"MeshInstance3DCustomAABB": 0,
"NavigationLink3D": 0,
"NavigationRegion3D": 0,
"OccluderInstance3D": 0,
"Path3D": 0,
"PhysicalBone3D": 0,
"RayCast3D": 0,
"ReflectionProbe": 0,
"ShapeCast3D": 0,
"Skeleton3D": 0,
"SoftBody3D": 0,
"SpringArm3D": 0,
"VehicleWheel3D": 0,
"VisibleOnScreenNotifier3D": 0,
"VoxelGI": 0
},
"local_coords": false,
"preview_sun_env": {
"environ_ao_enabled": false,
"environ_enabled": true,
"environ_energy": 1.0,
"environ_gi_enabled": false,
"environ_glow_enabled": true,
"environ_ground_color": Color(0.2, 0.169, 0.133, 1),
"environ_sky_color": Color(0.385, 0.454, 0.55, 1),
"environ_tonemap_enabled": true,
"sun_color": Color(1, 1, 1, 1),
"sun_enabled": true,
"sun_energy": 1.0,
"sun_max_distance": 100.0,
"sun_rotation": Vector2(-1.0472, 2.61799)
},
"rotate_snap": 15.0,
"scale_snap": 10.0,
"show_grid": true,
"show_origin": true,
"snap_enabled": false,
"translate_snap": 1.0,
"viewport_mode": 1,
"viewports": [{
"auto_orthogonal": false,
"auto_orthogonal_enabled": true,
"cinematic_preview": false,
"display_mode": 21,
"distance": 4.0,
"doppler": false,
"frame_time": false,
"gizmos": true,
"half_res": false,
"information": false,
"listener": true,
"lock_rotation": false,
"orthogonal": false,
"position": Vector3(0, 0, 0),
"use_environment": false,
"view_type": 0,
"x_rotation": 0.5,
"y_rotation": -0.5
}, {
"auto_orthogonal": false,
"auto_orthogonal_enabled": true,
"cinematic_preview": false,
"display_mode": 21,
"distance": 4.0,
"doppler": false,
"frame_time": false,
"gizmos": true,
"half_res": false,
"information": false,
"listener": false,
"lock_rotation": false,
"orthogonal": false,
"position": Vector3(0, 0, 0),
"use_environment": false,
"view_type": 0,
"x_rotation": 0.5,
"y_rotation": -0.5
}, {
"auto_orthogonal": false,
"auto_orthogonal_enabled": true,
"cinematic_preview": false,
"display_mode": 21,
"distance": 4.0,
"doppler": false,
"frame_time": false,
"gizmos": true,
"half_res": false,
"information": false,
"listener": false,
"lock_rotation": false,
"orthogonal": false,
"position": Vector3(0, 0, 0),
"use_environment": false,
"view_type": 0,
"x_rotation": 0.5,
"y_rotation": -0.5
}, {
"auto_orthogonal": false,
"auto_orthogonal_enabled": true,
"cinematic_preview": false,
"display_mode": 21,
"distance": 4.0,
"doppler": false,
"frame_time": false,
"gizmos": true,
"half_res": false,
"information": false,
"listener": false,
"lock_rotation": false,
"orthogonal": false,
"position": Vector3(0, 0, 0),
"use_environment": false,
"view_type": 0,
"x_rotation": 0.5,
"y_rotation": -0.5
}],
"zfar": 4000.01,
"znear": 0.05
}
selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@16886/@Panel@13/@VBoxContainer@14/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@25/DockVSplitCenter/@VSplitContainer@52/@VBoxContainer@53/@PanelContainer@98/MainScreen/@CanvasItemEditor@9272/@VSplitContainer@9094/@HSplitContainer@9096/@HSplitContainer@9098/@Control@9099/@SubViewportContainer@9100/@SubViewport@9101/Game/Crate")])

View File

@ -0,0 +1,5 @@
[folding]
node_unfolds=[NodePath("CollisionShape2D"), PackedStringArray("Transform")]
resource_unfolds=["res://scenes/crate.tscn::RectangleShape2D_4vo4d", PackedStringArray()]
nodes_folded=[]

View File

@ -4,7 +4,7 @@ dock_1_selected_tab_idx=0
dock_2_selected_tab_idx=0 dock_2_selected_tab_idx=0
dock_3_selected_tab_idx=0 dock_3_selected_tab_idx=0
dock_4_selected_tab_idx=0 dock_4_selected_tab_idx=0
dock_5_selected_tab_idx=1 dock_5_selected_tab_idx=0
dock_6_selected_tab_idx=0 dock_6_selected_tab_idx=0
dock_7_selected_tab_idx=0 dock_7_selected_tab_idx=0
dock_8_selected_tab_idx=0 dock_8_selected_tab_idx=0
@ -19,8 +19,8 @@ dock_filesystem_split=0
dock_filesystem_display_mode=0 dock_filesystem_display_mode=0
dock_filesystem_file_sort=0 dock_filesystem_file_sort=0
dock_filesystem_file_list_display_mode=1 dock_filesystem_file_list_display_mode=1
dock_filesystem_selected_paths=PackedStringArray("res://scripts/SceneManager.gd") dock_filesystem_selected_paths=PackedStringArray("res://scenes/crate.tscn")
dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://") dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://scenes/")
dock_bottom=[] dock_bottom=[]
dock_closed=[] dock_closed=[]
dock_filesystem_h_split_offset=240 dock_filesystem_h_split_offset=240
@ -31,12 +31,12 @@ dock_5="Inspector,Node,History"
[EditorNode] [EditorNode]
open_scenes=PackedStringArray("res://scenes/game.tscn", "res://scenes/character.tscn", "res://scenes/bullet.tscn") open_scenes=PackedStringArray("res://scenes/game.tscn", "res://scenes/character.tscn", "res://scenes/bullet.tscn", "res://scenes/crate.tscn")
current_scene="res://scenes/character.tscn" current_scene="res://scenes/game.tscn"
center_split_offset=0 center_split_offset=0
selected_default_debugger_tab_idx=1 selected_default_debugger_tab_idx=1
selected_main_editor_idx=2 selected_main_editor_idx=0
selected_bottom_panel_item=1 selected_bottom_panel_item=0
[ScriptEditor] [ScriptEditor]

View File

@ -4,3 +4,4 @@ res://scenes/character.tscn
res://scenes/bullet.tscn res://scenes/bullet.tscn
res://scripts/SceneManager.gd res://scripts/SceneManager.gd
res://scripts/bullet.gd res://scripts/bullet.gd
res://scenes/crate.tscn

View File

@ -175,4 +175,4 @@ Anim={
"zfar": 4000.01, "zfar": 4000.01,
"znear": 0.05 "znear": 0.05
} }
selected_nodes=Array[NodePath]([]) selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@16886/@Panel@13/@VBoxContainer@14/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@25/DockVSplitCenter/@VSplitContainer@52/@VBoxContainer@53/@PanelContainer@98/MainScreen/@CanvasItemEditor@9272/@VSplitContainer@9094/@HSplitContainer@9096/@HSplitContainer@9098/@Control@9099/@SubViewportContainer@9100/@SubViewport@9101/Game/Crate")])

View File

@ -1,5 +1,5 @@
[folding] [folding]
node_unfolds=[NodePath("."), PackedStringArray("Transform"), NodePath("RigidBody2D"), PackedStringArray("Transform"), NodePath("RigidBody2D/CollisionShape2D"), PackedStringArray("Transform"), NodePath("groundblock"), PackedStringArray("Transform"), NodePath("groundblock/CollisionShape2D"), PackedStringArray("Transform"), NodePath("groundblock2"), PackedStringArray("Transform"), NodePath("groundblock2/CollisionShape2D"), PackedStringArray("Transform"), NodePath("level/groundblock2"), PackedStringArray("Transform"), NodePath("level/groundblock2/CollisionShape2D"), PackedStringArray("Transform"), NodePath("level/groundblock3"), PackedStringArray("Transform"), NodePath("level/groundblock3/CollisionShape2D"), PackedStringArray("Transform"), NodePath("level/StaticBody2D"), PackedStringArray("Transform"), NodePath("CharacterBody2D"), PackedStringArray("Transform"), NodePath("Area2D"), PackedStringArray("Transform")] node_unfolds=[NodePath("."), PackedStringArray("Transform"), NodePath("groundblock"), PackedStringArray("Transform"), NodePath("groundblock/CollisionShape2D"), PackedStringArray("Transform"), NodePath("groundblock2"), PackedStringArray("Transform"), NodePath("groundblock2/CollisionShape2D"), PackedStringArray("Transform"), NodePath("level/groundblock2"), PackedStringArray("Transform"), NodePath("level/groundblock2/CollisionShape2D"), PackedStringArray("Transform"), NodePath("level/groundblock3"), PackedStringArray("Transform"), NodePath("level/groundblock3/CollisionShape2D"), PackedStringArray("Transform"), NodePath("level/StaticBody2D"), PackedStringArray("Transform"), NodePath("CharacterBody2D"), PackedStringArray("Transform"), NodePath("Area2D"), PackedStringArray("Transform")]
resource_unfolds=["res://scenes/game.tscn::RectangleShape2D_4vo4d", PackedStringArray("Resource"), "res://scenes/game.tscn::RectangleShape2D_cq7kj", PackedStringArray("Resource"), "res://scenes/game.tscn::WorldBoundaryShape2D_3u4a8", PackedStringArray("Resource"), "res://scenes/game.tscn::CircleShape2D_x8qck", PackedStringArray("Resource")] resource_unfolds=["res://scenes/game.tscn::RectangleShape2D_cq7kj", PackedStringArray("Resource"), "res://scenes/game.tscn::WorldBoundaryShape2D_3u4a8", PackedStringArray("Resource"), "res://scenes/game.tscn::CircleShape2D_x8qck", PackedStringArray("Resource")]
nodes_folded=[NodePath("RigidBody2D"), NodePath("groundblock"), NodePath("groundblock2"), NodePath("level")] nodes_folded=[NodePath("groundblock"), NodePath("groundblock2"), NodePath("level")]

View File

@ -11,7 +11,7 @@ run_debug_collisions=true
[recent_files] [recent_files]
scenes=["res://scenes/game.tscn", "res://scenes/bullet.tscn", "res://scenes/character.tscn"] scenes=["res://scenes/crate.tscn", "res://scenes/game.tscn", "res://scenes/bullet.tscn", "res://scenes/character.tscn"]
scripts=["res://scripts/Trigger.gd", "res://scripts/bullet.gd", "res://scripts/CharacterBody2D.gd", "res://scripts/gamecontroller.gd"] scripts=["res://scripts/Trigger.gd", "res://scripts/bullet.gd", "res://scripts/CharacterBody2D.gd", "res://scripts/gamecontroller.gd"]
[linked_properties] [linked_properties]

View File

@ -1,2 +1,2 @@
res://scripts
res://scenes res://scenes
res://scripts

View File

@ -7,7 +7,7 @@ state={
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 0,
"row": 41, "row": 41,
"scroll_position": 31.0, "scroll_position": 51.0,
"selection": false, "selection": false,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"
} }
@ -45,10 +45,10 @@ state={
state={ state={
"bookmarks": PackedInt32Array(), "bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(), "breakpoints": PackedInt32Array(),
"column": 0, "column": 19,
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 0,
"row": 21, "row": 25,
"scroll_position": 11.0, "scroll_position": 11.0,
"selection": false, "selection": false,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"

View File

@ -1,3 +1,7 @@
[res://scenes/crate.tscn]
groups=[&"boxes"]
[res://scenes/game.tscn] [res://scenes/game.tscn]
groups=[&"boxes", &"player"] groups=[&"player"]

View File

@ -0,0 +1,11 @@
[gd_scene load_steps=2 format=3 uid="uid://bbr2tfsjefwn3"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4vo4d"]
size = Vector2(55, 55)
[node name="RigidBody2D" type="RigidBody2D" groups=["boxes"]]
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_4vo4d")
debug_color = Color(0.815686, 0.4, 0.207843, 0.419608)

View File

@ -3,9 +3,7 @@
[ext_resource type="Script" path="res://scripts/SceneManager.gd" id="1_77wyw"] [ext_resource type="Script" path="res://scripts/SceneManager.gd" id="1_77wyw"]
[ext_resource type="PackedScene" uid="uid://go4yc8hfo1gq" path="res://scenes/character.tscn" id="2_64ccm"] [ext_resource type="PackedScene" uid="uid://go4yc8hfo1gq" path="res://scenes/character.tscn" id="2_64ccm"]
[ext_resource type="Script" path="res://scripts/Trigger.gd" id="2_nfj1w"] [ext_resource type="Script" path="res://scripts/Trigger.gd" id="2_nfj1w"]
[ext_resource type="PackedScene" uid="uid://bbr2tfsjefwn3" path="res://scenes/crate.tscn" id="4_hkx5g"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4vo4d"]
size = Vector2(55, 55)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cq7kj"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_cq7kj"]
size = Vector2(91, 20) size = Vector2(91, 20)
@ -21,16 +19,6 @@ radius = 60.2993
unique_name_in_owner = true unique_name_in_owner = true
script = ExtResource("1_77wyw") script = ExtResource("1_77wyw")
[node name="RigidBody2D" type="RigidBody2D" parent="." groups=["boxes"]]
position = Vector2(120, 93)
rotation = 0.740513
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"]
rotation = -0.555892
shape = SubResource("RectangleShape2D_4vo4d")
debug_color = Color(0.815686, 0.4, 0.207843, 0.419608)
[node name="groundblock" type="StaticBody2D" parent="."] [node name="groundblock" type="StaticBody2D" parent="."]
position = Vector2(117, 384) position = Vector2(117, 384)
metadata/_edit_group_ = true metadata/_edit_group_ = true
@ -86,5 +74,9 @@ metadata/_edit_group_ = true
shape = SubResource("CircleShape2D_x8qck") shape = SubResource("CircleShape2D_x8qck")
debug_color = Color(0.556863, 0.415686, 0.964706, 0.419608) debug_color = Color(0.556863, 0.415686, 0.964706, 0.419608)
[node name="Crate" parent="." instance=ExtResource("4_hkx5g")]
position = Vector2(141, 131)
rotation = 0.663277
[connection signal="areatrigger" from="Area2D" to="." method="_on_area_2d_areatrigger"] [connection signal="areatrigger" from="Area2D" to="." method="_on_area_2d_areatrigger"]
[connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"] [connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"]