diff --git a/.godot/editor/Trigger.gd-folding-d8b27d524c55c751f790b95800ba03e2.cfg b/.godot/editor/Trigger.gd-folding-d8b27d524c55c751f790b95800ba03e2.cfg new file mode 100644 index 0000000..762d715 --- /dev/null +++ b/.godot/editor/Trigger.gd-folding-d8b27d524c55c751f790b95800ba03e2.cfg @@ -0,0 +1,3 @@ +[folding] + +sections_unfolded=PackedStringArray("Resource") 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..9760522 --- /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(-43.2845, -16.7919), +"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": 7.55099 +} +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/GameController/Timer")]) diff --git a/.godot/editor/badguy.tscn-folding-e196a632ea77e9a0d8baa608f164a4d2.cfg b/.godot/editor/badguy.tscn-folding-e196a632ea77e9a0d8baa608f164a4d2.cfg new file mode 100644 index 0000000..6bb0792 --- /dev/null +++ b/.godot/editor/badguy.tscn-folding-e196a632ea77e9a0d8baa608f164a4d2.cfg @@ -0,0 +1,5 @@ +[folding] + +node_unfolds=[NodePath("AnimatedSprite2D"), PackedStringArray("Animation")] +resource_unfolds=["res://scenes/badguy.tscn::SpriteFrames_t8k3l", PackedStringArray(), "res://scenes/badguy.tscn::RectangleShape2D_nrtm8", PackedStringArray()] +nodes_folded=[] diff --git a/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg b/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg index 52d505a..578046d 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")]) +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/GameController/Timer")]) diff --git a/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg b/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg index 0b2d3d3..c2f578c 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(-234.664, -212.684), +"ofs": Vector2(-78.6272, -67.7781), "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.7818 +"zoom": 5.33936 } 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")]) +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/GameController/Timer")]) 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..a651642 --- /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(-37.3845, -20.7875), +"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": 12.6992 +} +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/GameController/Timer")]) diff --git a/.godot/editor/coin.tscn-folding-96b2131180b71dd158e52c5527d22dd4.cfg b/.godot/editor/coin.tscn-folding-96b2131180b71dd158e52c5527d22dd4.cfg new file mode 100644 index 0000000..aa3a261 --- /dev/null +++ b/.godot/editor/coin.tscn-folding-96b2131180b71dd158e52c5527d22dd4.cfg @@ -0,0 +1,5 @@ +[folding] + +node_unfolds=[NodePath("AnimatedSprite2D"), PackedStringArray("Animation", "Texture")] +resource_unfolds=["res://scenes/coin.tscn::SpriteFrames_kfu8w", PackedStringArray(), "res://scenes/coin.tscn::CircleShape2D_6jtug", PackedStringArray()] +nodes_folded=[] diff --git a/.godot/editor/crate.tscn-editstate-65637dc57c83dac3d15ec1cb22439bd7.cfg b/.godot/editor/crate.tscn-editstate-65637dc57c83dac3d15ec1cb22439bd7.cfg index cc999ce..4bc2b30 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")]) +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/GameController/Timer")]) diff --git a/.godot/editor/create_recent.Node b/.godot/editor/create_recent.Node index ee8f3fa..ba90154 100644 --- a/.godot/editor/create_recent.Node +++ b/.godot/editor/create_recent.Node @@ -1,11 +1,14 @@ +Timer +RayCast2D +AnimatedSprite2D +CollisionShape2D +Area2D +Node +Sprite2D +ParallaxLayer +ParallaxBackground Node2D AnimationPlayer -CollisionShape2D AnimatableBody2D -Sprite2D TileMap Camera2D -Node -AnimatedSprite2D -Area2D -RayCast2D diff --git a/.godot/editor/editor_layout.cfg b/.godot/editor/editor_layout.cfg index 8a143c2..aeaee88 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://scenes/platform.tscn") -dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://scripts/", "res://scenes/", "res://graphics/") +dock_filesystem_selected_paths=PackedStringArray("res://graphics/player animations/Player Death 64x64.png") +dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://scripts/", "res://scenes/", "res://graphics/", "res://graphics/player animations/") 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=-361 +center_split_offset=-304 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 @@ -47,3 +47,13 @@ list_split_offset=0 open_shaders=[] split_offset=0 selected_shader="" + +[editor_log] + +log_filter_0=true +log_filter_2=true +log_filter_1=true +log_filter_3=true +log_filter_4=true +collapse=false +show_search=true diff --git a/.godot/editor/filesystem_cache8 b/.godot/editor/filesystem_cache8 index e38ff6a..756a2a3 100644 --- a/.godot/editor/filesystem_cache8 +++ b/.godot/editor/filesystem_cache8 @@ -1,21 +1,35 @@ ea4bc82a6ad023ab7ee23ee620429895 -::res://::1722298098 -icon.svg::CompressedTexture2D::9114977118871582245::1722291758::1722291758::1::::<><>:: -README.md::TextFile::-1::1722291758::0::1::::<><>:: -::res://graphics/::1722298098 -bullet.png::CompressedTexture2D::4481112836284868801::1722298085::1722298098::1::::<><>:: -crate.png::CompressedTexture2D::8555584700510586149::1722291758::1722291758::1::::<><>:: -Player Idle 48x48.png::CompressedTexture2D::3529809544777189649::1722291758::1722291758::1::::<><>:: -player jump 48x48.png::CompressedTexture2D::3342890448265989669::1722291758::1722291758::1::::<><>:: -player run 48x48.png::CompressedTexture2D::2400852804432818940::1722291758::1722291758::1::::<><>:: -Terrain (32x32).png::CompressedTexture2D::6866676332079345064::1722291758::1722291758::1::::<><>:: -::res://scenes/::1722298098 -bullet.tscn::PackedScene::6880909734590904373::1722297856::0::1::::<><>::res://scripts/bullet.gd -character.tscn::PackedScene::451838158579532324::1722297856::0::1::::<><>::res://scripts/CharacterBody2D.gd<>uid://bqj4phkget2pp::::res://graphics/Player Idle 48x48.png<>uid://bnvk6gm188vsv::::res://graphics/player jump 48x48.png<>uid://bag8xvlev6yxg::::res://graphics/player run 48x48.png -crate.tscn::PackedScene::7138073747019797840::1722297856::0::1::::<><>::uid://dt5nh26eq2a5r::::res://graphics/crate.png -game.tscn::PackedScene::1738196330916037717::1722297856::0::1::::<><>::res://scripts/gamecontroller.gd<>uid://go4yc8hfo1gq::::res://scenes/character.tscn<>uid://c43jfkjw11rsq::::res://graphics/Terrain (32x32).png<>res://scripts/Trigger.gd<>uid://c8x0bcxa8t74o::::res://scenes/crate.tscn -::res://scripts/::1722293659 -bullet.gd::GDScript::-1::1722293659::0::1::::<>Area2D<>:: -CharacterBody2D.gd::GDScript::-1::1722293659::0::1::::<>CharacterBody2D<>:: -gamecontroller.gd::GDScript::-1::1722291758::0::1::::<>Node2D<>:: -Trigger.gd::GDScript::-1::1722291758::0::1::::<>Area2D<>:: +::res://::1723508951 +icon.svg::CompressedTexture2D::9114977118871582245::1723500338::1723500338::1::::<><>:: +README.md::TextFile::-1::1723500338::0::1::::<><>:: +::res://graphics/::1723508951 +bullet.png::CompressedTexture2D::4481112836284868801::1723500338::1723500338::1::::<><>:: +crate.png::CompressedTexture2D::8555584700510586149::1723500338::1723500338::1::::<><>:: +slime_purple.png::CompressedTexture2D::1169879343296382357::1723506273::1723506273::1::::<><>:: +Terrain (32x32).png::CompressedTexture2D::6866676332079345064::1723500338::1723500338::1::::<><>:: +::res://graphics/background/::1723502313 +Additional Sky.png::CompressedTexture2D::3499877156509682826::1723501223::1723501212::1::::<><>:: +Additional Water.png::CompressedTexture2D::4095518979319428373::1723501223::1723501212::1::::<><>:: +BG Image.png::CompressedTexture2D::2982006258268107973::1723501223::1723501212::1::::<><>:: +::res://graphics/pickups/::1723502327 +coin.png::CompressedTexture2D::8822567149024268114::1723502302::1723502327::1::::<><>:: +::res://graphics/player animations/::1723508981 +Player Death 64x64.png::CompressedTexture2D::4461411006036685561::1723508981::1723508981::1::::<><>:: +Player Idle 48x48.png::CompressedTexture2D::3529809544777189649::1723500338::1723508951::1::::<><>:: +player jump 48x48.png::CompressedTexture2D::3342890448265989669::1723500338::1723508951::1::::<><>:: +player run 48x48.png::CompressedTexture2D::2400852804432818940::1723500338::1723508951::1::::<><>:: +::res://scenes/::1723508954 +badguy.tscn::PackedScene::1001283511600753306::1723508878::0::1::::<><>::res://scripts/badguy.gd<>uid://qwx0hufw5cxp::::res://graphics/slime_purple.png +bullet.tscn::PackedScene::6880909734590904373::1723508878::0::1::::<><>::res://scripts/bullet.gd<>uid://b43xjkoc8qrmv::::res://graphics/bullet.png +character.tscn::PackedScene::451838158579532324::1723508954::0::1::::<><>::res://scripts/CharacterBody2D.gd<>uid://bqj4phkget2pp::::res://graphics/player animations/Player Idle 48x48.png<>uid://bnvk6gm188vsv::::res://graphics/player animations/player jump 48x48.png<>uid://bag8xvlev6yxg::::res://graphics/player animations/player run 48x48.png +coin.tscn::PackedScene::39001951564700926::1723508878::0::1::::<><>::uid://dxxynldiswq5g::::res://graphics/pickups/coin.png<>res://scripts/coin.gd +crate.tscn::PackedScene::7138073747019797840::1723508878::0::1::::<><>::uid://dt5nh26eq2a5r::::res://graphics/crate.png +game.tscn::PackedScene::1738196330916037717::1723508878::0::1::::<><>::res://scripts/gamecontroller.gd<>uid://go4yc8hfo1gq::::res://scenes/character.tscn<>uid://c43jfkjw11rsq::::res://graphics/Terrain (32x32).png<>res://scripts/Trigger.gd<>uid://c8x0bcxa8t74o::::res://scenes/crate.tscn<>uid://biqrhb0shtygr::::res://graphics/background/BG Image.png<>uid://bp4mp3bh45b6i::::res://graphics/background/Additional Sky.png<>uid://byl5umyabyltt::::res://graphics/background/Additional Water.png<>uid://cdgbcjrseeoka::::res://scenes/platform.tscn<>uid://s5mebw76f4y::::res://scenes/coin.tscn<>uid://oja81cvx8jvu::::res://scenes/badguy.tscn +platform.tscn::PackedScene::4995858953200417260::1723508878::0::1::::<><>:: +::res://scripts/::1723508876 +badguy.gd::GDScript::-1::1723508876::0::1::::<>Area2D<>:: +bullet.gd::GDScript::-1::1723500338::0::1::::<>Area2D<>:: +CharacterBody2D.gd::GDScript::-1::1723504296::0::1::::<>CharacterBody2D<>:: +coin.gd::GDScript::-1::1723504919::0::1::::<>Area2D<>:: +gamecontroller.gd::GDScript::-1::1723508737::0::1::::<>Node<>:: +Trigger.gd::GDScript::-1::1723505565::0::1::::<>Area2D<>:: diff --git a/.godot/editor/filesystem_update4 b/.godot/editor/filesystem_update4 index 5f56c92..9bc33c9 100644 --- a/.godot/editor/filesystem_update4 +++ b/.godot/editor/filesystem_update4 @@ -2,7 +2,11 @@ res://scenes/game.tscn res://scenes/character.tscn res://scenes/bullet.tscn res://scenes/crate.tscn -res://scripts/CharacterBody2D.gd -res://scripts/bullet.gd res://scenes/platform.tscn +res://scenes/coin.tscn +res://scripts/coin.gd res://scripts/gamecontroller.gd +res://scripts/CharacterBody2D.gd +res://scripts/Trigger.gd +res://scenes/badguy.tscn +res://scripts/badguy.gd diff --git a/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg b/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg index 8b96d7d..348d9fe 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(-39.9296, 9.56621), +"ofs": Vector2(-234.664, -212.684), "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.49831 +"zoom": 1.7818 } 3D={ "fov": 70.01, @@ -172,4 +172,4 @@ Anim={ "zfar": 4000.01, "znear": 0.05 } -selected_nodes=Array[NodePath]([]) +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/GameController/Timer")]) diff --git a/.godot/editor/game.tscn-folding-c2a7af834e91ff64325daddf58e45dc0.cfg b/.godot/editor/game.tscn-folding-c2a7af834e91ff64325daddf58e45dc0.cfg index 9c633f0..67151f5 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"), NodePath("Platform"), PackedStringArray("Transform")] +node_unfolds=[NodePath("."), PackedStringArray("Transform"), NodePath("TileMap"), PackedStringArray("tile_set"), NodePath("ParallaxBackground/ParallaxLayer"), PackedStringArray("Motion"), NodePath("ParallaxBackground/ParallaxLayer/bg"), PackedStringArray("Transform"), NodePath("ParallaxBackground/ParallaxLayer/sky"), PackedStringArray("Transform"), NodePath("ParallaxBackground/ParallaxLayer/water"), PackedStringArray("Transform"), NodePath("level/StaticBody2D"), PackedStringArray("Transform"), NodePath("CharacterBody2D"), PackedStringArray("Transform"), NodePath("CharacterBody2D/Camera2D"), PackedStringArray("Position Smoothing"), NodePath("Area2D"), PackedStringArray("Transform"), NodePath("Platform"), PackedStringArray("Transform"), NodePath("Coins/Area2D2"), PackedStringArray("Transform"), NodePath("Coins/Area2D3"), PackedStringArray("Transform"), NodePath("Coins/Area2D5"), PackedStringArray("Transform"), NodePath("Coins/Area2D6"), PackedStringArray("Transform"), NodePath("Coins/Area2D8"), PackedStringArray("Transform"), NodePath("Coins/Area2D9"), 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")] +nodes_folded=[NodePath("RigidBody2D"), NodePath("Coins")] diff --git a/.godot/editor/gamecontroller.gd-folding-f1f331c27a8a747c68def87f3a691aa7.cfg b/.godot/editor/gamecontroller.gd-folding-f1f331c27a8a747c68def87f3a691aa7.cfg index e860dd4..762d715 100644 --- a/.godot/editor/gamecontroller.gd-folding-f1f331c27a8a747c68def87f3a691aa7.cfg +++ b/.godot/editor/gamecontroller.gd-folding-f1f331c27a8a747c68def87f3a691aa7.cfg @@ -1,3 +1,3 @@ [folding] -sections_unfolded=PackedStringArray() +sections_unfolded=PackedStringArray("Resource") diff --git a/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg b/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg index 32d2c94..ab24c91 100644 --- a/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg +++ b/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.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")]) +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/GameController/Timer")]) diff --git a/.godot/editor/project_metadata.cfg b/.godot/editor/project_metadata.cfg index e6ab239..71c0966 100644 --- a/.godot/editor/project_metadata.cfg +++ b/.godot/editor/project_metadata.cfg @@ -1,6 +1,6 @@ [editor_metadata] -executable_path="/home/timberg/Documents/software/godot/Godot_v4.2.1-stable_linux.x86_64" +executable_path="/home/timboyo/Documents/software/godot/Godot_v4.2.1-stable_linux.x86_64" use_advanced_connections=false tile_source_sort=0 tile_snap_option=0 @@ -15,8 +15,8 @@ run_deploy_remote_debug=false [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/character.tscn", "res://scenes/badguy.tscn", "res://scenes/coin.tscn", "res://scenes/platform.tscn", "res://scenes/crate.tscn", "res://scenes/bullet.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,11 @@ Camera2D:scale=true TileMap:scale=true Sprite2D:scale=true AnimatableBody2D:scale=true +ParallaxBackground:scroll_base_scale=true +ParallaxBackground:scale=true +ParallaxLayer:motion_scale=true +ParallaxLayer:scale=true +MultiNodeEdit:scale=true [dialog_bounds] diff --git a/.godot/editor/recent_dirs b/.godot/editor/recent_dirs index 21e4d30..a2d4b54 100644 --- a/.godot/editor/recent_dirs +++ b/.godot/editor/recent_dirs @@ -1,3 +1,5 @@ -res://scenes -res://graphics +res://graphics/player animations res://scripts +res://graphics +res://scenes +res://graphics/pickups diff --git a/.godot/editor/script_editor_cache.cfg b/.godot/editor/script_editor_cache.cfg index 3f8c6fd..7b535d8 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": 5, +"column": 31, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 13, -"scroll_position": 0.0, +"row": 40, +"scroll_position": 20.0, "selection": false, "syntax_highlighter": "GDScript" } @@ -17,16 +17,12 @@ state={ state={ "bookmarks": PackedInt32Array(), "breakpoints": PackedInt32Array(), -"column": 3, +"column": 7, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 53, -"scroll_position": 76.0, -"selection": true, -"selection_from_column": 3, -"selection_from_line": 53, -"selection_to_column": 53, -"selection_to_line": 53, +"row": 43, +"scroll_position": 16.0, +"selection": false, "syntax_highlighter": "GDScript" } @@ -49,10 +45,38 @@ state={ state={ "bookmarks": PackedInt32Array(), "breakpoints": PackedInt32Array(), -"column": 0, +"column": 7, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 8, +"row": 7, +"scroll_position": 0.0, +"selection": false, +"syntax_highlighter": "GDScript" +} + +[res://scripts/coin.gd] + +state={ +"bookmarks": PackedInt32Array(), +"breakpoints": PackedInt32Array(), +"column": 20, +"folded_lines": Array[int]([]), +"h_scroll_position": 0, +"row": 10, +"scroll_position": 0.0, +"selection": false, +"syntax_highlighter": "GDScript" +} + +[res://scripts/badguy.gd] + +state={ +"bookmarks": PackedInt32Array(), +"breakpoints": PackedInt32Array(), +"column": 13, +"folded_lines": Array[int]([]), +"h_scroll_position": 0, +"row": 38, "scroll_position": 0.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 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/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/Player Death 64x64.png-07d55bb7914f74cde65b4e7813845f63.ctex b/.godot/imported/Player Death 64x64.png-07d55bb7914f74cde65b4e7813845f63.ctex new file mode 100644 index 0000000..80fda5e Binary files /dev/null and b/.godot/imported/Player Death 64x64.png-07d55bb7914f74cde65b4e7813845f63.ctex differ diff --git a/.godot/imported/Player Death 64x64.png-07d55bb7914f74cde65b4e7813845f63.md5 b/.godot/imported/Player Death 64x64.png-07d55bb7914f74cde65b4e7813845f63.md5 new file mode 100644 index 0000000..ec35684 --- /dev/null +++ b/.godot/imported/Player Death 64x64.png-07d55bb7914f74cde65b4e7813845f63.md5 @@ -0,0 +1,3 @@ +source_md5="e5256a9ceb0ab699f4b89ff036b2a902" +dest_md5="9cd9459a73f825afbfd37992d6a40bfb" + diff --git a/.godot/imported/Player Idle 48x48.png-066c13364c835b926ef316365230dd27.ctex b/.godot/imported/Player Idle 48x48.png-066c13364c835b926ef316365230dd27.ctex new file mode 100644 index 0000000..25ed9e3 Binary files /dev/null and b/.godot/imported/Player Idle 48x48.png-066c13364c835b926ef316365230dd27.ctex differ diff --git a/.godot/imported/Player Idle 48x48.png-066c13364c835b926ef316365230dd27.md5 b/.godot/imported/Player Idle 48x48.png-066c13364c835b926ef316365230dd27.md5 new file mode 100644 index 0000000..3dd0db8 --- /dev/null +++ b/.godot/imported/Player Idle 48x48.png-066c13364c835b926ef316365230dd27.md5 @@ -0,0 +1,3 @@ +source_md5="25eca82a8943e0cb7df742fc2f8287eb" +dest_md5="40424c46e7e7da6cb6f8f38becacd5fa" + 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/player jump 48x48.png-b869b996dcf5a53b113106c729a33303.ctex b/.godot/imported/player jump 48x48.png-b869b996dcf5a53b113106c729a33303.ctex new file mode 100644 index 0000000..dece7b1 Binary files /dev/null and b/.godot/imported/player jump 48x48.png-b869b996dcf5a53b113106c729a33303.ctex differ diff --git a/.godot/imported/player jump 48x48.png-b869b996dcf5a53b113106c729a33303.md5 b/.godot/imported/player jump 48x48.png-b869b996dcf5a53b113106c729a33303.md5 new file mode 100644 index 0000000..c3a4d5b --- /dev/null +++ b/.godot/imported/player jump 48x48.png-b869b996dcf5a53b113106c729a33303.md5 @@ -0,0 +1,3 @@ +source_md5="32c25d5ee4a6233bebc766fa35137e71" +dest_md5="e2c6a646cfe3495563ee0fd7127f6784" + diff --git a/.godot/imported/player run 48x48.png-6020c5c4d945c2c77d3b3740032a54d3.ctex b/.godot/imported/player run 48x48.png-6020c5c4d945c2c77d3b3740032a54d3.ctex new file mode 100644 index 0000000..ccf024f Binary files /dev/null and b/.godot/imported/player run 48x48.png-6020c5c4d945c2c77d3b3740032a54d3.ctex differ diff --git a/.godot/imported/player run 48x48.png-6020c5c4d945c2c77d3b3740032a54d3.md5 b/.godot/imported/player run 48x48.png-6020c5c4d945c2c77d3b3740032a54d3.md5 new file mode 100644 index 0000000..f9bbe2d --- /dev/null +++ b/.godot/imported/player run 48x48.png-6020c5c4d945c2c77d3b3740032a54d3.md5 @@ -0,0 +1,3 @@ +source_md5="01ad20affe3a719d2248d3eb59a0b3dd" +dest_md5="c7e49f2c0ac84ac6a6d941074f19bd68" + diff --git a/.godot/imported/slime_purple.png-bf0a0059a4be2cb1b3bbf91305f9550d.ctex b/.godot/imported/slime_purple.png-bf0a0059a4be2cb1b3bbf91305f9550d.ctex new file mode 100644 index 0000000..e3520a0 Binary files /dev/null and b/.godot/imported/slime_purple.png-bf0a0059a4be2cb1b3bbf91305f9550d.ctex differ diff --git a/.godot/imported/slime_purple.png-bf0a0059a4be2cb1b3bbf91305f9550d.md5 b/.godot/imported/slime_purple.png-bf0a0059a4be2cb1b3bbf91305f9550d.md5 new file mode 100644 index 0000000..f186d88 --- /dev/null +++ b/.godot/imported/slime_purple.png-bf0a0059a4be2cb1b3bbf91305f9550d.md5 @@ -0,0 +1,3 @@ +source_md5="54f57af24a12b9a7016da6f96c55a77d" +dest_md5="d56883b02fd383d0809e6e9ecbe5df3b" + diff --git a/.godot/uid_cache.bin b/.godot/uid_cache.bin index 162fa2e..efd3713 100644 Binary files a/.godot/uid_cache.bin and b/.godot/uid_cache.bin differ 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..3de96d2 --- /dev/null +++ b/graphics/background/Additional Sky.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bp4mp3bh45b6i" +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..11bf6ee --- /dev/null +++ b/graphics/background/Additional Water.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://byl5umyabyltt" +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..a63d98d --- /dev/null +++ b/graphics/background/BG Image.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://biqrhb0shtygr" +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/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..91febd2 --- /dev/null +++ b/graphics/pickups/coin.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dxxynldiswq5g" +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/graphics/player animations/Player Death 64x64.png b/graphics/player animations/Player Death 64x64.png new file mode 100644 index 0000000..2e6a1ae Binary files /dev/null and b/graphics/player animations/Player Death 64x64.png differ diff --git a/graphics/player animations/Player Death 64x64.png.import b/graphics/player animations/Player Death 64x64.png.import new file mode 100644 index 0000000..7eee76a --- /dev/null +++ b/graphics/player animations/Player Death 64x64.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b4te11j5ut62p" +path="res://.godot/imported/Player Death 64x64.png-07d55bb7914f74cde65b4e7813845f63.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/player animations/Player Death 64x64.png" +dest_files=["res://.godot/imported/Player Death 64x64.png-07d55bb7914f74cde65b4e7813845f63.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/Player Idle 48x48.png b/graphics/player animations/Player Idle 48x48.png similarity index 100% rename from graphics/Player Idle 48x48.png rename to graphics/player animations/Player Idle 48x48.png diff --git a/graphics/Player Idle 48x48.png.import b/graphics/player animations/Player Idle 48x48.png.import similarity index 68% rename from graphics/Player Idle 48x48.png.import rename to graphics/player animations/Player Idle 48x48.png.import index 3f0eea2..0df0b9a 100644 --- a/graphics/Player Idle 48x48.png.import +++ b/graphics/player animations/Player Idle 48x48.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bqj4phkget2pp" -path="res://.godot/imported/Player Idle 48x48.png-b25968a287377bab7d6899f33fed0ec9.ctex" +path="res://.godot/imported/Player Idle 48x48.png-066c13364c835b926ef316365230dd27.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://graphics/Player Idle 48x48.png" -dest_files=["res://.godot/imported/Player Idle 48x48.png-b25968a287377bab7d6899f33fed0ec9.ctex"] +source_file="res://graphics/player animations/Player Idle 48x48.png" +dest_files=["res://.godot/imported/Player Idle 48x48.png-066c13364c835b926ef316365230dd27.ctex"] [params] diff --git a/graphics/player jump 48x48.png b/graphics/player animations/player jump 48x48.png similarity index 100% rename from graphics/player jump 48x48.png rename to graphics/player animations/player jump 48x48.png diff --git a/graphics/player jump 48x48.png.import b/graphics/player animations/player jump 48x48.png.import similarity index 68% rename from graphics/player jump 48x48.png.import rename to graphics/player animations/player jump 48x48.png.import index a495350..8413f1b 100644 --- a/graphics/player jump 48x48.png.import +++ b/graphics/player animations/player jump 48x48.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bnvk6gm188vsv" -path="res://.godot/imported/player jump 48x48.png-44bab2151e6e1eb3cf69ed16e7a4f4ad.ctex" +path="res://.godot/imported/player jump 48x48.png-b869b996dcf5a53b113106c729a33303.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://graphics/player jump 48x48.png" -dest_files=["res://.godot/imported/player jump 48x48.png-44bab2151e6e1eb3cf69ed16e7a4f4ad.ctex"] +source_file="res://graphics/player animations/player jump 48x48.png" +dest_files=["res://.godot/imported/player jump 48x48.png-b869b996dcf5a53b113106c729a33303.ctex"] [params] diff --git a/graphics/player run 48x48.png b/graphics/player animations/player run 48x48.png similarity index 100% rename from graphics/player run 48x48.png rename to graphics/player animations/player run 48x48.png diff --git a/graphics/player run 48x48.png.import b/graphics/player animations/player run 48x48.png.import similarity index 68% rename from graphics/player run 48x48.png.import rename to graphics/player animations/player run 48x48.png.import index 955749b..b75f3ba 100644 --- a/graphics/player run 48x48.png.import +++ b/graphics/player animations/player run 48x48.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bag8xvlev6yxg" -path="res://.godot/imported/player run 48x48.png-626defb011aee5b3f5c54d9acb45d5f5.ctex" +path="res://.godot/imported/player run 48x48.png-6020c5c4d945c2c77d3b3740032a54d3.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://graphics/player run 48x48.png" -dest_files=["res://.godot/imported/player run 48x48.png-626defb011aee5b3f5c54d9acb45d5f5.ctex"] +source_file="res://graphics/player animations/player run 48x48.png" +dest_files=["res://.godot/imported/player run 48x48.png-6020c5c4d945c2c77d3b3740032a54d3.ctex"] [params] diff --git a/graphics/slime_purple.png b/graphics/slime_purple.png new file mode 100644 index 0000000..76f564e Binary files /dev/null and b/graphics/slime_purple.png differ diff --git a/graphics/slime_purple.png.import b/graphics/slime_purple.png.import new file mode 100644 index 0000000..caa2f92 --- /dev/null +++ b/graphics/slime_purple.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://qwx0hufw5cxp" +path="res://.godot/imported/slime_purple.png-bf0a0059a4be2cb1b3bbf91305f9550d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/slime_purple.png" +dest_files=["res://.godot/imported/slime_purple.png-bf0a0059a4be2cb1b3bbf91305f9550d.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..6af7be6 --- /dev/null +++ b/scenes/badguy.tscn @@ -0,0 +1,73 @@ +[gd_scene load_steps=9 format=3 uid="uid://oja81cvx8jvu"] + +[ext_resource type="Script" path="res://scripts/badguy.gd" id="1_du8nq"] +[ext_resource type="Texture2D" uid="uid://qwx0hufw5cxp" path="res://graphics/slime_purple.png" id="1_gpjbh"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_lrl51"] +atlas = ExtResource("1_gpjbh") +region = Rect2(0, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4jdgy"] +atlas = ExtResource("1_gpjbh") +region = Rect2(24, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7qvua"] +atlas = ExtResource("1_gpjbh") +region = Rect2(48, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_lc61m"] +atlas = ExtResource("1_gpjbh") +region = Rect2(72, 24, 24, 24) + +[sub_resource type="SpriteFrames" id="SpriteFrames_t8k3l"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_lrl51") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4jdgy") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_7qvua") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_lc61m") +}], +"loop": true, +"name": &"chase", +"speed": 12.0 +}] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_nrtm8"] +size = Vector2(14, 15) + +[node name="Area2D" type="Area2D"] +script = ExtResource("1_du8nq") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +sprite_frames = SubResource("SpriteFrames_t8k3l") +animation = &"chase" +autoplay = "chase" +frame_progress = 0.364441 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, 4.5) +shape = SubResource("RectangleShape2D_nrtm8") + +[node name="RightCast" type="RayCast2D" parent="."] +target_position = Vector2(9, 0) + +[node name="LeftCast" type="RayCast2D" parent="."] +target_position = Vector2(-9, 0) + +[node name="RightFloorCast" type="RayCast2D" parent="."] +position = Vector2(8, 10) +target_position = Vector2(0, 4) + +[node name="LeftFloorCast" type="RayCast2D" parent="."] +position = Vector2(-8, 10) +target_position = Vector2(0, 4) + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/scenes/character.tscn b/scenes/character.tscn index fe3f557..e2a4e53 100644 --- a/scenes/character.tscn +++ b/scenes/character.tscn @@ -1,98 +1,174 @@ -[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://bqj4phkget2pp" path="res://graphics/Player Idle 48x48.png" id="2_c7awu"] -[ext_resource type="Texture2D" uid="uid://bnvk6gm188vsv" path="res://graphics/player jump 48x48.png" id="3_h6vre"] -[ext_resource type="Texture2D" uid="uid://bag8xvlev6yxg" path="res://graphics/player run 48x48.png" id="3_w6p3w"] +[ext_resource type="Texture2D" uid="uid://bqj4phkget2pp" path="res://graphics/player animations/Player Idle 48x48.png" id="2_fibqb"] +[ext_resource type="Texture2D" uid="uid://b4te11j5ut62p" path="res://graphics/player animations/Player Death 64x64.png" id="2_lgyh4"] +[ext_resource type="Texture2D" uid="uid://bnvk6gm188vsv" path="res://graphics/player animations/player jump 48x48.png" id="3_1rbvb"] +[ext_resource type="Texture2D" uid="uid://bag8xvlev6yxg" path="res://graphics/player animations/player run 48x48.png" id="4_fouff"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_q43wd"] +atlas = ExtResource("2_lgyh4") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_r0cll"] +atlas = ExtResource("2_lgyh4") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6ujxt"] +atlas = ExtResource("2_lgyh4") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1baju"] +atlas = ExtResource("2_lgyh4") +region = Rect2(144, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i445f"] +atlas = ExtResource("2_lgyh4") +region = Rect2(192, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7op4n"] +atlas = ExtResource("2_lgyh4") +region = Rect2(240, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mtsu2"] +atlas = ExtResource("2_lgyh4") +region = Rect2(288, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_an4ql"] +atlas = ExtResource("2_lgyh4") +region = Rect2(336, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_cgbkp"] +atlas = ExtResource("2_lgyh4") +region = Rect2(384, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_p6mmk"] +atlas = ExtResource("2_lgyh4") +region = Rect2(432, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_aeg01"] -atlas = ExtResource("2_c7awu") +atlas = ExtResource("2_fibqb") region = Rect2(0, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_1uaof"] -atlas = ExtResource("2_c7awu") +atlas = ExtResource("2_fibqb") region = Rect2(48, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_gt6ba"] -atlas = ExtResource("2_c7awu") +atlas = ExtResource("2_fibqb") region = Rect2(96, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_tay2c"] -atlas = ExtResource("2_c7awu") +atlas = ExtResource("2_fibqb") region = Rect2(144, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_1ag8q"] -atlas = ExtResource("2_c7awu") +atlas = ExtResource("2_fibqb") region = Rect2(192, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_hjiy4"] -atlas = ExtResource("2_c7awu") +atlas = ExtResource("2_fibqb") region = Rect2(240, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_82onf"] -atlas = ExtResource("2_c7awu") +atlas = ExtResource("2_fibqb") region = Rect2(288, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_yqp8u"] -atlas = ExtResource("2_c7awu") +atlas = ExtResource("2_fibqb") region = Rect2(336, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_m6d3n"] -atlas = ExtResource("2_c7awu") +atlas = ExtResource("2_fibqb") region = Rect2(384, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_ax7e1"] -atlas = ExtResource("2_c7awu") +atlas = ExtResource("2_fibqb") region = Rect2(432, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_qrer8"] -atlas = ExtResource("3_h6vre") +atlas = ExtResource("3_1rbvb") region = Rect2(0, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_wpiaq"] -atlas = ExtResource("3_h6vre") +atlas = ExtResource("3_1rbvb") region = Rect2(48, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_kc70w"] -atlas = ExtResource("3_h6vre") +atlas = ExtResource("3_1rbvb") region = Rect2(96, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_i4hpn"] -atlas = ExtResource("3_w6p3w") +atlas = ExtResource("4_fouff") region = Rect2(0, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_sri3h"] -atlas = ExtResource("3_w6p3w") +atlas = ExtResource("4_fouff") region = Rect2(48, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_igbwk"] -atlas = ExtResource("3_w6p3w") +atlas = ExtResource("4_fouff") region = Rect2(96, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_t7p31"] -atlas = ExtResource("3_w6p3w") +atlas = ExtResource("4_fouff") region = Rect2(144, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_ovti0"] -atlas = ExtResource("3_w6p3w") +atlas = ExtResource("4_fouff") region = Rect2(192, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_2vy0d"] -atlas = ExtResource("3_w6p3w") +atlas = ExtResource("4_fouff") region = Rect2(240, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_klr2a"] -atlas = ExtResource("3_w6p3w") +atlas = ExtResource("4_fouff") region = Rect2(288, 0, 48, 48) [sub_resource type="AtlasTexture" id="AtlasTexture_ax6e1"] -atlas = ExtResource("3_w6p3w") +atlas = ExtResource("4_fouff") region = Rect2(336, 0, 48, 48) [sub_resource type="SpriteFrames" id="SpriteFrames_8idir"] animations = [{ "frames": [{ "duration": 1.0, +"texture": SubResource("AtlasTexture_q43wd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_r0cll") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_6ujxt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1baju") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i445f") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_7op4n") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_mtsu2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_an4ql") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_cgbkp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_p6mmk") +}], +"loop": false, +"name": &"death", +"speed": 12.0 +}, { +"frames": [{ +"duration": 1.0, "texture": SubResource("AtlasTexture_aeg01") }, { "duration": 1.0, @@ -183,7 +259,7 @@ metadata/_edit_group_ = true [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] texture_filter = 1 sprite_frames = SubResource("SpriteFrames_8idir") -animation = &"idle" +animation = &"death" autoplay = "idle" [node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/scenes/coin.tscn b/scenes/coin.tscn new file mode 100644 index 0000000..1ab84ea --- /dev/null +++ b/scenes/coin.tscn @@ -0,0 +1,112 @@ +[gd_scene load_steps=17 format=3 uid="uid://s5mebw76f4y"] + +[ext_resource type="Texture2D" uid="uid://dxxynldiswq5g" path="res://graphics/pickups/coin.png" id="1_4ikm0"] +[ext_resource type="Script" path="res://scripts/coin.gd" id="1_v7bd8"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_46q1v"] +atlas = ExtResource("1_4ikm0") +region = Rect2(0, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hugk0"] +atlas = ExtResource("1_4ikm0") +region = Rect2(16, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ujh61"] +atlas = ExtResource("1_4ikm0") +region = Rect2(32, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bniki"] +atlas = ExtResource("1_4ikm0") +region = Rect2(48, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_w5jr2"] +atlas = ExtResource("1_4ikm0") +region = Rect2(64, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_eyn6o"] +atlas = ExtResource("1_4ikm0") +region = Rect2(80, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wka16"] +atlas = ExtResource("1_4ikm0") +region = Rect2(96, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pd6kk"] +atlas = ExtResource("1_4ikm0") +region = Rect2(112, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_d0m54"] +atlas = ExtResource("1_4ikm0") +region = Rect2(128, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_33sqx"] +atlas = ExtResource("1_4ikm0") +region = Rect2(144, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ierav"] +atlas = ExtResource("1_4ikm0") +region = Rect2(160, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_lob1t"] +atlas = ExtResource("1_4ikm0") +region = Rect2(176, 0, 16, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_kfu8w"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_46q1v") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hugk0") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ujh61") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_bniki") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_w5jr2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_eyn6o") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wka16") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pd6kk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_d0m54") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_33sqx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ierav") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_lob1t") +}], +"loop": true, +"name": &"default", +"speed": 12.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_6jtug"] +radius = 5.0 + +[node name="Area2D" type="Area2D"] +script = ExtResource("1_v7bd8") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +sprite_frames = SubResource("SpriteFrames_kfu8w") +autoplay = "default" + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_6jtug") + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/scenes/game.tscn b/scenes/game.tscn index 0405801..c53b5c1 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://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="Texture2D" uid="uid://biqrhb0shtygr" path="res://graphics/background/BG Image.png" id="3_vj1tk"] +[ext_resource type="Texture2D" uid="uid://bp4mp3bh45b6i" path="res://graphics/background/Additional Sky.png" id="4_kk5vy"] +[ext_resource type="Texture2D" uid="uid://byl5umyabyltt" path="res://graphics/background/Additional Water.png" id="5_2y1x6"] [ext_resource type="PackedScene" uid="uid://cdgbcjrseeoka" path="res://scenes/platform.tscn" id="6_hm88c"] +[ext_resource type="PackedScene" uid="uid://s5mebw76f4y" path="res://scenes/coin.tscn" id="10_74ldf"] +[ext_resource type="PackedScene" uid="uid://oja81cvx8jvu" path="res://scenes/badguy.tscn" id="11_8t7ny"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_6otpc"] texture = ExtResource("2_juhow") @@ -494,6 +499,21 @@ sources/0 = SubResource("TileSetAtlasSource_6otpc") [sub_resource type="CircleShape2D" id="CircleShape2D_x8qck"] radius = 60.2993 +[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="Animation" id="Animation_ohhmw"] resource_name = "move" length = 2.0 @@ -511,21 +531,6 @@ tracks/0/keys = { "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"), @@ -533,12 +538,36 @@ _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_25cld") format = 2 -layer_0/tile_data = PackedInt32Array(851971, 0, 0, 851972, 65536, 0, 851973, 65536, 0, 851974, 65536, 0, 851975, 65536, 0, 851976, 65536, 0, 851977, 65536, 0, 851978, 65536, 0, 851979, 65536, 0, 917515, 65536, 2, 917514, 65536, 2, 917513, 65536, 2, 917512, 65536, 2, 917511, 65536, 2, 917510, 65536, 2, 917509, 65536, 2, 917508, 65536, 2, 917507, 0, 2, 851980, 458752, 1, 851981, 393216, 1, 851982, 65536, 0, 851983, 65536, 0, 851984, 65536, 0, 851985, 65536, 0, 851986, 65536, 0, 851987, 131072, 0, 917516, 65536, 2, 917517, 65536, 2, 917518, 65536, 2, 917519, 65536, 2, 917520, 65536, 2, 917521, 65536, 2, 917522, 65536, 2, 917523, 131072, 2, 786444, 0, 1, 720908, 0, 1, 655372, 0, 0, 655373, 131072, 0, 720909, 131072, 1, 786445, 131072, 1, 458763, 131072, 4, 458762, 0, 4, 458766, 0, 4, 458767, 131072, 4, 262155, 0, 4, 262156, 65536, 4, 262157, 65536, 4, 262158, 131072, 4, 262161, 983040, 3, 327697, 262144, 1, 393234, 65536, 4, 393233, 983040, 4, 393235, 1048576, 4, 327699, 262144, 1, 262163, 1048576, 3, 262162, 65536, 4, 655379, 0, 4, 655380, 65536, 4, 655381, 131072, 4, 458774, 0, 4, 458775, 65536, 4, 458776, 131072, 4) +layer_0/tile_data = PackedInt32Array(851971, 0, 0, 851972, 65536, 0, 851973, 65536, 0, 851974, 65536, 0, 851975, 65536, 0, 851976, 65536, 0, 851977, 65536, 0, 851978, 65536, 0, 851979, 65536, 0, 917515, 65536, 2, 917514, 65536, 2, 917513, 65536, 2, 917512, 65536, 2, 917511, 65536, 2, 917510, 65536, 2, 917509, 65536, 2, 917508, 65536, 2, 917507, 0, 2, 851980, 458752, 1, 851981, 393216, 1, 851982, 65536, 0, 851983, 65536, 0, 851984, 65536, 0, 851985, 65536, 0, 851986, 65536, 0, 851987, 65536, 0, 917516, 65536, 2, 917517, 65536, 2, 917518, 65536, 2, 917519, 65536, 2, 917520, 65536, 2, 917521, 65536, 2, 917522, 65536, 2, 917523, 65536, 2, 786444, 0, 1, 720908, 0, 1, 655372, 0, 0, 655373, 131072, 0, 720909, 131072, 1, 786445, 131072, 1, 458763, 131072, 4, 458762, 0, 4, 458766, 0, 4, 458767, 131072, 4, 262155, 0, 4, 262156, 65536, 4, 262157, 65536, 4, 262158, 131072, 4, 262161, 983040, 3, 327697, 262144, 1, 393233, 262144, 2, 393235, 262144, 2, 327699, 262144, 1, 262163, 1048576, 3, 262162, 65536, 4, 655379, 0, 4, 655380, 65536, 4, 655381, 131072, 4, 458774, 0, 4, 458775, 65536, 4, 458776, 131072, 4, 851989, 65536, 0, 851990, 65536, 0, 851991, 458752, 1, 917527, 65536, 2, 917528, 131072, 2, 851992, 131072, 1, 851988, 65536, 0, 917524, 65536, 2, 917525, 65536, 2, 917526, 65536, 2, 786455, 0, 0, 786456, 131072, 0, 524306, 262144, 4) + +[node name="ParallaxBackground" type="ParallaxBackground" parent="."] + +[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] +motion_mirroring = Vector2(380, 0) + +[node name="bg" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"] +position = Vector2(194, 400) +texture = ExtResource("3_vj1tk") + +[node name="sky" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"] +position = Vector2(194, 48) +scale = Vector2(12, 18.4375) +texture = ExtResource("4_kk5vy") + +[node name="water" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"] +position = Vector2(194, 654) +scale = Vector2(12, 12) +texture = ExtResource("5_2y1x6") [node name="RigidBody2D" parent="." instance=ExtResource("2_ob312")] position = Vector2(138, 97) @@ -557,7 +586,7 @@ position = Vector2(112, 336) PUSH_FORCE = 550 [node name="Camera2D" type="Camera2D" parent="CharacterBody2D"] -position_smoothing_speed = 6.5 +position_smoothing_speed = 6.0 [node name="Area2D" type="Area2D" parent="."] position = Vector2(417, 92) @@ -583,5 +612,38 @@ autoplay = "move" [node name="BoxTrap" type="Node2D" parent="."] position = Vector2(415, -10) -[connection signal="areatrigger" from="Area2D" to="." method="_on_area_2d_areatrigger"] +[node name="Coins" type="Node" parent="."] + +[node name="Area2D2" parent="Coins" instance=ExtResource("10_74ldf")] +position = Vector2(328, 403) + +[node name="Area2D3" parent="Coins" instance=ExtResource("10_74ldf")] +position = Vector2(293, 403) + +[node name="Area2D4" parent="Coins" instance=ExtResource("10_74ldf")] +position = Vector2(257, 403) + +[node name="Area2D5" parent="Coins" instance=ExtResource("10_74ldf")] +position = Vector2(221, 403) + +[node name="Area2D6" parent="Coins" instance=ExtResource("10_74ldf")] +position = Vector2(362, 403) + +[node name="Area2D7" parent="Coins" instance=ExtResource("10_74ldf")] +position = Vector2(415, 304) + +[node name="Area2D8" parent="Coins" instance=ExtResource("10_74ldf")] +position = Vector2(473, 403) + +[node name="Area2D9" parent="Coins" instance=ExtResource("10_74ldf")] +position = Vector2(507, 403) + +[node name="Area2D10" parent="Coins" instance=ExtResource("10_74ldf")] +position = Vector2(592, 176) + +[node name="Area2D2" parent="." instance=ExtResource("11_8t7ny")] +position = Vector2(187, 404) + +[connection signal="timeout" from="GameController/Timer" to="GameController" method="resetWorld"] +[connection signal="areatrigger" from="Area2D" to="GameController" method="_on_area_2d_areatrigger"] [connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"] diff --git a/scripts/CharacterBody2D.gd b/scripts/CharacterBody2D.gd index f7b79e2..ffa4e9e 100644 --- a/scripts/CharacterBody2D.gd +++ b/scripts/CharacterBody2D.gd @@ -16,6 +16,7 @@ var faceLeft = false var pushLeftEnabled = false var pushRightEnabled = false var pushTarget +var living = true #preload bullet scene to be able to shoot it var bullet = preload("res://scenes/bullet.tscn") @@ -23,87 +24,92 @@ 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 die(): + print("You died!") + animated_sprite.play("death") + living = false + func _physics_process(delta): - # Add the gravity. + # 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: - print("I should force push") - pushTarget.apply_central_impulse(Vector2(1,0) * PUSH_FORCE * 10) - pushRightEnabled = false - if Input.is_action_just_pressed("push") && pushLeftEnabled: - pushTarget.apply_central_impulse(Vector2(-1,0) * PUSH_FORCE * 10) - pushLeftEnabled = false - - if Input.is_action_just_pressed("shoot"): - #make a bullet -- must be a scene in order to "instantiate" - var myBullet = bullet.instantiate() - #set bullet speed? - - #"owner" adds it to the character's parent node - the game scene - owner.add_child(myBullet) - - #put the bullet at the Marker, specifically at its global coordinates - if not faceLeft: - #facing right - myBullet.transform = marker_right.global_transform + if living: + # 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: + print("I should force push") + pushTarget.apply_central_impulse(Vector2(1,0) * PUSH_FORCE * 10) + pushRightEnabled = false + if Input.is_action_just_pressed("push") && pushLeftEnabled: + pushTarget.apply_central_impulse(Vector2(-1,0) * PUSH_FORCE * 10) + pushLeftEnabled = false + + if Input.is_action_just_pressed("shoot"): + #make a bullet -- must be a scene in order to "instantiate" + var myBullet = bullet.instantiate() + #set bullet speed? + + #"owner" adds it to the character's parent node - the game scene + owner.add_child(myBullet) + + #put the bullet at the Marker, specifically at its global coordinates + if not faceLeft: + #facing right + myBullet.transform = marker_right.global_transform + else: + #facing left + myBullet.transform = marker_left.global_transform + myBullet.setSpeed(-750) + pass + + # 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 direction <0: + faceLeft = true + if direction >0: + faceLeft = false + + if direction: + velocity.x = direction * SPEED + animated_sprite.flip_h = true if direction <0 else false else: - #facing left - myBullet.transform = marker_left.global_transform - myBullet.setSpeed(-750) - pass - - # 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 direction <0: - faceLeft = true - if direction >0: - faceLeft = false - - if direction: - velocity.x = direction * SPEED - animated_sprite.flip_h = true if direction <0 else false - else: - velocity.x = move_toward(velocity.x, 0, SPEED) - if is_on_floor(): - if direction == 0: - animated_sprite.play("idle") + 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("run") - else: - animated_sprite.play("jump") + 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) + 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..bd59431 --- /dev/null +++ b/scripts/badguy.gd @@ -0,0 +1,40 @@ +extends Area2D + +@export var speed = 60.0 +var direction = 1 + +@onready var right_cast = $RightCast +@onready var left_cast = $LeftCast +@onready var sprite = $AnimatedSprite2D +@onready var right_floor_cast = $RightFloorCast +@onready var left_floor_cast = $LeftFloorCast +@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 + if left_cast.is_colliding(): + if not left_cast.get_collider().is_in_group("player"): + direction = 1 + if not right_floor_cast.is_colliding(): + direction = -1 + if not left_floor_cast.is_colliding(): + direction = 1 + if direction == -1: + sprite.flip_h = true + else: + sprite.flip_h = false + #movement + position.x += direction * speed * delta + + +func _on_body_entered(body): + if body.is_in_group("player"): + game.playerDeath() diff --git a/scripts/coin.gd b/scripts/coin.gd new file mode 100644 index 0000000..03939fa --- /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("somebody entered a coin") + game.coinCollected() + queue_free() diff --git a/scripts/gamecontroller.gd b/scripts/gamecontroller.gd index fbcee54..4231f72 100644 --- a/scripts/gamecontroller.gd +++ b/scripts/gamecontroller.gd @@ -1,8 +1,12 @@ -extends Node2D +extends Node #preloading crate and marker for box trap 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,5 +26,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.transform = box_trap.transform + +func coinCollected(): + totalCoins += 1 + print("I have " + str(totalCoins) + " coins") + +func playerDeath(): + player.die() + timer.start() + +func resetWorld(): + get_tree().reload_current_scene()