diff --git a/.godot/editor/badguy.gd-folding-aa3680043b1211abf6e7d6fc641abc10.cfg b/.godot/editor/badguy.gd-folding-aa3680043b1211abf6e7d6fc641abc10.cfg new file mode 100644 index 0000000..e860dd4 --- /dev/null +++ b/.godot/editor/badguy.gd-folding-aa3680043b1211abf6e7d6fc641abc10.cfg @@ -0,0 +1,3 @@ +[folding] + +sections_unfolded=PackedStringArray() diff --git a/.godot/editor/badguy.tscn-editstate-e196a632ea77e9a0d8baa608f164a4d2.cfg b/.godot/editor/badguy.tscn-editstate-e196a632ea77e9a0d8baa608f164a4d2.cfg new file mode 100644 index 0000000..d54a250 --- /dev/null +++ b/.godot/editor/badguy.tscn-editstate-e196a632ea77e9a0d8baa608f164a4d2.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(-52.3034, -21.1039), +"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": 6.3496 +} +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/CharacterBody2D")]) diff --git a/.godot/editor/badguy.tscn-folding-e196a632ea77e9a0d8baa608f164a4d2.cfg b/.godot/editor/badguy.tscn-folding-e196a632ea77e9a0d8baa608f164a4d2.cfg new file mode 100644 index 0000000..0b92a7d --- /dev/null +++ b/.godot/editor/badguy.tscn-folding-e196a632ea77e9a0d8baa608f164a4d2.cfg @@ -0,0 +1,5 @@ +[folding] + +node_unfolds=[NodePath("AnimatedSprite2D"), PackedStringArray("Animation", "sprite_frames", "Texture")] +resource_unfolds=["res://scenes/badguy.tscn::SpriteFrames_uh2us", PackedStringArray(), "res://scenes/badguy.tscn::RectangleShape2D_vdsen", PackedStringArray()] +nodes_folded=[] diff --git a/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg b/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg index 74a1dd6..cc23de8 100644 --- a/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg +++ b/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.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/Game/level/StaticBody2D/CollisionShape2D")]) +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/CharacterBody2D")]) diff --git a/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg b/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg index eb74cb7..1f3ccd9 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(-116.383, -59.1309), +"ofs": Vector2(-103.803, -28.6502), "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": 6.3496 +"zoom": 5.99323 } 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/Game/level/StaticBody2D/CollisionShape2D")]) +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/CharacterBody2D")]) diff --git a/.godot/editor/coin.gd-folding-80a47dad698f065f8d4e0255ce133510.cfg b/.godot/editor/coin.gd-folding-80a47dad698f065f8d4e0255ce133510.cfg new file mode 100644 index 0000000..e860dd4 --- /dev/null +++ b/.godot/editor/coin.gd-folding-80a47dad698f065f8d4e0255ce133510.cfg @@ -0,0 +1,3 @@ +[folding] + +sections_unfolded=PackedStringArray() diff --git a/.godot/editor/coin.tscn-editstate-96b2131180b71dd158e52c5527d22dd4.cfg b/.godot/editor/coin.tscn-editstate-96b2131180b71dd158e52c5527d22dd4.cfg new file mode 100644 index 0000000..44af9cb --- /dev/null +++ b/.godot/editor/coin.tscn-editstate-96b2131180b71dd158e52c5527d22dd4.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(-75.75, -58.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": 4.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/CharacterBody2D")]) diff --git a/.godot/editor/coin.tscn-folding-96b2131180b71dd158e52c5527d22dd4.cfg b/.godot/editor/coin.tscn-folding-96b2131180b71dd158e52c5527d22dd4.cfg new file mode 100644 index 0000000..8c378b7 --- /dev/null +++ b/.godot/editor/coin.tscn-folding-96b2131180b71dd158e52c5527d22dd4.cfg @@ -0,0 +1,5 @@ +[folding] + +node_unfolds=[NodePath("AnimatedSprite2D"), PackedStringArray("Animation", "sprite_frames", "Texture")] +resource_unfolds=["res://scenes/coin.tscn::SpriteFrames_w1v5w", PackedStringArray(), "res://scenes/coin.tscn::CircleShape2D_ngajn", PackedStringArray()] +nodes_folded=[] diff --git a/.godot/editor/crate.tscn-editstate-65637dc57c83dac3d15ec1cb22439bd7.cfg b/.godot/editor/crate.tscn-editstate-65637dc57c83dac3d15ec1cb22439bd7.cfg index db08a9c..935376b 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/Game/level/StaticBody2D/CollisionShape2D")]) +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/CharacterBody2D")]) diff --git a/.godot/editor/create_recent.Node b/.godot/editor/create_recent.Node index a4c571f..395c938 100644 --- a/.godot/editor/create_recent.Node +++ b/.godot/editor/create_recent.Node @@ -1,11 +1,14 @@ -Node2D -AnimationPlayer +Timer +RayCast2D CollisionShape2D -AnimatableBody2D -Sprite2D -Camera2D -TileMap -Node AnimatedSprite2D Area2D -RayCast2D +Node +Sprite2D +ParallaxLayer +ParallaxBackground +Node2D +AnimationPlayer +AnimatableBody2D +Camera2D +TileMap diff --git a/.godot/editor/editor_layout.cfg b/.godot/editor/editor_layout.cfg index 0733aaa..1e32de3 100644 --- a/.godot/editor/editor_layout.cfg +++ b/.godot/editor/editor_layout.cfg @@ -19,24 +19,24 @@ 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://scripts/Trigger.gd") -dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://scripts/", "res://scenes/", "res://graphics/", "res://graphics/items/") +dock_filesystem_selected_paths=PackedStringArray("res://graphics/Player Death/") +dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://scripts/", "res://scenes/", "res://graphics/", "res://graphics/Player Death/", "res://graphics/pickups/", "res://graphics/enemies/") dock_3="Scene,Import" dock_4="FileSystem" 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", "res://scenes/platform.tscn") +open_scenes=PackedStringArray("res://scenes/game.tscn", "res://scenes/character.tscn", "res://scenes/bullet.tscn", "res://scenes/crate.tscn", "res://scenes/platform.tscn", "res://scenes/coin.tscn", "res://scenes/badguy.tscn") current_scene="res://scenes/game.tscn" center_split_offset=-397 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", "res://scripts/Trigger.gd"] +open_scripts=["res://scripts/badguy.gd", "res://scripts/bullet.gd", "res://scripts/CharacterBody2D.gd", "res://scripts/coin.gd", "res://scripts/gamecontroller.gd", "res://scripts/Trigger.gd"] selected_script="res://scripts/gamecontroller.gd" open_help=[] script_split_offset=70 diff --git a/.godot/editor/filesystem_cache8 b/.godot/editor/filesystem_cache8 index b261f54..46fc9ac 100644 --- a/.godot/editor/filesystem_cache8 +++ b/.godot/editor/filesystem_cache8 @@ -1,26 +1,42 @@ ea4bc82a6ad023ab7ee23ee620429895 -::res://::1722291986 -icon.svg::CompressedTexture2D::9114977118871582245::1722289482::1722289482::1::::<><>:: -::res://graphics/::1722289482 -Terrain (32x32).png::CompressedTexture2D::8707534964839485024::1722289482::1722289482::1::::<><>:: -::res://graphics/items/::1722297925 -bullet.png::CompressedTexture2D::4146801143722277085::1722297925::1722297925::1::::<><>:: -cannister.png::CompressedTexture2D::7418095402531000042::1722289482::1722289482::1::::<><>:: -::res://graphics/Player Idle/::1722289482 -Player Idle 48x48.png::CompressedTexture2D::6544563428604246579::1722289482::1722289482::1::::<><>:: -::res://graphics/Player Jump/::1722289482 -player jump 48x48.png::CompressedTexture2D::1627608568707791839::1722289482::1722289482::1::::<><>:: -::res://graphics/Player Land/::1722289482 -player land 48x48.png::CompressedTexture2D::3499637713582873633::1722289482::1722289482::1::::<><>:: -::res://graphics/Player Run/::1722289482 -player run 48x48.png::CompressedTexture2D::1502492849971408816::1722289482::1722289482::1::::<><>:: -::res://scenes/::1722297258 -bullet.tscn::PackedScene::6880909734590904373::1722297258::0::1::::<><>::res://scripts/bullet.gd -character.tscn::PackedScene::451838158579532324::1722297258::0::1::::<><>::res://scripts/CharacterBody2D.gd<>uid://c0iiaebonyhh0::::res://graphics/Player Idle/Player Idle 48x48.png<>uid://xgoqfqmvorcx::::res://graphics/Player Jump/player jump 48x48.png<>uid://vn23qn3f0dvc::::res://graphics/Player Run/player run 48x48.png -crate.tscn::PackedScene::41931541512830250::1722297258::0::1::::<><>::uid://ddxm7hj323fta::::res://graphics/items/cannister.png -game.tscn::PackedScene::1738196330916037717::1722297258::0::1::::<><>::res://scripts/gamecontroller.gd<>uid://go4yc8hfo1gq::::res://scenes/character.tscn<>uid://dwb83f7uoweuy::::res://graphics/Terrain (32x32).png<>res://scripts/Trigger.gd<>uid://ukuu7p7vhlq::::res://scenes/crate.tscn -::res://scripts/::1722293659 -bullet.gd::GDScript::-1::1722289482::0::1::::<>Area2D<>:: -CharacterBody2D.gd::GDScript::-1::1722293659::0::1::::<>CharacterBody2D<>:: -gamecontroller.gd::GDScript::-1::1722289482::0::1::::<>Node2D<>:: -Trigger.gd::GDScript::-1::1722289482::0::1::::<>Area2D<>:: +::res://::1723510012 +icon.svg::CompressedTexture2D::9114977118871582245::1723500937::1723500937::1::::<><>:: +::res://graphics/::1723510012 +Terrain (32x32).png::CompressedTexture2D::8707534964839485024::1723500937::1723500937::1::::<><>:: +::res://graphics/background/::1723502317 +Additional Sky.png::CompressedTexture2D::7405875053565000941::1723501352::1723501363::1::::<><>:: +Additional Water.png::CompressedTexture2D::5548836167267955277::1723501352::1723501363::1::::<><>:: +BG Image.png::CompressedTexture2D::4005256289399045782::1723501352::1723501363::1::::<><>:: +::res://graphics/enemies/::1723506310 +slime_green.png::CompressedTexture2D::1134669905662794867::1723506254::1723506310::1::::<><>:: +slime_purple.png::CompressedTexture2D::3992152575753882488::1723506254::1723506310::1::::<><>:: +::res://graphics/items/::1723500937 +bullet.png::CompressedTexture2D::4146801143722277085::1723500937::1723500937::1::::<><>:: +cannister.png::CompressedTexture2D::7418095402531000042::1723500937::1723500937::1::::<><>:: +::res://graphics/pickups/::1723502549 +coin.png::CompressedTexture2D::3843186516589658432::1723502532::1723502549::1::::<><>:: +::res://graphics/Player Death/::1723510012 +Player Death 64x64.png::CompressedTexture2D::7118346198518807013::1723509990::1723510012::1::::<><>:: +::res://graphics/Player Idle/::1723500937 +Player Idle 48x48.png::CompressedTexture2D::6544563428604246579::1723500937::1723500937::1::::<><>:: +::res://graphics/Player Jump/::1723500937 +player jump 48x48.png::CompressedTexture2D::1627608568707791839::1723500937::1723500937::1::::<><>:: +::res://graphics/Player Land/::1723500937 +player land 48x48.png::CompressedTexture2D::3499637713582873633::1723500937::1723500937::1::::<><>:: +::res://graphics/Player Run/::1723500937 +player run 48x48.png::CompressedTexture2D::1502492849971408816::1723500937::1723500937::1::::<><>:: +::res://scenes/::1723509760 +badguy.tscn::PackedScene::8649992596256653425::1723509760::0::1::::<><>::res://scripts/badguy.gd<>uid://bw43f1enjixbk::::res://graphics/enemies/slime_purple.png +bullet.tscn::PackedScene::6880909734590904373::1723509745::0::1::::<><>::res://scripts/bullet.gd<>uid://b0c0hdt3afypx::::res://graphics/items/bullet.png +character.tscn::PackedScene::451838158579532324::1723509745::0::1::::<><>::res://scripts/CharacterBody2D.gd<>uid://c0iiaebonyhh0::::res://graphics/Player Idle/Player Idle 48x48.png<>uid://xgoqfqmvorcx::::res://graphics/Player Jump/player jump 48x48.png<>uid://vn23qn3f0dvc::::res://graphics/Player Run/player run 48x48.png +coin.tscn::PackedScene::2256142337678812705::1723509745::0::1::::<><>::uid://bu0wyq230xip1::::res://graphics/pickups/coin.png<>res://scripts/coin.gd +crate.tscn::PackedScene::41931541512830250::1723509745::0::1::::<><>::uid://ddxm7hj323fta::::res://graphics/items/cannister.png +game.tscn::PackedScene::1738196330916037717::1723509745::0::1::::<><>::res://scripts/gamecontroller.gd<>uid://go4yc8hfo1gq::::res://scenes/character.tscn<>uid://dwb83f7uoweuy::::res://graphics/Terrain (32x32).png<>res://scripts/Trigger.gd<>uid://bxcf8ryispa5c::::res://graphics/background/BG Image.png<>uid://ddrpxehpjros0::::res://graphics/background/Additional Sky.png<>uid://clb5ryiub2nfh::::res://graphics/background/Additional Water.png<>uid://ukuu7p7vhlq::::res://scenes/crate.tscn<>uid://i3l8y3rbx4o1::::res://scenes/platform.tscn<>uid://7e5lm5ck08k8::::res://scenes/coin.tscn<>uid://dvied5dxkc7e0::::res://scenes/badguy.tscn +platform.tscn::PackedScene::620041448926829138::1723509745::0::1::::<><>:: +::res://scripts/::1723509745 +badguy.gd::GDScript::-1::1723509745::0::1::::<>Area2D<>:: +bullet.gd::GDScript::-1::1723500937::0::1::::<>Area2D<>:: +CharacterBody2D.gd::GDScript::-1::1723500937::0::1::::<>CharacterBody2D<>:: +coin.gd::GDScript::-1::1723504936::0::1::::<>Area2D<>:: +gamecontroller.gd::GDScript::-1::1723509527::0::1::::<>Node<>:: +Trigger.gd::GDScript::-1::1723500937::0::1::::<>Area2D<>:: diff --git a/.godot/editor/filesystem_update4 b/.godot/editor/filesystem_update4 index f13a72f..4f8f9e4 100644 --- a/.godot/editor/filesystem_update4 +++ b/.godot/editor/filesystem_update4 @@ -2,6 +2,9 @@ res://scenes/game.tscn res://scenes/character.tscn res://scenes/bullet.tscn res://scenes/crate.tscn -res://scripts/CharacterBody2D.gd res://scenes/platform.tscn +res://scenes/coin.tscn +res://scenes/badguy.tscn res://scripts/gamecontroller.gd +res://scripts/badguy.gd +res://scripts/CharacterBody2D.gd diff --git a/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg b/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg index cda31ae..a6057cc 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(-383.852, -188.74), +"ofs": Vector2(-267.416, -219.461), "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.18921 +"zoom": 1.12246 } 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/Game/level/StaticBody2D/CollisionShape2D")]) +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/CharacterBody2D")]) diff --git a/.godot/editor/game.tscn-folding-c2a7af834e91ff64325daddf58e45dc0.cfg b/.godot/editor/game.tscn-folding-c2a7af834e91ff64325daddf58e45dc0.cfg index 4bc55d4..61a542f 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"), PackedStringArray("Transform"), NodePath("level/StaticBody2D"), PackedStringArray("Transform"), NodePath("AreaTrigger"), PackedStringArray("Transform"), NodePath("Platform"), PackedStringArray("Transform")] +node_unfolds=[NodePath("."), PackedStringArray("Transform"), NodePath("TileMap"), PackedStringArray("tile_set"), NodePath("ParallaxBackground/ParallaxLayer"), PackedStringArray("Motion"), NodePath("ParallaxBackground/ParallaxLayer/Sprite2D"), PackedStringArray("Transform"), NodePath("ParallaxBackground/ParallaxLayer/Sprite2D2"), PackedStringArray("Transform"), NodePath("ParallaxBackground/ParallaxLayer/Sprite2D3"), PackedStringArray("Transform"), NodePath("level"), PackedStringArray("Transform"), NodePath("level/StaticBody2D"), PackedStringArray("Transform"), NodePath("AreaTrigger"), PackedStringArray("Transform"), NodePath("Platform"), PackedStringArray("Transform")] resource_unfolds=["res://scenes/game.tscn::TileSet_47g5u", PackedStringArray("physics_layer__array"), "res://scenes/game.tscn::WorldBoundaryShape2D_3u4a8", PackedStringArray("Resource"), "res://scenes/game.tscn::CircleShape2D_x8qck", PackedStringArray("Resource")] nodes_folded=[NodePath("AreaTrigger")] diff --git a/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg b/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg index e17dd42..30957d9 100644 --- a/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg +++ b/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg @@ -1,7 +1,7 @@ [editor_states] Anim={ -"visible": true +"visible": false } 2D={ "grid_offset": Vector2(0, 0), @@ -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/Game/level/StaticBody2D/CollisionShape2D")]) +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/CharacterBody2D")]) diff --git a/.godot/editor/project_metadata.cfg b/.godot/editor/project_metadata.cfg index 0587f74..81c9879 100644 --- a/.godot/editor/project_metadata.cfg +++ b/.godot/editor/project_metadata.cfg @@ -1,6 +1,6 @@ [editor_metadata] -executable_path="/home/timbeezy/Documents/software/godot/Godot_v4.2.1-stable_linux.x86_64" +executable_path="/home/timberg/Documents/software/godot/Godot_v4.2.1-stable_linux.x86_64" use_advanced_connections=false tile_source_sort=0 tile_snap_option=0 @@ -14,8 +14,8 @@ run_debug_collisions=true [recent_files] -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"] +scenes=["res://scenes/badguy.tscn", "res://scenes/coin.tscn", "res://scenes/platform.tscn", "res://scenes/crate.tscn", "res://scenes/bullet.tscn", "res://scenes/character.tscn", "res://scenes/game.tscn"] +scripts=["res://scripts/badguy.gd", "res://scripts/coin.gd", "res://scripts/Trigger.gd", "res://scripts/bullet.gd", "res://scripts/CharacterBody2D.gd", "res://scripts/gamecontroller.gd"] [linked_properties] @@ -33,6 +33,10 @@ Camera2D:zoom=true Camera2D:scale=true Sprite2D:scale=true AnimatableBody2D:scale=true +ParallaxBackground:scroll_base_scale=true +ParallaxBackground:scale=true +ParallaxLayer:motion_scale=true +ParallaxLayer:scale=true [dialog_bounds] diff --git a/.godot/editor/recent_dirs b/.godot/editor/recent_dirs index 16105d0..07dc086 100644 --- a/.godot/editor/recent_dirs +++ b/.godot/editor/recent_dirs @@ -1,5 +1,8 @@ +res://graphics/Player Death +res://scripts +res://graphics/enemies res://scenes +res://graphics/pickups res://graphics/Player Jump res://graphics/Player Run res://graphics/Player Idle -res://scripts diff --git a/.godot/editor/script_editor_cache.cfg b/.godot/editor/script_editor_cache.cfg index 275c9fa..93a32e5 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": 34, +"column": 13, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 23, -"scroll_position": 10.0, +"row": 37, +"scroll_position": 25.0, "selection": false, "syntax_highlighter": "GDScript" } @@ -17,11 +17,11 @@ state={ state={ "bookmarks": PackedInt32Array(), "breakpoints": PackedInt32Array(), -"column": 25, +"column": 15, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 54, -"scroll_position": 39.0, +"row": 28, +"scroll_position": 20.0, "selection": false, "syntax_highlighter": "GDScript" } @@ -53,3 +53,31 @@ state={ "selection": false, "syntax_highlighter": "GDScript" } + +[res://scripts/coin.gd] + +state={ +"bookmarks": PackedInt32Array(), +"breakpoints": PackedInt32Array(), +"column": 14, +"folded_lines": Array[int]([]), +"h_scroll_position": 0, +"row": 18, +"scroll_position": 1.0, +"selection": false, +"syntax_highlighter": "GDScript" +} + +[res://scripts/badguy.gd] + +state={ +"bookmarks": PackedInt32Array(), +"breakpoints": PackedInt32Array(), +"column": 20, +"folded_lines": Array[int]([]), +"h_scroll_position": 0, +"row": 38, +"scroll_position": 22.0, +"selection": false, +"syntax_highlighter": "GDScript" +} diff --git a/.godot/imported/Additional Sky.png-0c545090cde9f2fc7e943a672b099c59.ctex b/.godot/imported/Additional Sky.png-0c545090cde9f2fc7e943a672b099c59.ctex new file mode 100644 index 0000000..28f01e6 Binary files /dev/null and b/.godot/imported/Additional Sky.png-0c545090cde9f2fc7e943a672b099c59.ctex differ diff --git a/.godot/imported/Additional Sky.png-0c545090cde9f2fc7e943a672b099c59.md5 b/.godot/imported/Additional Sky.png-0c545090cde9f2fc7e943a672b099c59.md5 new file mode 100644 index 0000000..813be63 --- /dev/null +++ b/.godot/imported/Additional Sky.png-0c545090cde9f2fc7e943a672b099c59.md5 @@ -0,0 +1,3 @@ +source_md5="ef05607ab18b6e14047ef305d4967bca" +dest_md5="c4a79c607243be25d3669dc2144fdbe8" + diff --git a/.godot/imported/Additional Sky.png-4683357939bfb8be7cfcbc8cef15562a.ctex b/.godot/imported/Additional Sky.png-4683357939bfb8be7cfcbc8cef15562a.ctex new file mode 100644 index 0000000..28f01e6 Binary files /dev/null and b/.godot/imported/Additional Sky.png-4683357939bfb8be7cfcbc8cef15562a.ctex differ diff --git a/.godot/imported/Additional Sky.png-4683357939bfb8be7cfcbc8cef15562a.md5 b/.godot/imported/Additional Sky.png-4683357939bfb8be7cfcbc8cef15562a.md5 new file mode 100644 index 0000000..813be63 --- /dev/null +++ b/.godot/imported/Additional Sky.png-4683357939bfb8be7cfcbc8cef15562a.md5 @@ -0,0 +1,3 @@ +source_md5="ef05607ab18b6e14047ef305d4967bca" +dest_md5="c4a79c607243be25d3669dc2144fdbe8" + diff --git a/.godot/imported/Additional Water.png-bf782f3705a1acaec1e3ab97da39a373.ctex b/.godot/imported/Additional Water.png-bf782f3705a1acaec1e3ab97da39a373.ctex new file mode 100644 index 0000000..bed577d Binary files /dev/null and b/.godot/imported/Additional Water.png-bf782f3705a1acaec1e3ab97da39a373.ctex differ diff --git a/.godot/imported/Additional Water.png-bf782f3705a1acaec1e3ab97da39a373.md5 b/.godot/imported/Additional Water.png-bf782f3705a1acaec1e3ab97da39a373.md5 new file mode 100644 index 0000000..3ab7479 --- /dev/null +++ b/.godot/imported/Additional Water.png-bf782f3705a1acaec1e3ab97da39a373.md5 @@ -0,0 +1,3 @@ +source_md5="707fe1be51389c0a7dc6bce6b8df1ad8" +dest_md5="a1f827ff5491bfc85a30898cd8164541" + diff --git a/.godot/imported/Additional Water.png-bfeb19df0dbfebd1295251f0b1873f10.ctex b/.godot/imported/Additional Water.png-bfeb19df0dbfebd1295251f0b1873f10.ctex new file mode 100644 index 0000000..bed577d Binary files /dev/null and b/.godot/imported/Additional Water.png-bfeb19df0dbfebd1295251f0b1873f10.ctex differ diff --git a/.godot/imported/Additional Water.png-bfeb19df0dbfebd1295251f0b1873f10.md5 b/.godot/imported/Additional Water.png-bfeb19df0dbfebd1295251f0b1873f10.md5 new file mode 100644 index 0000000..3ab7479 --- /dev/null +++ b/.godot/imported/Additional Water.png-bfeb19df0dbfebd1295251f0b1873f10.md5 @@ -0,0 +1,3 @@ +source_md5="707fe1be51389c0a7dc6bce6b8df1ad8" +dest_md5="a1f827ff5491bfc85a30898cd8164541" + diff --git a/.godot/imported/BG Image.png-a4c16c98f815c26fe14456abfb54be92.ctex b/.godot/imported/BG Image.png-a4c16c98f815c26fe14456abfb54be92.ctex new file mode 100644 index 0000000..224819e Binary files /dev/null and b/.godot/imported/BG Image.png-a4c16c98f815c26fe14456abfb54be92.ctex differ diff --git a/.godot/imported/BG Image.png-a4c16c98f815c26fe14456abfb54be92.md5 b/.godot/imported/BG Image.png-a4c16c98f815c26fe14456abfb54be92.md5 new file mode 100644 index 0000000..0a89380 --- /dev/null +++ b/.godot/imported/BG Image.png-a4c16c98f815c26fe14456abfb54be92.md5 @@ -0,0 +1,3 @@ +source_md5="7f10db4045810c42977343e59a782178" +dest_md5="c50c902db0eea75f65be64479d81b3ae" + diff --git a/.godot/imported/BG Image.png-fdf6a666b22c5a162cf497c01f045810.ctex b/.godot/imported/BG Image.png-fdf6a666b22c5a162cf497c01f045810.ctex new file mode 100644 index 0000000..224819e Binary files /dev/null and b/.godot/imported/BG Image.png-fdf6a666b22c5a162cf497c01f045810.ctex differ diff --git a/.godot/imported/BG Image.png-fdf6a666b22c5a162cf497c01f045810.md5 b/.godot/imported/BG Image.png-fdf6a666b22c5a162cf497c01f045810.md5 new file mode 100644 index 0000000..0a89380 --- /dev/null +++ b/.godot/imported/BG Image.png-fdf6a666b22c5a162cf497c01f045810.md5 @@ -0,0 +1,3 @@ +source_md5="7f10db4045810c42977343e59a782178" +dest_md5="c50c902db0eea75f65be64479d81b3ae" + diff --git a/.godot/imported/Player Death 64x64.png-264389d563a3f9dc55af6fd3aea47ce0.ctex b/.godot/imported/Player Death 64x64.png-264389d563a3f9dc55af6fd3aea47ce0.ctex new file mode 100644 index 0000000..80fda5e Binary files /dev/null and b/.godot/imported/Player Death 64x64.png-264389d563a3f9dc55af6fd3aea47ce0.ctex differ diff --git a/.godot/imported/Player Death 64x64.png-264389d563a3f9dc55af6fd3aea47ce0.md5 b/.godot/imported/Player Death 64x64.png-264389d563a3f9dc55af6fd3aea47ce0.md5 new file mode 100644 index 0000000..ec35684 --- /dev/null +++ b/.godot/imported/Player Death 64x64.png-264389d563a3f9dc55af6fd3aea47ce0.md5 @@ -0,0 +1,3 @@ +source_md5="e5256a9ceb0ab699f4b89ff036b2a902" +dest_md5="9cd9459a73f825afbfd37992d6a40bfb" + diff --git a/.godot/imported/Player Death 64x64.png-435beda6749261fdc4c1556c5eba52de.ctex b/.godot/imported/Player Death 64x64.png-435beda6749261fdc4c1556c5eba52de.ctex new file mode 100644 index 0000000..80fda5e Binary files /dev/null and b/.godot/imported/Player Death 64x64.png-435beda6749261fdc4c1556c5eba52de.ctex differ diff --git a/.godot/imported/Player Death 64x64.png-435beda6749261fdc4c1556c5eba52de.md5 b/.godot/imported/Player Death 64x64.png-435beda6749261fdc4c1556c5eba52de.md5 new file mode 100644 index 0000000..ec35684 --- /dev/null +++ b/.godot/imported/Player Death 64x64.png-435beda6749261fdc4c1556c5eba52de.md5 @@ -0,0 +1,3 @@ +source_md5="e5256a9ceb0ab699f4b89ff036b2a902" +dest_md5="9cd9459a73f825afbfd37992d6a40bfb" + diff --git a/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.ctex b/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.ctex new file mode 100644 index 0000000..f11888e Binary files /dev/null and b/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.ctex differ diff --git a/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.md5 b/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.md5 new file mode 100644 index 0000000..a9421a9 --- /dev/null +++ b/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.md5 @@ -0,0 +1,3 @@ +source_md5="9972ae36d7f15087663eef880c2522c7" +dest_md5="6323bfa165d4025b36e466114be0533d" + diff --git a/.godot/imported/coin.png-73c91dc4cbca5202b885de6adb8bd3f1.ctex b/.godot/imported/coin.png-73c91dc4cbca5202b885de6adb8bd3f1.ctex new file mode 100644 index 0000000..f11888e Binary files /dev/null and b/.godot/imported/coin.png-73c91dc4cbca5202b885de6adb8bd3f1.ctex differ diff --git a/.godot/imported/coin.png-73c91dc4cbca5202b885de6adb8bd3f1.md5 b/.godot/imported/coin.png-73c91dc4cbca5202b885de6adb8bd3f1.md5 new file mode 100644 index 0000000..a9421a9 --- /dev/null +++ b/.godot/imported/coin.png-73c91dc4cbca5202b885de6adb8bd3f1.md5 @@ -0,0 +1,3 @@ +source_md5="9972ae36d7f15087663eef880c2522c7" +dest_md5="6323bfa165d4025b36e466114be0533d" + diff --git a/.godot/imported/coin.png-b04a16f8896ddd41f884de642ba05be4.ctex b/.godot/imported/coin.png-b04a16f8896ddd41f884de642ba05be4.ctex new file mode 100644 index 0000000..f11888e Binary files /dev/null and b/.godot/imported/coin.png-b04a16f8896ddd41f884de642ba05be4.ctex differ diff --git a/.godot/imported/coin.png-b04a16f8896ddd41f884de642ba05be4.md5 b/.godot/imported/coin.png-b04a16f8896ddd41f884de642ba05be4.md5 new file mode 100644 index 0000000..a9421a9 --- /dev/null +++ b/.godot/imported/coin.png-b04a16f8896ddd41f884de642ba05be4.md5 @@ -0,0 +1,3 @@ +source_md5="9972ae36d7f15087663eef880c2522c7" +dest_md5="6323bfa165d4025b36e466114be0533d" + diff --git a/.godot/imported/slime_green.png-5465ec1b559c454faabc599e0b746844.ctex b/.godot/imported/slime_green.png-5465ec1b559c454faabc599e0b746844.ctex new file mode 100644 index 0000000..e76e5a1 Binary files /dev/null and b/.godot/imported/slime_green.png-5465ec1b559c454faabc599e0b746844.ctex differ diff --git a/.godot/imported/slime_green.png-5465ec1b559c454faabc599e0b746844.md5 b/.godot/imported/slime_green.png-5465ec1b559c454faabc599e0b746844.md5 new file mode 100644 index 0000000..77a0181 --- /dev/null +++ b/.godot/imported/slime_green.png-5465ec1b559c454faabc599e0b746844.md5 @@ -0,0 +1,3 @@ +source_md5="2721669a4b3bd4204bfcb0977915dd6d" +dest_md5="564335e3510b66c129befe8591a0d6f0" + diff --git a/.godot/imported/slime_green.png-c1793a53215b1f08b86fab9c095138a2.ctex b/.godot/imported/slime_green.png-c1793a53215b1f08b86fab9c095138a2.ctex new file mode 100644 index 0000000..e76e5a1 Binary files /dev/null and b/.godot/imported/slime_green.png-c1793a53215b1f08b86fab9c095138a2.ctex differ diff --git a/.godot/imported/slime_green.png-c1793a53215b1f08b86fab9c095138a2.md5 b/.godot/imported/slime_green.png-c1793a53215b1f08b86fab9c095138a2.md5 new file mode 100644 index 0000000..77a0181 --- /dev/null +++ b/.godot/imported/slime_green.png-c1793a53215b1f08b86fab9c095138a2.md5 @@ -0,0 +1,3 @@ +source_md5="2721669a4b3bd4204bfcb0977915dd6d" +dest_md5="564335e3510b66c129befe8591a0d6f0" + diff --git a/.godot/imported/slime_green.png-f61e94ea97c96b62fc5543e2957803c1.ctex b/.godot/imported/slime_green.png-f61e94ea97c96b62fc5543e2957803c1.ctex new file mode 100644 index 0000000..e76e5a1 Binary files /dev/null and b/.godot/imported/slime_green.png-f61e94ea97c96b62fc5543e2957803c1.ctex differ diff --git a/.godot/imported/slime_green.png-f61e94ea97c96b62fc5543e2957803c1.md5 b/.godot/imported/slime_green.png-f61e94ea97c96b62fc5543e2957803c1.md5 new file mode 100644 index 0000000..77a0181 --- /dev/null +++ b/.godot/imported/slime_green.png-f61e94ea97c96b62fc5543e2957803c1.md5 @@ -0,0 +1,3 @@ +source_md5="2721669a4b3bd4204bfcb0977915dd6d" +dest_md5="564335e3510b66c129befe8591a0d6f0" + diff --git a/.godot/imported/slime_purple.png-480cf0e6770ddef13bcd4021f9f56ae0.ctex b/.godot/imported/slime_purple.png-480cf0e6770ddef13bcd4021f9f56ae0.ctex new file mode 100644 index 0000000..e3520a0 Binary files /dev/null and b/.godot/imported/slime_purple.png-480cf0e6770ddef13bcd4021f9f56ae0.ctex differ diff --git a/.godot/imported/slime_purple.png-480cf0e6770ddef13bcd4021f9f56ae0.md5 b/.godot/imported/slime_purple.png-480cf0e6770ddef13bcd4021f9f56ae0.md5 new file mode 100644 index 0000000..f186d88 --- /dev/null +++ b/.godot/imported/slime_purple.png-480cf0e6770ddef13bcd4021f9f56ae0.md5 @@ -0,0 +1,3 @@ +source_md5="54f57af24a12b9a7016da6f96c55a77d" +dest_md5="d56883b02fd383d0809e6e9ecbe5df3b" + diff --git a/.godot/imported/slime_purple.png-680c7cb80731795ced97a298ff076baf.ctex b/.godot/imported/slime_purple.png-680c7cb80731795ced97a298ff076baf.ctex new file mode 100644 index 0000000..e3520a0 Binary files /dev/null and b/.godot/imported/slime_purple.png-680c7cb80731795ced97a298ff076baf.ctex differ diff --git a/.godot/imported/slime_purple.png-680c7cb80731795ced97a298ff076baf.md5 b/.godot/imported/slime_purple.png-680c7cb80731795ced97a298ff076baf.md5 new file mode 100644 index 0000000..f186d88 --- /dev/null +++ b/.godot/imported/slime_purple.png-680c7cb80731795ced97a298ff076baf.md5 @@ -0,0 +1,3 @@ +source_md5="54f57af24a12b9a7016da6f96c55a77d" +dest_md5="d56883b02fd383d0809e6e9ecbe5df3b" + diff --git a/.godot/imported/slime_purple.png-f5f84a6c74d080d5063875987803d399.ctex b/.godot/imported/slime_purple.png-f5f84a6c74d080d5063875987803d399.ctex new file mode 100644 index 0000000..e3520a0 Binary files /dev/null and b/.godot/imported/slime_purple.png-f5f84a6c74d080d5063875987803d399.ctex differ diff --git a/.godot/imported/slime_purple.png-f5f84a6c74d080d5063875987803d399.md5 b/.godot/imported/slime_purple.png-f5f84a6c74d080d5063875987803d399.md5 new file mode 100644 index 0000000..f186d88 --- /dev/null +++ b/.godot/imported/slime_purple.png-f5f84a6c74d080d5063875987803d399.md5 @@ -0,0 +1,3 @@ +source_md5="54f57af24a12b9a7016da6f96c55a77d" +dest_md5="d56883b02fd383d0809e6e9ecbe5df3b" + diff --git a/.godot/uid_cache.bin b/.godot/uid_cache.bin index db940c3..5552260 100644 Binary files a/.godot/uid_cache.bin and b/.godot/uid_cache.bin differ diff --git a/graphics/Player Death/Player Death 64x64.png b/graphics/Player Death/Player Death 64x64.png new file mode 100644 index 0000000..2e6a1ae Binary files /dev/null and b/graphics/Player Death/Player Death 64x64.png differ diff --git a/graphics/Player Death/Player Death 64x64.png.import b/graphics/Player Death/Player Death 64x64.png.import new file mode 100644 index 0000000..6df4f26 --- /dev/null +++ b/graphics/Player Death/Player Death 64x64.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c8ogee5u6uxld" +path="res://.godot/imported/Player Death 64x64.png-264389d563a3f9dc55af6fd3aea47ce0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/Player Death/Player Death 64x64.png" +dest_files=["res://.godot/imported/Player Death 64x64.png-264389d563a3f9dc55af6fd3aea47ce0.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/graphics/background/Additional Sky.png b/graphics/background/Additional Sky.png new file mode 100644 index 0000000..46e400f Binary files /dev/null and b/graphics/background/Additional Sky.png differ diff --git a/graphics/background/Additional Sky.png.import b/graphics/background/Additional Sky.png.import new file mode 100644 index 0000000..d6fb54b --- /dev/null +++ b/graphics/background/Additional Sky.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ddrpxehpjros0" +path="res://.godot/imported/Additional Sky.png-0c545090cde9f2fc7e943a672b099c59.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/background/Additional Sky.png" +dest_files=["res://.godot/imported/Additional Sky.png-0c545090cde9f2fc7e943a672b099c59.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/graphics/background/Additional Water.png b/graphics/background/Additional Water.png new file mode 100644 index 0000000..591e481 Binary files /dev/null and b/graphics/background/Additional Water.png differ diff --git a/graphics/background/Additional Water.png.import b/graphics/background/Additional Water.png.import new file mode 100644 index 0000000..bcfe88f --- /dev/null +++ b/graphics/background/Additional Water.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://clb5ryiub2nfh" +path="res://.godot/imported/Additional Water.png-bf782f3705a1acaec1e3ab97da39a373.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/background/Additional Water.png" +dest_files=["res://.godot/imported/Additional Water.png-bf782f3705a1acaec1e3ab97da39a373.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/graphics/background/BG Image.png b/graphics/background/BG Image.png new file mode 100644 index 0000000..3f2a66c Binary files /dev/null and b/graphics/background/BG Image.png differ diff --git a/graphics/background/BG Image.png.import b/graphics/background/BG Image.png.import new file mode 100644 index 0000000..eeba774 --- /dev/null +++ b/graphics/background/BG Image.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bxcf8ryispa5c" +path="res://.godot/imported/BG Image.png-a4c16c98f815c26fe14456abfb54be92.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/background/BG Image.png" +dest_files=["res://.godot/imported/BG Image.png-a4c16c98f815c26fe14456abfb54be92.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/graphics/enemies/slime_green.png b/graphics/enemies/slime_green.png new file mode 100644 index 0000000..a21cb6f Binary files /dev/null and b/graphics/enemies/slime_green.png differ diff --git a/graphics/enemies/slime_green.png.import b/graphics/enemies/slime_green.png.import new file mode 100644 index 0000000..e8138e9 --- /dev/null +++ b/graphics/enemies/slime_green.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://qfv32134f4tb" +path="res://.godot/imported/slime_green.png-5465ec1b559c454faabc599e0b746844.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/enemies/slime_green.png" +dest_files=["res://.godot/imported/slime_green.png-5465ec1b559c454faabc599e0b746844.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/graphics/enemies/slime_purple.png b/graphics/enemies/slime_purple.png new file mode 100644 index 0000000..76f564e Binary files /dev/null and b/graphics/enemies/slime_purple.png differ diff --git a/graphics/enemies/slime_purple.png.import b/graphics/enemies/slime_purple.png.import new file mode 100644 index 0000000..46eb589 --- /dev/null +++ b/graphics/enemies/slime_purple.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bw43f1enjixbk" +path="res://.godot/imported/slime_purple.png-680c7cb80731795ced97a298ff076baf.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/enemies/slime_purple.png" +dest_files=["res://.godot/imported/slime_purple.png-680c7cb80731795ced97a298ff076baf.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/graphics/pickups/coin.png b/graphics/pickups/coin.png new file mode 100644 index 0000000..01ae33d Binary files /dev/null and b/graphics/pickups/coin.png differ diff --git a/graphics/pickups/coin.png.import b/graphics/pickups/coin.png.import new file mode 100644 index 0000000..0aed3c1 --- /dev/null +++ b/graphics/pickups/coin.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bu0wyq230xip1" +path="res://.godot/imported/coin.png-b04a16f8896ddd41f884de642ba05be4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/pickups/coin.png" +dest_files=["res://.godot/imported/coin.png-b04a16f8896ddd41f884de642ba05be4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/badguy.tscn b/scenes/badguy.tscn new file mode 100644 index 0000000..2093506 --- /dev/null +++ b/scenes/badguy.tscn @@ -0,0 +1,73 @@ +[gd_scene load_steps=9 format=3 uid="uid://dvied5dxkc7e0"] + +[ext_resource type="Script" path="res://scripts/badguy.gd" id="1_7u81x"] +[ext_resource type="Texture2D" uid="uid://bw43f1enjixbk" path="res://graphics/enemies/slime_purple.png" id="1_anh2u"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_o20x5"] +atlas = ExtResource("1_anh2u") +region = Rect2(0, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_o8v3c"] +atlas = ExtResource("1_anh2u") +region = Rect2(24, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tsden"] +atlas = ExtResource("1_anh2u") +region = Rect2(48, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_o7cwn"] +atlas = ExtResource("1_anh2u") +region = Rect2(72, 24, 24, 24) + +[sub_resource type="SpriteFrames" id="SpriteFrames_uh2us"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_o20x5") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_o8v3c") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tsden") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_o7cwn") +}], +"loop": true, +"name": &"chase", +"speed": 12.0 +}] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_vdsen"] +size = Vector2(14, 15) + +[node name="Area2D" type="Area2D"] +script = ExtResource("1_7u81x") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +sprite_frames = SubResource("SpriteFrames_uh2us") +animation = &"chase" +autoplay = "chase" +frame_progress = 0.56706 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, 4.5) +shape = SubResource("RectangleShape2D_vdsen") + +[node name="RightCast" type="RayCast2D" parent="."] +target_position = Vector2(13, 0) + +[node name="LeftCast" type="RayCast2D" parent="."] +target_position = Vector2(-13, 0) + +[node name="rightFloorCast" type="RayCast2D" parent="."] +position = Vector2(7, 0) +target_position = Vector2(0, 15) + +[node name="leftFloorCast" type="RayCast2D" parent="."] +position = Vector2(-7, 0) +target_position = Vector2(0, 15) + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/scenes/character.tscn b/scenes/character.tscn index a3de11b..c975cbc 100644 --- a/scenes/character.tscn +++ b/scenes/character.tscn @@ -1,10 +1,51 @@ -[gd_scene load_steps=28 format=3 uid="uid://go4yc8hfo1gq"] +[gd_scene load_steps=39 format=3 uid="uid://go4yc8hfo1gq"] [ext_resource type="Script" path="res://scripts/CharacterBody2D.gd" id="1_x87yo"] +[ext_resource type="Texture2D" uid="uid://c8ogee5u6uxld" path="res://graphics/Player Death/Player Death 64x64.png" id="2_byx7v"] [ext_resource type="Texture2D" uid="uid://c0iiaebonyhh0" path="res://graphics/Player Idle/Player Idle 48x48.png" id="2_hyqch"] [ext_resource type="Texture2D" uid="uid://xgoqfqmvorcx" path="res://graphics/Player Jump/player jump 48x48.png" id="3_mp84c"] [ext_resource type="Texture2D" uid="uid://vn23qn3f0dvc" path="res://graphics/Player Run/player run 48x48.png" id="4_bok64"] +[sub_resource type="AtlasTexture" id="AtlasTexture_i0o8b"] +atlas = ExtResource("2_byx7v") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ppvnc"] +atlas = ExtResource("2_byx7v") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yo8u7"] +atlas = ExtResource("2_byx7v") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_eioko"] +atlas = ExtResource("2_byx7v") +region = Rect2(144, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_dmhe1"] +atlas = ExtResource("2_byx7v") +region = Rect2(192, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_joqoj"] +atlas = ExtResource("2_byx7v") +region = Rect2(240, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bykew"] +atlas = ExtResource("2_byx7v") +region = Rect2(288, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_b7x2x"] +atlas = ExtResource("2_byx7v") +region = Rect2(336, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7lf4o"] +atlas = ExtResource("2_byx7v") +region = Rect2(384, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gcy07"] +atlas = ExtResource("2_byx7v") +region = Rect2(432, 0, 48, 48) + [sub_resource type="AtlasTexture" id="AtlasTexture_htcu2"] atlas = ExtResource("2_hyqch") region = Rect2(0, 0, 48, 48) @@ -93,6 +134,41 @@ region = Rect2(336, 0, 48, 48) animations = [{ "frames": [{ "duration": 1.0, +"texture": SubResource("AtlasTexture_i0o8b") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ppvnc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yo8u7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_eioko") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_dmhe1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_joqoj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_bykew") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_b7x2x") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_7lf4o") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gcy07") +}], +"loop": false, +"name": &"death", +"speed": 12.0 +}, { +"frames": [{ +"duration": 1.0, "texture": SubResource("AtlasTexture_htcu2") }, { "duration": 1.0, @@ -182,8 +258,10 @@ metadata/_edit_group_ = true [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] texture_filter = 1 sprite_frames = SubResource("SpriteFrames_a6t6h") -animation = &"idle" +animation = &"death" autoplay = "idle" +frame = 9 +frame_progress = 1.0 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] position = Vector2(0, 3) diff --git a/scenes/coin.tscn b/scenes/coin.tscn new file mode 100644 index 0000000..299a73b --- /dev/null +++ b/scenes/coin.tscn @@ -0,0 +1,112 @@ +[gd_scene load_steps=17 format=3 uid="uid://7e5lm5ck08k8"] + +[ext_resource type="Texture2D" uid="uid://bu0wyq230xip1" path="res://graphics/pickups/coin.png" id="1_a1ga2"] +[ext_resource type="Script" path="res://scripts/coin.gd" id="1_xu2uf"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_cphs5"] +atlas = ExtResource("1_a1ga2") +region = Rect2(0, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_24jk6"] +atlas = ExtResource("1_a1ga2") +region = Rect2(16, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_rgjgj"] +atlas = ExtResource("1_a1ga2") +region = Rect2(32, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8ci21"] +atlas = ExtResource("1_a1ga2") +region = Rect2(48, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i0cu2"] +atlas = ExtResource("1_a1ga2") +region = Rect2(64, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wtwtd"] +atlas = ExtResource("1_a1ga2") +region = Rect2(80, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yxweu"] +atlas = ExtResource("1_a1ga2") +region = Rect2(96, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_b7n6q"] +atlas = ExtResource("1_a1ga2") +region = Rect2(112, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mpw0r"] +atlas = ExtResource("1_a1ga2") +region = Rect2(128, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_o1nu1"] +atlas = ExtResource("1_a1ga2") +region = Rect2(144, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_frg1o"] +atlas = ExtResource("1_a1ga2") +region = Rect2(160, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_efpui"] +atlas = ExtResource("1_a1ga2") +region = Rect2(176, 0, 16, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_w1v5w"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_cphs5") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_24jk6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_rgjgj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8ci21") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i0cu2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wtwtd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yxweu") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_b7n6q") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_mpw0r") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_o1nu1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_frg1o") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_efpui") +}], +"loop": true, +"name": &"default", +"speed": 12.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_ngajn"] +radius = 6.0 + +[node name="Area2D" type="Area2D"] +script = ExtResource("1_xu2uf") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +sprite_frames = SubResource("SpriteFrames_w1v5w") +autoplay = "default" + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_ngajn") + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/scenes/game.tscn b/scenes/game.tscn index aec5f5b..eb01893 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -1,11 +1,16 @@ -[gd_scene load_steps=14 format=3 uid="uid://y083suj12rld"] +[gd_scene load_steps=19 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://dwb83f7uoweuy" path="res://graphics/Terrain (32x32).png" id="2_l22q1"] [ext_resource type="Script" path="res://scripts/Trigger.gd" id="2_nfj1w"] +[ext_resource type="Texture2D" uid="uid://bxcf8ryispa5c" path="res://graphics/background/BG Image.png" id="3_v42n4"] +[ext_resource type="Texture2D" uid="uid://ddrpxehpjros0" path="res://graphics/background/Additional Sky.png" id="4_ch8sb"] +[ext_resource type="Texture2D" uid="uid://clb5ryiub2nfh" path="res://graphics/background/Additional Water.png" id="5_01lp1"] [ext_resource type="PackedScene" uid="uid://ukuu7p7vhlq" path="res://scenes/crate.tscn" id="5_u8rgi"] [ext_resource type="PackedScene" uid="uid://i3l8y3rbx4o1" path="res://scenes/platform.tscn" id="6_t5a05"] +[ext_resource type="PackedScene" uid="uid://7e5lm5ck08k8" path="res://scenes/coin.tscn" id="10_yjg5o"] +[ext_resource type="PackedScene" uid="uid://dvied5dxkc7e0" path="res://scenes/badguy.tscn" id="11_ovphn"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_xg6qs"] texture = ExtResource("2_l22q1") @@ -482,6 +487,21 @@ sources/0 = SubResource("TileSetAtlasSource_xg6qs") [sub_resource type="CircleShape2D" id="CircleShape2D_x8qck"] radius = 60.2993 +[sub_resource type="Animation" id="Animation_4jf1k"] +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), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector2(186, -65), Vector2(56, -65)] +} + [sub_resource type="Animation" id="Animation_scpii"] resource_name = "move" loop_mode = 2 @@ -498,21 +518,6 @@ tracks/0/keys = { "values": [Vector2(66, -71), Vector2(131, -71)] } -[sub_resource type="Animation" id="Animation_4jf1k"] -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(0, 0)] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_5sp7p"] _data = { "RESET": SubResource("Animation_4jf1k"), @@ -520,12 +525,37 @@ _data = { } [node name="Game" type="Node2D"] + +[node name="GameController" type="Node" parent="."] +unique_name_in_owner = true script = ExtResource("1_77wyw") +[node name="Timer" type="Timer" parent="GameController"] + [node name="TileMap" type="TileMap" parent="."] tile_set = SubResource("TileSet_47g5u") format = 2 -layer_0/tile_data = PackedInt32Array(262141, 786432, 4, 262142, 65536, 4, 262143, 65536, 4, 196608, 65536, 4, 196609, 65536, 4, 196610, 131072, 4, 262149, 0, 1, 327685, 0, 2, 327686, 589824, 4, 327687, 65536, 2, 327688, 655360, 4, 327689, 65536, 2, 262153, 65536, 1, 196617, 655360, 3, 196616, 655360, 3, 196615, 65536, 0, 196614, 589824, 3, 196613, 0, 0, 262150, 65536, 1, 262151, 65536, 1, 262152, 65536, 1, 196618, 65536, 0, 262154, 65536, 1, 327690, 655360, 4, 327691, 65536, 2, 262155, 65536, 1, 196619, 655360, 3, 196620, 65536, 0, 262156, 65536, 1, 327692, 65536, 2, 65539, 0, 4, 65540, 131072, 4, -65540, 0, 0, -4, 393216, 4, 65532, 393216, 3, 131068, 0, 1, 131069, 458752, 3, 65533, 458752, 4, -3, 131072, 1, -65539, 131072, 0, 196605, 458752, 3, 196604, 393216, 3, 262140, 0, 2, 65535, 262144, 4, -65535, 262144, 4, 8, 0, 2, 9, 589824, 4, 10, 131072, 2, -65526, 131072, 0, -65527, 655360, 3, -65528, 0, 0, 6, 262144, 0, 65542, 262144, 2, 196621, 589824, 3, 196622, 131072, 0, 262158, 131072, 1, 327694, 131072, 2, 327693, 65536, 2, 262157, 65536, 1, -262132, 983040, 3, -262131, 65536, 4, -262130, 1048576, 3, -196594, 262144, 1, -131058, 1048576, 4, -131059, 65536, 4, -131060, 983040, 4, -196596, 262144, 1) +layer_0/tile_data = PackedInt32Array(262141, 786432, 4, 262142, 65536, 4, 262143, 65536, 4, 196608, 65536, 4, 196609, 65536, 4, 196610, 131072, 4, 262149, 0, 1, 327685, 0, 2, 327686, 589824, 4, 327687, 65536, 2, 327688, 655360, 4, 327689, 65536, 2, 262153, 65536, 1, 196617, 655360, 3, 196616, 655360, 3, 196615, 65536, 0, 196614, 589824, 3, 196613, 0, 0, 262150, 65536, 1, 262151, 65536, 1, 262152, 65536, 1, 196618, 65536, 0, 262154, 65536, 1, 327690, 655360, 4, 327691, 65536, 2, 262155, 65536, 1, 196619, 655360, 3, 196620, 65536, 0, 262156, 65536, 1, 327692, 65536, 2, 65539, 0, 4, 65540, 131072, 4, -65540, 0, 0, -4, 393216, 4, 65532, 393216, 3, 131068, 0, 1, 131069, 458752, 3, 65533, 458752, 4, -3, 131072, 1, -65539, 131072, 0, 196605, 458752, 3, 196604, 393216, 3, 262140, 0, 2, 65535, 262144, 4, -65535, 262144, 4, 8, 0, 2, 9, 589824, 4, 10, 131072, 2, -65526, 131072, 0, -65527, 655360, 3, -65528, 0, 0, 6, 262144, 0, 65542, 262144, 2, 196621, 851968, 0, 196622, 131072, 0, 262158, 131072, 1, 327694, 131072, 2, 327693, 65536, 2, 262157, 65536, 1, -262130, 1048576, 3, -196594, 262144, 1, -131058, 1048576, 4, -131059, 65536, 4, -131060, 983040, 4, -196596, 262144, 1, -262132, 983040, 3, -262131, 65536, 4, 65550, 983040, 3, 65551, 131072, 4, -65520, 0, 4, -65519, 65536, 4, -65518, 131072, 4, -196592, 262144, 4, 131086, 851968, 4, 131085, 0, 0) + +[node name="ParallaxBackground" type="ParallaxBackground" parent="."] + +[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] +motion_mirroring = Vector2(324, 0) + +[node name="Sprite2D" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"] +position = Vector2(91, 50) +scale = Vector2(1.16146, 1) +texture = ExtResource("3_v42n4") + +[node name="Sprite2D2" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"] +position = Vector2(91, -176) +scale = Vector2(13.9375, 11.5) +texture = ExtResource("4_ch8sb") + +[node name="Sprite2D3" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"] +position = Vector2(91, 175) +scale = Vector2(13.9375, 4) +texture = ExtResource("5_01lp1") [node name="level" type="Node2D" parent="."] @@ -543,7 +573,8 @@ PUSH_FORCE = 550 [node name="Camera2D" type="Camera2D" parent="CharacterBody2D"] [node name="AreaTrigger" type="Area2D" parent="."] -position = Vector2(306, -24) +position = Vector2(304, -37) +scale = Vector2(0.8, 0.96) script = ExtResource("2_nfj1w") metadata/_edit_group_ = true @@ -554,7 +585,7 @@ debug_color = Color(0.556863, 0.415686, 0.964706, 0.419608) [node name="crates" type="Node" parent="."] [node name="crate1" parent="crates" instance=ExtResource("5_u8rgi")] -position = Vector2(114, 30) +position = Vector2(112, 24) [node name="crate2" parent="crates" instance=ExtResource("5_u8rgi")] position = Vector2(435, -154) @@ -563,6 +594,8 @@ position = Vector2(435, -154) position = Vector2(44, -71) [node name="Platform" parent="." instance=ExtResource("6_t5a05")] +position = Vector2(186, -65) +metadata/_edit_group_ = true [node name="AnimationPlayer" type="AnimationPlayer" parent="Platform"] libraries = { @@ -573,5 +606,65 @@ autoplay = "move" [node name="BoxTrap" type="Node2D" parent="."] position = Vector2(304, -140) -[connection signal="areatrigger" from="AreaTrigger" to="." method="_on_area_2d_areatrigger"] +[node name="coins" type="Node" parent="."] + +[node name="coin" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(208, -11) + +[node name="coin2" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(407, -138) + +[node name="coin3" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(459, -139) + +[node name="coin4" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(-16, -9) + +[node name="coin5" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(-95, -74) + +[node name="coin6" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(48, -44) + +[node name="coin7" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(264, 83) + +[node name="coin8" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(312, 83) + +[node name="coin9" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(357, 82) + +[node name="coin10" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(306, -42) + +[node name="coin11" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(397, 83) + +[node name="coin12" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(467, 20) + +[node name="coin13" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(494, 20) + +[node name="coin14" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(527, -110) + +[node name="coin15" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(536, -44) + +[node name="coin16" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(560, -44) + +[node name="coin17" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(584, -44) + +[node name="coin18" parent="coins" instance=ExtResource("10_yjg5o")] +position = Vector2(218, 83) + +[node name="badguy" parent="." instance=ExtResource("11_ovphn")] +position = Vector2(179, 84) + +[connection signal="timeout" from="GameController/Timer" to="GameController" method="resetWorld"] +[connection signal="areatrigger" from="AreaTrigger" to="GameController" method="_on_area_2d_areatrigger"] [connection signal="body_entered" from="AreaTrigger" to="AreaTrigger" method="_on_body_entered"] diff --git a/scripts/CharacterBody2D.gd b/scripts/CharacterBody2D.gd index eeea197..ddaa75e 100644 --- a/scripts/CharacterBody2D.gd +++ b/scripts/CharacterBody2D.gd @@ -17,88 +17,93 @@ var faceLeft = false var pushLeftEnabled = false var pushRightEnabled = false var pushTarget +var living = true var bullet = preload("res://scenes/bullet.tscn") # Get the gravity from the project settings to be synced with RigidBody nodes. var gravity = ProjectSettings.get_setting("physics/2d/default_gravity") - -func _physics_process(delta): - # Add the gravity. - if not is_on_floor(): - velocity.y += gravity * delta - - # Handle jump. - if Input.is_action_just_pressed("ui_accept") and is_on_floor(): - velocity.y = JUMP_VELOCITY - # Hand force push (melee attack) - if Input.is_action_just_pressed("push") && pushRightEnabled && faceLeft == false: - pushTarget.apply_central_impulse(Vector2(1,0) * PUSH_FORCE * 5) - pushRightEnabled = false - if Input.is_action_just_pressed("push") && pushLeftEnabled: - pushTarget.apply_central_impulse(Vector2(-1,0) * PUSH_FORCE * 5) - pushLeftEnabled = false - - if Input.is_action_just_pressed("shoot"): - #make a bullet - var myBullet = bullet.instantiate() - #set bullet speed? - - #put the bullet at the Marker - owner.add_child(myBullet) - if not faceLeft: - #facing right - myBullet.transform = marker_right.global_transform - else: - #facing left - myBullet.transform = marker_left.global_transform - myBullet.setSpeed(-750) - - # Get the input direction and handle the movement/deceleration. - # As good practice, you should replace UI actions with custom gameplay actions. - var direction = Input.get_axis("ui_left", "ui_right") +func die(): + print("kill the player") + animated_sprite.play("death") + living = false - # In this example we have replaced the faceLeft code to also have - # the character's sprite flip depending what direction they are facing - if direction: - faceLeft = true if direction<0 else false - animated_sprite.flip_h = true if direction < 0 else false - velocity.x = direction * SPEED - else: - velocity.x = move_toward(velocity.x, 0, SPEED) - if is_on_floor(): - if direction==0: - animated_sprite.play("idle") - else: - animated_sprite.play("run") - else: - animated_sprite.play("jump") +func _physics_process(delta): + if living: + if not is_on_floor(): + velocity.y += gravity * delta - move_and_slide() - if right_ray.is_colliding(): - print("right ray is colliding") - var collider = right_ray.get_collider() - #what did we hit? - if collider is Node: - if collider.is_in_group("boxes"): - print("This is a pushable box") - pushRightEnabled = true - pushTarget = collider - else: - pushRightEnabled = false + # Handle jump. + if Input.is_action_just_pressed("ui_accept") and is_on_floor(): + velocity.y = JUMP_VELOCITY + # Hand force push (melee attack) + if Input.is_action_just_pressed("push") && pushRightEnabled && faceLeft == false: + pushTarget.apply_central_impulse(Vector2(1,0) * PUSH_FORCE * 5) + pushRightEnabled = false + if Input.is_action_just_pressed("push") && pushLeftEnabled: + pushTarget.apply_central_impulse(Vector2(-1,0) * PUSH_FORCE * 5) + pushLeftEnabled = false + + if Input.is_action_just_pressed("shoot"): + #make a bullet + var myBullet = bullet.instantiate() + #set bullet speed? + + #put the bullet at the Marker + owner.add_child(myBullet) + if not faceLeft: + #facing right + myBullet.transform = marker_right.global_transform + else: + #facing left + myBullet.transform = marker_left.global_transform + myBullet.setSpeed(-750) + + # Get the input direction and handle the movement/deceleration. + # As good practice, you should replace UI actions with custom gameplay actions. + var direction = Input.get_axis("ui_left", "ui_right") - if left_ray.is_colliding(): - print("left ray is colliding") - var collider = left_ray.get_collider() - if collider is Node: - if collider.is_in_group("boxes"): - pushLeftEnabled = true - pushTarget = collider - else: - pushLeftEnabled = false - - #loop through the collisions - for i in get_slide_collision_count(): - var c = get_slide_collision(i) - if c.get_collider() is RigidBody2D: - c.get_collider().apply_central_impulse(-c.get_normal()* BUMP_FORCE) + # In this example we have replaced the faceLeft code to also have + # the character's sprite flip depending what direction they are facing + if direction: + faceLeft = true if direction<0 else false + animated_sprite.flip_h = true if direction < 0 else false + velocity.x = direction * SPEED + else: + velocity.x = move_toward(velocity.x, 0, SPEED) + if is_on_floor(): + if direction==0: + animated_sprite.play("idle") + else: + animated_sprite.play("run") + else: + animated_sprite.play("jump") + + move_and_slide() + if right_ray.is_colliding(): + print("right ray is colliding") + var collider = right_ray.get_collider() + #what did we hit? + if collider is Node: + if collider.is_in_group("boxes"): + print("This is a pushable box") + pushRightEnabled = true + pushTarget = collider + else: + pushRightEnabled = false + + if left_ray.is_colliding(): + print("left ray is colliding") + var collider = left_ray.get_collider() + if collider is Node: + if collider.is_in_group("boxes"): + pushLeftEnabled = true + pushTarget = collider + else: + pushLeftEnabled = false + + #loop through the collisions + for i in get_slide_collision_count(): + var c = get_slide_collision(i) + if c.get_collider() is RigidBody2D: + c.get_collider().apply_central_impulse(-c.get_normal()* BUMP_FORCE) diff --git a/scripts/badguy.gd b/scripts/badguy.gd new file mode 100644 index 0000000..10a73ee --- /dev/null +++ b/scripts/badguy.gd @@ -0,0 +1,40 @@ +extends Area2D + +const speed = 60 +var direction = 1 +@onready var right_cast = $RightCast +@onready var left_cast = $LeftCast +@onready var right_floor_cast = $rightFloorCast +@onready var left_floor_cast = $leftFloorCast +@onready var sprite = $AnimatedSprite2D +@onready var game = %GameController + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + if right_cast.is_colliding(): + if not right_cast.get_collider().is_in_group("player"): + direction = -1 + sprite.flip_h = true + if left_cast.is_colliding(): + if not left_cast.get_collider().is_in_group("player"): + direction = 1 + sprite.flip_h = false + if not right_floor_cast.is_colliding(): + direction = -1 + sprite.flip_h = true + if not left_floor_cast.is_colliding(): + direction = 1 + sprite.flip_h = false + position.x += direction * speed * delta + + +func _on_body_entered(body): + print("something hit the bad guy") + if body.is_in_group("player"): + game.playerDeath() + diff --git a/scripts/coin.gd b/scripts/coin.gd new file mode 100644 index 0000000..338b04c --- /dev/null +++ b/scripts/coin.gd @@ -0,0 +1,19 @@ +extends Area2D +@onready var game = %GameController + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + + +func _on_body_entered(body): + if body.is_in_group("player"): + print("something hit the coin") + game.coinCollected() + queue_free() diff --git a/scripts/gamecontroller.gd b/scripts/gamecontroller.gd index ca40a31..f535038 100644 --- a/scripts/gamecontroller.gd +++ b/scripts/gamecontroller.gd @@ -1,7 +1,12 @@ -extends Node2D +extends Node var myBox = preload("res://scenes/crate.tscn") -@onready var box_trap = $BoxTrap +@onready var box_trap = $"../BoxTrap" +@onready var timer = $Timer +@onready var player = $"../CharacterBody2D" + + +var totalCoins = 0 # Called when the node enters the scene tree for the first time. func _ready(): @@ -22,8 +27,16 @@ func _on_area_2d_areatrigger(effect, body): if body.is_in_group("player"): for n in 3: var box = myBox.instantiate() - add_child(box) + owner.add_child(box) box.position = box_trap.position "powerup": print("you got power") - +func coinCollected(): + totalCoins += 1 + print("game controller will add coin" + str(totalCoins) ) +func playerDeath(): + player.die() + timer.start() + +func resetWorld(): + get_tree().reload_current_scene()