diff --git a/assets/graphics/Objects/crate.png b/assets/graphics/Objects/crate.png new file mode 100644 index 0000000..2b8bdcd Binary files /dev/null and b/assets/graphics/Objects/crate.png differ diff --git a/assets/graphics/Objects/crate.png.import b/assets/graphics/Objects/crate.png.import new file mode 100644 index 0000000..8b2f1d0 --- /dev/null +++ b/assets/graphics/Objects/crate.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cwqg8abyy5w83" +path="res://.godot/imported/crate.png-91fc7aa90c75ee2024a967b1d4565c18.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/Objects/crate.png" +dest_files=["res://.godot/imported/crate.png-91fc7aa90c75ee2024a967b1d4565c18.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/assets/graphics/terrain/Terrain (32x32).png b/assets/graphics/terrain/Terrain (32x32).png new file mode 100644 index 0000000..ddf1eaf Binary files /dev/null and b/assets/graphics/terrain/Terrain (32x32).png differ diff --git a/assets/graphics/terrain/Terrain (32x32).png.import b/assets/graphics/terrain/Terrain (32x32).png.import new file mode 100644 index 0000000..8384cc7 --- /dev/null +++ b/assets/graphics/terrain/Terrain (32x32).png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bqakmwe3qjd6f" +path="res://.godot/imported/Terrain (32x32).png-194c6de0879a7b165a791510d6d55058.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/terrain/Terrain (32x32).png" +dest_files=["res://.godot/imported/Terrain (32x32).png-194c6de0879a7b165a791510d6d55058.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/assets/graphics/terrain/mushroom_32x64.png b/assets/graphics/terrain/mushroom_32x64.png new file mode 100644 index 0000000..9eb1840 Binary files /dev/null and b/assets/graphics/terrain/mushroom_32x64.png differ diff --git a/assets/graphics/terrain/mushroom_32x64.png.import b/assets/graphics/terrain/mushroom_32x64.png.import new file mode 100644 index 0000000..1a0ffe0 --- /dev/null +++ b/assets/graphics/terrain/mushroom_32x64.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cv5gem318pcqe" +path="res://.godot/imported/mushroom_32x64.png-f12f42a6ec1836029b0210f491978f62.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/terrain/mushroom_32x64.png" +dest_files=["res://.godot/imported/mushroom_32x64.png-f12f42a6ec1836029b0210f491978f62.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/assets/graphics/terrain/mushroom_32x64.xcf b/assets/graphics/terrain/mushroom_32x64.xcf new file mode 100644 index 0000000..ac15d3c Binary files /dev/null and b/assets/graphics/terrain/mushroom_32x64.xcf differ diff --git a/assets/graphics/terrain/veg_32x32.png b/assets/graphics/terrain/veg_32x32.png new file mode 100644 index 0000000..4e09fa9 Binary files /dev/null and b/assets/graphics/terrain/veg_32x32.png differ diff --git a/assets/graphics/terrain/veg_32x32.png.import b/assets/graphics/terrain/veg_32x32.png.import new file mode 100644 index 0000000..e447e49 --- /dev/null +++ b/assets/graphics/terrain/veg_32x32.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dl7pi3on53f4o" +path="res://.godot/imported/veg_32x32.png-eb0055740e9ad460be3aaf42cfb5ae88.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/terrain/veg_32x32.png" +dest_files=["res://.godot/imported/veg_32x32.png-eb0055740e9ad460be3aaf42cfb5ae88.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/project.godot b/project.godot index 7420c21..7addd1d 100644 --- a/project.godot +++ b/project.godot @@ -17,7 +17,11 @@ config/icon="res://icon.svg" [display] -window/stretch/mode="canvas_items" +window/size/viewport_width=400 +window/size/viewport_height=225 +window/size/window_width_override=900 +window/size/window_height_override=504 +window/stretch/mode="viewport" window/stretch/aspect="expand" [file_customization] @@ -32,11 +36,31 @@ folder_colors={ shove={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":76,"key_label":0,"unicode":108,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":true,"script":null) ] } shoot={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":88,"key_label":0,"unicode":120,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null) +] +} +left={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":13,"pressure":0.0,"pressed":true,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +right={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":14,"pressure":0.0,"pressed":true,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +jump={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":11,"pressure":0.0,"pressed":true,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null) ] } diff --git a/scenes/crate.tscn b/scenes/crate.tscn index bb0c91d..147b388 100644 --- a/scenes/crate.tscn +++ b/scenes/crate.tscn @@ -1,11 +1,13 @@ [gd_scene format=3 uid="uid://n3nikeltgorc"] [ext_resource type="Script" uid="uid://bm4rr2spukcxt" path="res://scripts/crate.gd" id="1_b66cd"] +[ext_resource type="Texture2D" uid="uid://cwqg8abyy5w83" path="res://assets/graphics/Objects/crate.png" id="2_dwt0d"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_kvpdf"] size = Vector2(18.97712, 20) [node name="Crate" type="RigidBody2D" unique_id=1917613907] +texture_filter = 1 script = ExtResource("1_b66cd") metadata/_edit_group_ = true @@ -14,3 +16,7 @@ position = Vector2(-0.51144075, 0) scale = Vector2(1.0000001, 1.0000001) shape = SubResource("RectangleShape2D_kvpdf") debug_color = Color(0.7640784, 0.29976174, 0.010127576, 0.41960785) + +[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1915213724] +scale = Vector2(0.07, 0.07) +texture = ExtResource("2_dwt0d") diff --git a/scenes/game.tscn b/scenes/game.tscn index b18a79d..ff972a9 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -1,10 +1,396 @@ -[gd_scene format=3 uid="uid://bmghctv58ymhx"] +[gd_scene format=4 uid="uid://bmghctv58ymhx"] [ext_resource type="Script" uid="uid://ci5kwydrjchlr" path="res://scripts/gamecontoller.gd" id="1_lnu2h"] [ext_resource type="Script" uid="uid://ccrtmkeh3wxoc" path="res://scripts/scenemanager.gd" id="2_lbhrr"] [ext_resource type="PackedScene" uid="uid://bf2snjwsm1g01" path="res://scenes/trigger.tscn" id="2_lnu2h"] [ext_resource type="PackedScene" uid="uid://n3nikeltgorc" path="res://scenes/crate.tscn" id="3_iywne"] +[ext_resource type="Texture2D" uid="uid://bqakmwe3qjd6f" path="res://assets/graphics/terrain/Terrain (32x32).png" id="3_p57ef"] +[ext_resource type="Texture2D" uid="uid://dl7pi3on53f4o" path="res://assets/graphics/terrain/veg_32x32.png" id="4_gee14"] [ext_resource type="PackedScene" uid="uid://bbascciqs68u" path="res://scenes/player.tscn" id="4_iywne"] +[ext_resource type="Texture2D" uid="uid://cv5gem318pcqe" path="res://assets/graphics/terrain/mushroom_32x64.png" id="5_0tnpc"] + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_u5sy4"] +texture = ExtResource("3_p57ef") +texture_region_size = Vector2i(32, 32) +0:0/0 = 0 +0:0/0/terrain_set = 0 +0:0/0/terrain = 0 +0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +0:0/0/terrains_peering_bit/right_side = 0 +0:0/0/terrains_peering_bit/bottom_right_corner = 0 +0:0/0/terrains_peering_bit/bottom_side = 0 +1:0/0 = 0 +1:0/0/terrain_set = 0 +1:0/0/terrain = 0 +1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +1:0/0/terrains_peering_bit/right_side = 0 +1:0/0/terrains_peering_bit/bottom_right_corner = 0 +1:0/0/terrains_peering_bit/bottom_side = 0 +1:0/0/terrains_peering_bit/bottom_left_corner = 0 +1:0/0/terrains_peering_bit/left_side = 0 +2:0/0 = 0 +2:0/0/terrain_set = 0 +2:0/0/terrain = 0 +2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +2:0/0/terrains_peering_bit/bottom_side = 0 +2:0/0/terrains_peering_bit/bottom_left_corner = 0 +2:0/0/terrains_peering_bit/left_side = 0 +4:0/0 = 0 +4:0/0/terrain_set = 0 +4:0/0/terrain = 0 +4:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +4:0/0/terrains_peering_bit/bottom_side = 0 +6:0/0 = 0 +6:0/0/terrain_set = 0 +6:0/0/terrain = 0 +6:0/0/terrains_peering_bit/right_side = 0 +6:0/0/terrains_peering_bit/bottom_side = 0 +6:0/0/terrains_peering_bit/bottom_left_corner = 0 +6:0/0/terrains_peering_bit/left_side = 0 +6:0/0/terrains_peering_bit/top_left_corner = 0 +6:0/0/terrains_peering_bit/top_side = 0 +6:0/0/terrains_peering_bit/top_right_corner = 0 +7:0/0 = 0 +7:0/0/terrain_set = 0 +7:0/0/terrain = 0 +7:0/0/terrains_peering_bit/right_side = 0 +7:0/0/terrains_peering_bit/bottom_right_corner = 0 +7:0/0/terrains_peering_bit/bottom_side = 0 +7:0/0/terrains_peering_bit/left_side = 0 +7:0/0/terrains_peering_bit/top_left_corner = 0 +7:0/0/terrains_peering_bit/top_side = 0 +7:0/0/terrains_peering_bit/top_right_corner = 0 +9:0/0 = 0 +9:0/0/terrain_set = 0 +9:0/0/terrain = 0 +9:0/0/terrains_peering_bit/right_side = 0 +9:0/0/terrains_peering_bit/bottom_right_corner = 0 +9:0/0/terrains_peering_bit/bottom_side = 0 +9:0/0/terrains_peering_bit/bottom_left_corner = 0 +9:0/0/terrains_peering_bit/left_side = 0 +9:0/0/terrains_peering_bit/top_side = 0 +10:0/0 = 0 +10:0/0/terrain_set = 0 +10:0/0/terrain = 0 +10:0/0/terrains_peering_bit/right_side = 0 +10:0/0/terrains_peering_bit/bottom_side = 0 +10:0/0/terrains_peering_bit/bottom_left_corner = 0 +10:0/0/terrains_peering_bit/left_side = 0 +10:0/0/terrains_peering_bit/top_left_corner = 0 +10:0/0/terrains_peering_bit/top_side = 0 +12:0/0 = 0 +12:0/0/terrain_set = 0 +12:0/0/terrain = 0 +12:0/0/terrains_peering_bit/right_side = 0 +12:0/0/terrains_peering_bit/bottom_right_corner = 0 +12:0/0/terrains_peering_bit/bottom_side = 0 +12:0/0/terrains_peering_bit/left_side = 0 +12:0/0/terrains_peering_bit/top_side = 0 +13:0/0 = 0 +13:0/0/terrain_set = 0 +13:0/0/terrain = 0 +13:0/0/terrains_peering_bit/right_side = 0 +13:0/0/terrains_peering_bit/bottom_side = 0 +13:0/0/terrains_peering_bit/bottom_left_corner = 0 +13:0/0/terrains_peering_bit/left_side = 0 +13:0/0/terrains_peering_bit/top_side = 0 +15:0/0 = 0 +15:0/0/terrain_set = 0 +15:0/0/terrain = 0 +15:0/0/terrains_peering_bit/right_side = 0 +15:0/0/terrains_peering_bit/bottom_side = 0 +15:0/0/terrains_peering_bit/left_side = 0 +15:0/0/terrains_peering_bit/top_side = 0 +0:1/0 = 0 +0:1/0/terrain_set = 0 +0:1/0/terrain = 0 +0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 0.63726044, -16, 0, 16, -16, 16) +0:1/0/terrains_peering_bit/right_side = 0 +0:1/0/terrains_peering_bit/bottom_right_corner = 0 +0:1/0/terrains_peering_bit/bottom_side = 0 +0:1/0/terrains_peering_bit/top_side = 0 +0:1/0/terrains_peering_bit/top_right_corner = 0 +1:1/0 = 0 +2:1/0 = 0 +2:1/0/terrain_set = 0 +2:1/0/terrain = 0 +2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(0.63726044, -16, 16, -16, 16, 16, 0.63726044, 16) +2:1/0/terrains_peering_bit/bottom_side = 0 +2:1/0/terrains_peering_bit/bottom_left_corner = 0 +2:1/0/terrains_peering_bit/left_side = 0 +2:1/0/terrains_peering_bit/top_left_corner = 0 +2:1/0/terrains_peering_bit/top_side = 0 +4:1/0 = 0 +4:1/0/terrain_set = 0 +4:1/0/terrain = 0 +4:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +4:1/0/terrains_peering_bit/bottom_side = 0 +4:1/0/terrains_peering_bit/top_side = 0 +6:1/0 = 0 +6:1/0/terrain_set = 0 +6:1/0/terrain = 0 +6:1/0/terrains_peering_bit/right_side = 0 +6:1/0/terrains_peering_bit/bottom_right_corner = 0 +6:1/0/terrains_peering_bit/bottom_side = 0 +6:1/0/terrains_peering_bit/bottom_left_corner = 0 +6:1/0/terrains_peering_bit/left_side = 0 +6:1/0/terrains_peering_bit/top_left_corner = 0 +6:1/0/terrains_peering_bit/top_side = 0 +7:1/0 = 0 +7:1/0/terrain_set = 0 +7:1/0/terrain = 0 +7:1/0/terrains_peering_bit/right_side = 0 +7:1/0/terrains_peering_bit/bottom_right_corner = 0 +7:1/0/terrains_peering_bit/bottom_side = 0 +7:1/0/terrains_peering_bit/bottom_left_corner = 0 +7:1/0/terrains_peering_bit/left_side = 0 +7:1/0/terrains_peering_bit/top_side = 0 +7:1/0/terrains_peering_bit/top_right_corner = 0 +9:1/0 = 0 +9:1/0/terrain_set = 0 +9:1/0/terrain = 0 +9:1/0/terrains_peering_bit/right_side = 0 +9:1/0/terrains_peering_bit/bottom_right_corner = 0 +9:1/0/terrains_peering_bit/bottom_side = 0 +9:1/0/terrains_peering_bit/top_side = 0 +9:1/0/terrains_peering_bit/top_right_corner = 0 +10:1/0 = 0 +10:1/0/terrain_set = 0 +10:1/0/terrain = 0 +10:1/0/terrains_peering_bit/right_side = 0 +10:1/0/terrains_peering_bit/bottom_side = 0 +10:1/0/terrains_peering_bit/left_side = 0 +10:1/0/terrains_peering_bit/top_left_corner = 0 +10:1/0/terrains_peering_bit/top_side = 0 +10:1/0/terrains_peering_bit/top_right_corner = 0 +12:1/0 = 0 +12:1/0/terrain_set = 0 +12:1/0/terrain = 0 +12:1/0/terrains_peering_bit/right_side = 0 +12:1/0/terrains_peering_bit/bottom_side = 0 +12:1/0/terrains_peering_bit/left_side = 0 +12:1/0/terrains_peering_bit/top_side = 0 +12:1/0/terrains_peering_bit/top_right_corner = 0 +13:1/0 = 0 +13:1/0/terrain_set = 0 +13:1/0/terrain = 0 +13:1/0/terrains_peering_bit/right_side = 0 +13:1/0/terrains_peering_bit/bottom_side = 0 +13:1/0/terrains_peering_bit/left_side = 0 +13:1/0/terrains_peering_bit/top_left_corner = 0 +13:1/0/terrains_peering_bit/top_side = 0 +15:1/0 = 0 +15:1/0/terrain_set = 0 +15:1/0/terrain = 0 +15:1/0/terrains_peering_bit/right_side = 0 +15:1/0/terrains_peering_bit/bottom_side = 0 +15:1/0/terrains_peering_bit/bottom_left_corner = 0 +15:1/0/terrains_peering_bit/left_side = 0 +15:1/0/terrains_peering_bit/top_side = 0 +15:1/0/terrains_peering_bit/top_right_corner = 0 +16:1/0 = 0 +16:1/0/terrain_set = 0 +16:1/0/terrain = 0 +16:1/0/terrains_peering_bit/right_side = 0 +16:1/0/terrains_peering_bit/bottom_right_corner = 0 +16:1/0/terrains_peering_bit/bottom_side = 0 +16:1/0/terrains_peering_bit/left_side = 0 +16:1/0/terrains_peering_bit/top_left_corner = 0 +16:1/0/terrains_peering_bit/top_side = 0 +0:2/0 = 0 +0:2/0/terrain_set = 0 +0:2/0/terrain = 0 +0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -10.514814, 16, -16, 9.558922) +0:2/0/terrains_peering_bit/right_side = 0 +0:2/0/terrains_peering_bit/top_side = 0 +0:2/0/terrains_peering_bit/top_right_corner = 0 +1:2/0 = 0 +1:2/0/terrain_set = 0 +1:2/0/terrain = 0 +1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -0.63726044, 16, -0.31863022, 16, 16, -16, 16) +1:2/0/terrains_peering_bit/right_side = 0 +1:2/0/terrains_peering_bit/left_side = 0 +1:2/0/terrains_peering_bit/top_left_corner = 0 +1:2/0/terrains_peering_bit/top_side = 0 +1:2/0/terrains_peering_bit/top_right_corner = 0 +2:2/0 = 0 +2:2/0/terrain_set = 0 +2:2/0/terrain = 0 +2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +2:2/0/terrains_peering_bit/left_side = 0 +2:2/0/terrains_peering_bit/top_left_corner = 0 +2:2/0/terrains_peering_bit/top_side = 0 +4:2/0 = 0 +4:2/0/terrain_set = 0 +4:2/0/terrain = 0 +4:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +4:2/0/terrains_peering_bit/top_side = 0 +6:3/0 = 0 +6:3/0/terrain_set = 0 +6:3/0/terrain = 0 +6:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -3.186308, -16, -2.8676777, 16, -16, 16) +6:3/0/terrains_peering_bit/right_side = 0 +6:3/0/terrains_peering_bit/bottom_side = 0 +6:3/0/terrains_peering_bit/top_side = 0 +6:3/0/terrains_peering_bit/top_right_corner = 0 +7:3/0 = 0 +7:3/0/terrain_set = 0 +7:3/0/terrain = 0 +7:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(1.9117851, -16, 16, -16, 16, 16, 1.9117851, 16) +7:3/0/terrains_peering_bit/bottom_side = 0 +7:3/0/terrains_peering_bit/left_side = 0 +7:3/0/terrains_peering_bit/top_left_corner = 0 +7:3/0/terrains_peering_bit/top_side = 0 +9:3/0 = 0 +9:3/0/terrain_set = 0 +9:3/0/terrain = 0 +9:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -1.2745228, -16, -0.95589256) +9:3/0/terrains_peering_bit/right_side = 0 +9:3/0/terrains_peering_bit/bottom_side = 0 +9:3/0/terrains_peering_bit/bottom_left_corner = 0 +9:3/0/terrains_peering_bit/left_side = 0 +10:3/0 = 0 +10:3/0/terrain_set = 0 +10:3/0/terrain = 0 +10:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -1.2745228, -16, -0.95589256) +10:3/0/terrains_peering_bit/right_side = 0 +10:3/0/terrains_peering_bit/bottom_right_corner = 0 +10:3/0/terrains_peering_bit/bottom_side = 0 +10:3/0/terrains_peering_bit/left_side = 0 +12:3/0 = 0 +12:3/0/terrain_set = 0 +12:3/0/terrain = 0 +12:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +12:3/0/terrains_peering_bit/right_side = 0 +12:3/0/terrains_peering_bit/bottom_side = 0 +12:3/0/terrains_peering_bit/top_side = 0 +13:3/0 = 0 +13:3/0/terrain_set = 0 +13:3/0/terrain = 0 +13:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +13:3/0/terrains_peering_bit/right_side = 0 +13:3/0/terrains_peering_bit/bottom_side = 0 +13:3/0/terrains_peering_bit/left_side = 0 +15:3/0 = 0 +15:3/0/terrain_set = 0 +15:3/0/terrain = 0 +15:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +15:3/0/terrains_peering_bit/right_side = 0 +15:3/0/terrains_peering_bit/bottom_side = 0 +16:3/0 = 0 +16:3/0/terrain_set = 0 +16:3/0/terrain = 0 +16:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +16:3/0/terrains_peering_bit/bottom_side = 0 +16:3/0/terrains_peering_bit/left_side = 0 +0:4/0 = 0 +0:4/0/terrain_set = 0 +0:4/0/terrain = 0 +0:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +0:4/0/terrains_peering_bit/right_side = 0 +1:4/0 = 0 +1:4/0/terrain_set = 0 +1:4/0/terrain = 0 +1:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +1:4/0/terrains_peering_bit/right_side = 0 +1:4/0/terrains_peering_bit/left_side = 0 +2:4/0 = 0 +2:4/0/terrain_set = 0 +2:4/0/terrain = 0 +2:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +2:4/0/terrains_peering_bit/left_side = 0 +4:4/0 = 0 +4:4/0/terrain_set = 0 +4:4/0/terrain = 0 +4:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +6:4/0 = 0 +6:4/0/terrain_set = 0 +6:4/0/terrain = 0 +6:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -3.186308, -16, -2.8676777, 16, -16, 16) +6:4/0/terrains_peering_bit/right_side = 0 +6:4/0/terrains_peering_bit/bottom_right_corner = 0 +6:4/0/terrains_peering_bit/bottom_side = 0 +6:4/0/terrains_peering_bit/top_side = 0 +7:4/0 = 0 +7:4/0/terrain_set = 0 +7:4/0/terrain = 0 +7:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(1.9117851, -16, 16, -16, 16, 16, 1.9117851, 16) +7:4/0/terrains_peering_bit/bottom_side = 0 +7:4/0/terrains_peering_bit/bottom_left_corner = 0 +7:4/0/terrains_peering_bit/left_side = 0 +7:4/0/terrains_peering_bit/top_side = 0 +9:4/0 = 0 +9:4/0/terrain_set = 0 +9:4/0/terrain = 0 +9:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 2.5490456, 16, 2.2304153, 16, 16, -16, 16) +9:4/0/terrains_peering_bit/right_side = 0 +9:4/0/terrains_peering_bit/left_side = 0 +9:4/0/terrains_peering_bit/top_left_corner = 0 +9:4/0/terrains_peering_bit/top_side = 0 +10:4/0 = 0 +10:4/0/terrain_set = 0 +10:4/0/terrain = 0 +10:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 2.5490456, 16, 2.2304153, 16, 16, -16, 16) +10:4/0/terrains_peering_bit/right_side = 0 +10:4/0/terrains_peering_bit/left_side = 0 +10:4/0/terrains_peering_bit/top_side = 0 +10:4/0/terrains_peering_bit/top_right_corner = 0 +12:4/0 = 0 +12:4/0/terrain_set = 0 +12:4/0/terrain = 0 +12:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +12:4/0/terrains_peering_bit/right_side = 0 +12:4/0/terrains_peering_bit/left_side = 0 +12:4/0/terrains_peering_bit/top_side = 0 +13:4/0 = 0 +13:4/0/terrain_set = 0 +13:4/0/terrain = 0 +13:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +13:4/0/terrains_peering_bit/bottom_side = 0 +13:4/0/terrains_peering_bit/left_side = 0 +13:4/0/terrains_peering_bit/top_side = 0 +15:4/0 = 0 +15:4/0/terrain_set = 0 +15:4/0/terrain = 0 +15:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +15:4/0/terrains_peering_bit/right_side = 0 +15:4/0/terrains_peering_bit/top_side = 0 +16:4/0 = 0 +16:4/0/terrain_set = 0 +16:4/0/terrain = 0 +16:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +16:4/0/terrains_peering_bit/left_side = 0 +16:4/0/terrains_peering_bit/top_side = 0 + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_vtaks"] +texture = ExtResource("4_gee14") +texture_region_size = Vector2i(32, 32) +0:0/0 = 0 +0:0/0/terrain_set = 0 +0:0/0/terrain = 1 + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_kvpfn"] +texture = ExtResource("5_0tnpc") +texture_region_size = Vector2i(32, 32) +0:0/0 = 0 +0:0/0/terrain_set = 0 +0:0/0/terrains_peering_bit/bottom_side = 1 +0:1/0 = 0 +0:1/0/terrain_set = 0 +0:1/0/terrain = 1 +0:1/0/terrains_peering_bit/top_side = 1 + +[sub_resource type="TileSet" id="TileSet_daopg"] +tile_size = Vector2i(32, 32) +physics_layer_0/collision_layer = 1 +terrain_set_0/mode = 0 +terrain_set_0/terrain_0/name = "leafy dirt" +terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1) +terrain_set_0/terrain_1/name = "Veg" +terrain_set_0/terrain_1/color = Color(0.5, 0.4375, 0.25, 1) +sources/0 = SubResource("TileSetAtlasSource_u5sy4") +sources/1 = SubResource("TileSetAtlasSource_vtaks") +sources/2 = SubResource("TileSetAtlasSource_kvpfn") [sub_resource type="RectangleShape2D" id="RectangleShape2D_daopg"] size = Vector2(156, 39.5) @@ -18,8 +404,14 @@ script = ExtResource("1_lnu2h") [node name="SceneManager" type="Node2D" parent="." unique_id=46020717] script = ExtResource("2_lbhrr") +[node name="TileMapLayer" type="TileMapLayer" parent="." unique_id=1003642503] +texture_filter = 1 +position = Vector2(-36, 52) +tile_map_data = PackedByteArray("AAAZABMAAAAKAAQAAAAYABMAAAAKAAQAAAAXABMAAAAKAAQAAAAUABMAAAAKAAEAAAAUABQAAAAEAAEAAAAUABUAAAAEAAEAAAAUABYAAAAEAAEAAAAUABcAAAAEAAIAAAAWABMAAAABAAIAAAAWABYAAAAAAAQAAAAXABYAAAABAAQAAAAYABYAAAABAAQAAAAZABYAAAABAAQAAAAaABYAAAACAAQAAAAMAAkAAAAEAAQAAAANAAsAAAAAAAQAAAAOAAsAAAABAAQAAAAPAAsAAAACAAQAAAARAAkAAAAEAAQAAAAXABEAAAABAAAAAAAYABEAAAABAAAAAAATABEAAAABAAAAAAAUABEAAAABAAAAAAAUAA8AAAAAAAQAAAAVAA8AAAABAAQAAAAWAA8AAAACAAQAAAAWAAwAAAAEAAAAAAAWAA0AAAAQAAQAAAAVAA0AAAAAAAQAAAAUAAoAAAAAAAQAAAAVAAoAAAABAAQAAAAWAAoAAAABAAQAAAAXAAoAAAACAAQAAAAWAAgAAAACAAQAAAAVAAgAAAAAAAQAAAAaAAcAAAAAAAQAAAAbAAcAAAAQAAMAAAAbAAgAAAAPAAQAAAAcAAgAAAACAAQAAAAZAAwAAAAAAAQAAAAaAAwAAAABAAQAAAAbAAwAAAABAAQAAAAcAAwAAAACAAQAAAAcABAAAAAEAAEAAAAcAA8AAAAPAAMAAAAdAA8AAAAQAAQAAAAdAA4AAAAEAAEAAA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AAbAAQAAQAAAAAAAAAKABAAAQAAAAAAAAALABAAAQAAAAAAAAAZABAAAQAAAAAAAAAWAAcAAQAAAAAAAAAOABAAAgAAAAEAAAAOAA8AAgAAAAAAAAARABAAAgAAAAEAAAARAA8AAgAAAAAAAAAUAA4AAQAAAAAAAAAYABAAAQAAAAAAAAAaABAAAgAAAAEAAAAaAA8AAgAAAAAAAAAEAAcAAgAAAAEAAAAEAAYAAgAAAAAAAAAhABEAAAABAAAAAAAdAAQAAgAAAAEAAAAdAAMAAgAAAAAAAAAWAAIAAQAAAAAAAAAkABEAAAABAAAAAAAFAA4AAQAAAAAAAAAXABAAAgAAAAEAAAAXAA8AAgAAAAAAAAAOAA4AAAACAAQAAAANAA4AAAABAAQAAAAMAA4AAAABAAQAAAALAA4AAAAAAAQAAAAFAAoAAAAAAAQAAAAKAAkAAAAQAAQAAAAKAAgAAAAEAAAAAAAIAAkAAAAMAAQAAAAIAAgAAAAEAAAAAAAGAAoAAAAKAAQAAAAGAAkAAAAAAAAAAAAHAAkAAAAJAAMAAAAJAAkAAAABAAQAAAAeABEAAAABAAAAAAAfABEAAAABAAAAAAAgABEAAAABAAAAAAAiABEAAAABAAAAAAAjABEAAAABAAAAAAAlABEAAAAJAAMAAAAmABEAAAABAAQAAAAnABEAAAABAAQAAAAoABEAAAACAAQAAAAHAAoAAAACAAIAAAA=") +tile_set = SubResource("TileSet_daopg") + [node name="StaticBody2D" type="StaticBody2D" parent="." unique_id=50045338] -position = Vector2(356, 397) +position = Vector2(204, 366) metadata/_edit_group_ = true [node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" unique_id=1746367507] @@ -29,7 +421,7 @@ shape = SubResource("RectangleShape2D_daopg") position = Vector2(-132.00002, 24.999996) [node name="Player" parent="." unique_id=680748920 instance=ExtResource("4_iywne")] -position = Vector2(339, 351) +position = Vector2(343, 306) [node name="StaticBody2D2" type="StaticBody2D" parent="." unique_id=2128236600] position = Vector2(346, 57) @@ -48,13 +440,13 @@ position = Vector2(204, 338) effect = "teleport" [node name="Crate" parent="Triggers" unique_id=6318362 instance=ExtResource("3_iywne")] -position = Vector2(400, 304) +position = Vector2(430, 339) [node name="trigger3" parent="Triggers" unique_id=2118176855 instance=ExtResource("2_lnu2h")] position = Vector2(161, 482.99997) [node name="Crate" parent="." unique_id=1661527763 instance=ExtResource("3_iywne")] -position = Vector2(280, 291) +position = Vector2(382, 352) [node name="Crate2" parent="." unique_id=1011126838 instance=ExtResource("3_iywne")] -position = Vector2(367, 201) +position = Vector2(407, 235) diff --git a/scenes/player.tscn b/scenes/player.tscn index 22e628e..e12ec0a 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -204,4 +204,7 @@ sprite_frames = SubResource("SpriteFrames_daopg") animation = &"fall" autoplay = "idle" +[node name="Camera2D" type="Camera2D" parent="." unique_id=955417894] +offset = Vector2(0, -30) + [connection signal="animation_finished" from="PlayerGraphic" to="." method="_on_player_animation_finished"] diff --git a/scripts/gamecontoller.gd b/scripts/gamecontoller.gd index fed8a2e..0d54347 100644 --- a/scripts/gamecontoller.gd +++ b/scripts/gamecontoller.gd @@ -6,7 +6,7 @@ signal destroySignal(Body) # Called when the node enters the scene tree for the first time. func _ready() -> void: - pass # Replace with function body. + get_window().grab_focus() # Called every frame. 'delta' is the elapsed time since the previous frame. diff --git a/scripts/player.gd b/scripts/player.gd index de263e5..3d9cb30 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -67,14 +67,14 @@ func handle_input()->void: #shove left pushTarget.apply_central_impulse(Vector2(-1,0) * shove_power) # Handle jump. - if Input.is_action_just_pressed("ui_accept") and is_on_floor(): + if Input.is_action_just_pressed("jump") and is_on_floor(): velocity.y = JUMP_VELOCITY current_player_state=PlayerStates.JUMPING upJump = true # Get the input direction and handle the movement/deceleration. # As good practice, you should replace UI actions with custom gameplay actions. - direction = Input.get_axis("ui_left", "ui_right") + direction = Input.get_axis("left", "right") func handle_movement()->void: if direction: velocity.x = direction * SPEED @@ -92,16 +92,16 @@ func handle_collisions()->void: print("Something on my right") #get the thing I can shove var collider = right_cast.get_collider() - if collider is Node: + if collider is RigidBody2D: pushRightEnabled = true - pushTarget = collider + pushTarget = collider else: pushRightEnabled = false if left_cast.is_colliding(): print("Something on my left") var collider = left_cast.get_collider() - if collider is Node: + if collider is RigidBody2D: pushLeftEnabled = true pushTarget = collider else: