diff --git a/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg b/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg index fd35881..52d505a 100644 --- a/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg +++ b/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg @@ -8,7 +8,7 @@ Anim={ "grid_snap_active": false, "grid_step": Vector2(8, 8), "grid_visibility": 1, -"ofs": Vector2(-19.5273, -24.3545), +"ofs": Vector2(-19.4496, -23.9958), "primary_grid_step": Vector2i(8, 8), "show_edit_locks": true, "show_guides": true, @@ -172,4 +172,4 @@ Anim={ "zfar": 4000.01, "znear": 0.05 } -selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/CharacterBody2D")]) +selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Game")]) diff --git a/.godot/editor/bullet.tscn-folding-6d8e6ff1e6f20a36e0402d27c623c86c.cfg b/.godot/editor/bullet.tscn-folding-6d8e6ff1e6f20a36e0402d27c623c86c.cfg index 7e454ad..0f358b1 100644 --- a/.godot/editor/bullet.tscn-folding-6d8e6ff1e6f20a36e0402d27c623c86c.cfg +++ b/.godot/editor/bullet.tscn-folding-6d8e6ff1e6f20a36e0402d27c623c86c.cfg @@ -1,5 +1,5 @@ [folding] -node_unfolds=[NodePath("."), PackedStringArray("Transform")] +node_unfolds=[NodePath("."), PackedStringArray("Transform"), NodePath("Sprite2D"), PackedStringArray("Texture")] resource_unfolds=["res://scenes/bullet.tscn::CircleShape2D_1gtqp", PackedStringArray()] nodes_folded=[] diff --git a/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg b/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg index e3f257e..0b2d3d3 100644 --- a/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg +++ b/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg @@ -8,7 +8,7 @@ Anim={ "grid_snap_active": false, "grid_step": Vector2(8, 8), "grid_visibility": 1, -"ofs": Vector2(-253.021, -139.725), +"ofs": Vector2(-234.664, -212.684), "primary_grid_step": Vector2i(8, 8), "show_edit_locks": true, "show_guides": true, @@ -172,4 +172,4 @@ Anim={ "zfar": 4000.01, "znear": 0.05 } -selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/CharacterBody2D")]) +selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Game")]) diff --git a/.godot/editor/crate.tscn-editstate-65637dc57c83dac3d15ec1cb22439bd7.cfg b/.godot/editor/crate.tscn-editstate-65637dc57c83dac3d15ec1cb22439bd7.cfg index f782917..cc999ce 100644 --- a/.godot/editor/crate.tscn-editstate-65637dc57c83dac3d15ec1cb22439bd7.cfg +++ b/.godot/editor/crate.tscn-editstate-65637dc57c83dac3d15ec1cb22439bd7.cfg @@ -172,4 +172,4 @@ Anim={ "zfar": 4000.01, "znear": 0.05 } -selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/CharacterBody2D")]) +selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Game")]) diff --git a/.godot/editor/create_recent.Node b/.godot/editor/create_recent.Node index 748576d..ee8f3fa 100644 --- a/.godot/editor/create_recent.Node +++ b/.godot/editor/create_recent.Node @@ -1,9 +1,11 @@ +Node2D +AnimationPlayer +CollisionShape2D +AnimatableBody2D Sprite2D TileMap Camera2D Node AnimatedSprite2D -Node2D -CollisionShape2D Area2D RayCast2D diff --git a/.godot/editor/editor_layout.cfg b/.godot/editor/editor_layout.cfg index ee9f646..832981f 100644 --- a/.godot/editor/editor_layout.cfg +++ b/.godot/editor/editor_layout.cfg @@ -19,7 +19,7 @@ dock_filesystem_split=0 dock_filesystem_display_mode=0 dock_filesystem_file_sort=0 dock_filesystem_file_list_display_mode=1 -dock_filesystem_selected_paths=PackedStringArray("res://graphics/bullet.png") +dock_filesystem_selected_paths=PackedStringArray("res://scenes/platform.tscn") dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://scripts/", "res://scenes/", "res://graphics/") dock_3="Scene,Import" dock_4="FileSystem" @@ -27,17 +27,17 @@ dock_5="Inspector,Node,History" [EditorNode] -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" +open_scenes=PackedStringArray("res://scenes/game.tscn", "res://scenes/character.tscn", "res://scenes/bullet.tscn", "res://scenes/crate.tscn", "res://scenes/platform.tscn") +current_scene="res://scenes/game.tscn" center_split_offset=-361 selected_default_debugger_tab_idx=0 -selected_main_editor_idx=0 +selected_main_editor_idx=2 selected_bottom_panel_item=0 [ScriptEditor] -open_scripts=["res://scripts/bullet.gd", "res://scripts/CharacterBody2D.gd", "res://scripts/gamecontroller.gd"] -selected_script="res://scripts/CharacterBody2D.gd" +open_scripts=["res://scripts/bullet.gd", "res://scripts/CharacterBody2D.gd", "res://scripts/gamecontroller.gd", "res://scripts/Trigger.gd"] +selected_script="res://scripts/gamecontroller.gd" open_help=[] script_split_offset=70 list_split_offset=0 diff --git a/.godot/editor/filesystem_update4 b/.godot/editor/filesystem_update4 index f34f665..5f56c92 100644 --- a/.godot/editor/filesystem_update4 +++ b/.godot/editor/filesystem_update4 @@ -4,3 +4,5 @@ res://scenes/bullet.tscn res://scenes/crate.tscn res://scripts/CharacterBody2D.gd res://scripts/bullet.gd +res://scenes/platform.tscn +res://scripts/gamecontroller.gd diff --git a/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg b/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg index 5c99c2e..85e0ad9 100644 --- a/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg +++ b/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg @@ -8,7 +8,7 @@ Anim={ "grid_snap_active": false, "grid_step": Vector2(8, 8), "grid_visibility": 1, -"ofs": Vector2(-128.267, 65.4127), +"ofs": Vector2(17.8379, -194.758), "primary_grid_step": Vector2i(8, 8), "show_edit_locks": true, "show_guides": true, @@ -32,7 +32,7 @@ Anim={ "snap_rotation_step": 0.261799, "snap_scale": false, "snap_scale_step": 0.1, -"zoom": 1.25992 +"zoom": 1.41421 } 3D={ "fov": 70.01, @@ -172,4 +172,4 @@ Anim={ "zfar": 4000.01, "znear": 0.05 } -selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/CharacterBody2D")]) +selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Game")]) diff --git a/.godot/editor/game.tscn-folding-c2a7af834e91ff64325daddf58e45dc0.cfg b/.godot/editor/game.tscn-folding-c2a7af834e91ff64325daddf58e45dc0.cfg index 14b111c..9c633f0 100644 --- a/.godot/editor/game.tscn-folding-c2a7af834e91ff64325daddf58e45dc0.cfg +++ b/.godot/editor/game.tscn-folding-c2a7af834e91ff64325daddf58e45dc0.cfg @@ -1,5 +1,5 @@ [folding] -node_unfolds=[NodePath("."), PackedStringArray("Transform"), NodePath("TileMap"), PackedStringArray("tile_set"), NodePath("level/StaticBody2D"), PackedStringArray("Transform"), NodePath("CharacterBody2D"), PackedStringArray("Transform"), NodePath("CharacterBody2D/Camera2D"), PackedStringArray("Position Smoothing"), NodePath("Area2D"), PackedStringArray("Transform")] +node_unfolds=[NodePath("."), PackedStringArray("Transform"), NodePath("TileMap"), PackedStringArray("tile_set"), NodePath("level/StaticBody2D"), PackedStringArray("Transform"), NodePath("CharacterBody2D"), PackedStringArray("Transform"), NodePath("CharacterBody2D/Camera2D"), PackedStringArray("Position Smoothing"), NodePath("Area2D"), PackedStringArray("Transform"), NodePath("Platform"), PackedStringArray("Transform")] resource_unfolds=["res://scenes/game.tscn::TileSet_25cld", PackedStringArray("terrain_set_0/terrain__array", "physics_layer__array"), "res://scenes/game.tscn::WorldBoundaryShape2D_3u4a8", PackedStringArray("Resource"), "res://scenes/game.tscn::CircleShape2D_x8qck", PackedStringArray("Resource")] nodes_folded=[NodePath("RigidBody2D")] diff --git a/.godot/editor/gamecontroller.gd-folding-f1f331c27a8a747c68def87f3a691aa7.cfg b/.godot/editor/gamecontroller.gd-folding-f1f331c27a8a747c68def87f3a691aa7.cfg new file mode 100644 index 0000000..e860dd4 --- /dev/null +++ b/.godot/editor/gamecontroller.gd-folding-f1f331c27a8a747c68def87f3a691aa7.cfg @@ -0,0 +1,3 @@ +[folding] + +sections_unfolded=PackedStringArray() diff --git a/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg b/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg new file mode 100644 index 0000000..32d2c94 --- /dev/null +++ b/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg @@ -0,0 +1,175 @@ +[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(-273, -156.5), +"primary_grid_step": Vector2i(8, 8), +"show_edit_locks": true, +"show_guides": true, +"show_helpers": false, +"show_origin": 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": 2.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, +"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": 20, +"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": 20, +"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": 20, +"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": 20, +"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@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Game")]) diff --git a/.godot/editor/platform.tscn-folding-cc2f727180cd42d9c13434cb55b1ce69.cfg b/.godot/editor/platform.tscn-folding-cc2f727180cd42d9c13434cb55b1ce69.cfg new file mode 100644 index 0000000..99aa271 --- /dev/null +++ b/.godot/editor/platform.tscn-folding-cc2f727180cd42d9c13434cb55b1ce69.cfg @@ -0,0 +1,5 @@ +[folding] + +node_unfolds=[] +resource_unfolds=["res://scenes/platform.tscn::RectangleShape2D_6aq1q", PackedStringArray()] +nodes_folded=[] diff --git a/.godot/editor/project_metadata.cfg b/.godot/editor/project_metadata.cfg index 5c504fe..e6ab239 100644 --- a/.godot/editor/project_metadata.cfg +++ b/.godot/editor/project_metadata.cfg @@ -10,12 +10,13 @@ tile_snap_subdiv=4.0 run_live_debug=true run_reload_scripts=true -run_debug_collisions=false +run_debug_collisions=true +run_deploy_remote_debug=false [recent_files] -scenes=["res://scenes/crate.tscn", "res://scenes/bullet.tscn", "res://scenes/character.tscn", "res://scenes/game.tscn"] -scripts=["res://scripts/bullet.gd", "res://scripts/CharacterBody2D.gd", "res://scripts/gamecontroller.gd"] +scenes=["res://scenes/platform.tscn", "res://scenes/crate.tscn", "res://scenes/bullet.tscn", "res://scenes/character.tscn", "res://scenes/game.tscn"] +scripts=["res://scripts/Trigger.gd", "res://scripts/bullet.gd", "res://scripts/CharacterBody2D.gd", "res://scripts/gamecontroller.gd"] [linked_properties] @@ -31,6 +32,7 @@ Camera2D:zoom=true Camera2D:scale=true TileMap:scale=true Sprite2D:scale=true +AnimatableBody2D:scale=true [dialog_bounds] diff --git a/.godot/editor/script_editor_cache.cfg b/.godot/editor/script_editor_cache.cfg index 22d3767..91f6caa 100644 --- a/.godot/editor/script_editor_cache.cfg +++ b/.godot/editor/script_editor_cache.cfg @@ -3,11 +3,11 @@ state={ "bookmarks": PackedInt32Array(), "breakpoints": PackedInt32Array(), -"column": 0, +"column": 18, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 15, -"scroll_position": 0.0, +"row": 25, +"scroll_position": 8.0, "selection": false, "syntax_highlighter": "GDScript" } @@ -17,12 +17,16 @@ state={ state={ "bookmarks": PackedInt32Array(), "breakpoints": PackedInt32Array(), -"column": 26, +"column": 3, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 57, -"scroll_position": 42.0, -"selection": false, +"row": 53, +"scroll_position": 76.0, +"selection": true, +"selection_from_column": 3, +"selection_from_line": 53, +"selection_to_column": 53, +"selection_to_line": 53, "syntax_highlighter": "GDScript" } @@ -39,3 +43,17 @@ state={ "selection": false, "syntax_highlighter": "GDScript" } + +[res://scripts/Trigger.gd] + +state={ +"bookmarks": PackedInt32Array(), +"breakpoints": PackedInt32Array(), +"column": 0, +"folded_lines": Array[int]([]), +"h_scroll_position": 0, +"row": 8, +"scroll_position": 0.0, +"selection": false, +"syntax_highlighter": "GDScript" +} diff --git a/.godot/uid_cache.bin b/.godot/uid_cache.bin index be7a1b9..162fa2e 100644 Binary files a/.godot/uid_cache.bin and b/.godot/uid_cache.bin differ diff --git a/scenes/bullet.tscn b/scenes/bullet.tscn index 595ce3f..ebc502f 100644 --- a/scenes/bullet.tscn +++ b/scenes/bullet.tscn @@ -14,6 +14,7 @@ shape = SubResource("CircleShape2D_1gtqp") debug_color = Color(0.721569, 0.337255, 0.854902, 0.419608) [node name="Sprite2D" type="Sprite2D" parent="."] +texture_filter = 1 scale = Vector2(0.102564, 0.102564) texture = ExtResource("2_gi2r6") diff --git a/scenes/game.tscn b/scenes/game.tscn index 902239b..8d6aa9b 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=10 format=3 uid="uid://y083suj12rld"] +[gd_scene load_steps=14 format=3 uid="uid://y083suj12rld"] [ext_resource type="Script" path="res://scripts/gamecontroller.gd" id="1_77wyw"] [ext_resource type="PackedScene" uid="uid://go4yc8hfo1gq" path="res://scenes/character.tscn" id="2_64ccm"] [ext_resource type="Texture2D" uid="uid://c43jfkjw11rsq" path="res://graphics/Terrain (32x32).png" id="2_juhow"] [ext_resource type="Script" path="res://scripts/Trigger.gd" id="2_nfj1w"] [ext_resource type="PackedScene" uid="uid://c8x0bcxa8t74o" path="res://scenes/crate.tscn" id="2_ob312"] +[ext_resource type="PackedScene" uid="uid://cdgbcjrseeoka" path="res://scenes/platform.tscn" id="6_hm88c"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_6otpc"] texture = ExtResource("2_juhow") @@ -493,6 +494,44 @@ sources/0 = SubResource("TileSetAtlasSource_6otpc") [sub_resource type="CircleShape2D" id="CircleShape2D_x8qck"] radius = 60.2993 +[sub_resource type="Animation" id="Animation_ohhmw"] +resource_name = "move" +length = 2.0 +loop_mode = 2 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1.5, 2), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Vector2(141, 290), Vector2(278, 290), Vector2(278, 290)] +} + +[sub_resource type="Animation" id="Animation_5wtmu"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(141, 290)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_uo6r5"] +_data = { +"RESET": SubResource("Animation_5wtmu"), +"move": SubResource("Animation_ohhmw") +} + [node name="Game" type="Node2D"] script = ExtResource("1_77wyw") @@ -507,7 +546,7 @@ position = Vector2(138, 97) [node name="level" type="Node2D" parent="."] [node name="StaticBody2D" type="StaticBody2D" parent="level"] -position = Vector2(231, 418) +position = Vector2(283, 463) metadata/_edit_group_ = true [node name="CollisionShape2D" type="CollisionShape2D" parent="level/StaticBody2D"] @@ -521,7 +560,7 @@ PUSH_FORCE = 550 position_smoothing_speed = 6.5 [node name="Area2D" type="Area2D" parent="."] -position = Vector2(260, 352) +position = Vector2(417, 92) script = ExtResource("2_nfj1w") metadata/_edit_group_ = true @@ -535,5 +574,17 @@ position = Vector2(284, 138) [node name="RigidBody2D3" parent="." instance=ExtResource("2_ob312")] position = Vector2(269, 97) +[node name="Platform" parent="." instance=ExtResource("6_hm88c")] +position = Vector2(141, 290) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="Platform"] +libraries = { +"": SubResource("AnimationLibrary_uo6r5") +} +autoplay = "move" + +[node name="BoxTrap" type="Node2D" parent="."] +position = Vector2(415, -10) + [connection signal="areatrigger" from="Area2D" to="." method="_on_area_2d_areatrigger"] [connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"] diff --git a/scenes/platform.tscn b/scenes/platform.tscn new file mode 100644 index 0000000..5d48b00 --- /dev/null +++ b/scenes/platform.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://cdgbcjrseeoka"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_6aq1q"] +size = Vector2(84, 12) + +[node name="AnimatableBody2D" type="AnimatableBody2D"] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_6aq1q") +one_way_collision = true diff --git a/scripts/gamecontroller.gd b/scripts/gamecontroller.gd index 0ad265d..bef8493 100644 --- a/scripts/gamecontroller.gd +++ b/scripts/gamecontroller.gd @@ -1,5 +1,8 @@ extends Node2D +#preloading crate and marker for box trap +var myBox = preload("res://scenes/crate.tscn") +@onready var box_trap = $BoxTrap # Called when the node enters the scene tree for the first time. func _ready(): @@ -11,5 +14,14 @@ func _process(delta): pass -func _on_area_2d_areatrigger(effect, Object): - print("Game Controller sees the trigger") +func _on_area_2d_areatrigger(effect, body): + print("Game Controller sees the trigger " + effect) + match effect: + "alert": + #do stuff + print("hi") + if body.is_in_group("player"): + for n in 3: + var box = myBox.instantiate() + add_child(box) + box.transform = box_trap.transform