From 200ae7f26239fce2e8deedd4b8d581d8145eb763 Mon Sep 17 00:00:00 2001 From: Mathilde Grapin Date: Sun, 2 Jul 2023 17:23:23 +0200 Subject: [PATCH] Add bottom area limits --- .../{target_tile.png => ball_target.png} | Bin ...tile.png.import => ball_target.png.import} | 6 +- .../{destination_tile.png => destination.png} | Bin ...tile.png.import => destination.png.import} | 6 +- art/tiles/{ground_tile.png => ground.png} | Bin ...ound_tile.png.import => ground.png.import} | 6 +- art/tiles/ground_bottom.png | Bin 0 -> 358 bytes art/tiles/ground_bottom.png.import | 34 +++++++ art/tiles/ground_left.png | Bin 0 -> 342 bytes art/tiles/ground_left.png.import | 34 +++++++ art/tiles/ground_left_bottom.png | Bin 0 -> 368 bytes art/tiles/ground_left_bottom.png.import | 34 +++++++ art/tiles/ground_right.png | Bin 0 -> 355 bytes art/tiles/ground_right.png.import | 34 +++++++ art/tiles/ground_right_bottom.png | Bin 0 -> 366 bytes art/tiles/ground_right_bottom.png.import | 34 +++++++ art/tiles/{wall_tile.png => wall.png} | Bin .../{wall_tile.png.import => wall.png.import} | 6 +- scenes/player.tscn | 14 +-- scenes/tile_map.tscn | 93 +++++++++++++++--- scripts/player/player.gd | 18 ++-- scripts/tile_map/tile_map.gd | 21 +++- 22 files changed, 300 insertions(+), 40 deletions(-) rename art/tiles/{target_tile.png => ball_target.png} (100%) rename art/tiles/{target_tile.png.import => ball_target.png.import} (71%) rename art/tiles/{destination_tile.png => destination.png} (100%) rename art/tiles/{destination_tile.png.import => destination.png.import} (70%) rename art/tiles/{ground_tile.png => ground.png} (100%) rename art/tiles/{ground_tile.png.import => ground.png.import} (71%) create mode 100644 art/tiles/ground_bottom.png create mode 100644 art/tiles/ground_bottom.png.import create mode 100644 art/tiles/ground_left.png create mode 100644 art/tiles/ground_left.png.import create mode 100644 art/tiles/ground_left_bottom.png create mode 100644 art/tiles/ground_left_bottom.png.import create mode 100644 art/tiles/ground_right.png create mode 100644 art/tiles/ground_right.png.import create mode 100644 art/tiles/ground_right_bottom.png create mode 100644 art/tiles/ground_right_bottom.png.import rename art/tiles/{wall_tile.png => wall.png} (100%) rename art/tiles/{wall_tile.png.import => wall.png.import} (72%) diff --git a/art/tiles/target_tile.png b/art/tiles/ball_target.png similarity index 100% rename from art/tiles/target_tile.png rename to art/tiles/ball_target.png diff --git a/art/tiles/target_tile.png.import b/art/tiles/ball_target.png.import similarity index 71% rename from art/tiles/target_tile.png.import rename to art/tiles/ball_target.png.import index 451c621..3e462b4 100644 --- a/art/tiles/target_tile.png.import +++ b/art/tiles/ball_target.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://d265li1k63anm" -path="res://.godot/imported/target_tile.png-8889c881dce8d973f9cccb76e30928fa.ctex" +path="res://.godot/imported/ball_target.png-420e9ad20dd0b28420ac9e18f85c8839.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://art/tiles/target_tile.png" -dest_files=["res://.godot/imported/target_tile.png-8889c881dce8d973f9cccb76e30928fa.ctex"] +source_file="res://art/tiles/ball_target.png" +dest_files=["res://.godot/imported/ball_target.png-420e9ad20dd0b28420ac9e18f85c8839.ctex"] [params] diff --git a/art/tiles/destination_tile.png b/art/tiles/destination.png similarity index 100% rename from art/tiles/destination_tile.png rename to art/tiles/destination.png diff --git a/art/tiles/destination_tile.png.import b/art/tiles/destination.png.import similarity index 70% rename from art/tiles/destination_tile.png.import rename to art/tiles/destination.png.import index 69e1c3f..9eaed58 100644 --- a/art/tiles/destination_tile.png.import +++ b/art/tiles/destination.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://b7565sd31qorm" -path="res://.godot/imported/destination_tile.png-6f95af7bf74b60a839485c30677f4a21.ctex" +path="res://.godot/imported/destination.png-6d8060cc8ba13cfb8eb5a86e36773f7a.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://art/tiles/destination_tile.png" -dest_files=["res://.godot/imported/destination_tile.png-6f95af7bf74b60a839485c30677f4a21.ctex"] +source_file="res://art/tiles/destination.png" +dest_files=["res://.godot/imported/destination.png-6d8060cc8ba13cfb8eb5a86e36773f7a.ctex"] [params] diff --git a/art/tiles/ground_tile.png b/art/tiles/ground.png similarity index 100% rename from art/tiles/ground_tile.png rename to art/tiles/ground.png diff --git a/art/tiles/ground_tile.png.import b/art/tiles/ground.png.import similarity index 71% rename from art/tiles/ground_tile.png.import rename to art/tiles/ground.png.import index e84f7d0..c26b3db 100644 --- a/art/tiles/ground_tile.png.import +++ b/art/tiles/ground.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cm58s70te836m" -path="res://.godot/imported/ground_tile.png-a0838c31e75c33807f6e9b010d97f31b.ctex" +path="res://.godot/imported/ground.png-ce6ec90789aee5a940b6b4beb4661e80.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://art/tiles/ground_tile.png" -dest_files=["res://.godot/imported/ground_tile.png-a0838c31e75c33807f6e9b010d97f31b.ctex"] +source_file="res://art/tiles/ground.png" +dest_files=["res://.godot/imported/ground.png-ce6ec90789aee5a940b6b4beb4661e80.ctex"] [params] diff --git a/art/tiles/ground_bottom.png b/art/tiles/ground_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..eaff7c346b0f159d53be7c4c19991f6ca8e3487d GIT binary patch literal 358 zcmV-s0h#`ZP)Px$AW1|)R9J=WmLU>@Fc3vI4A-b{rXGhZ2jCF()ga*#l|4WYKxJJ$lX`4rtEplp zK(gK4fa5!6vUx8%Nr(brOwsiAx2`iKnMYJKg@;J63Vh%Y5z@dZcwZfz<6h;REfRCU zKA=x%sK-Q{0@PMhgNekhfosJjq9kBn%K_&50E@0O6|KE$ET(As_;f1)0N|2W>xRn8&VEYQ1t@Y1U7+9AbOam=xM%0OxLOrTyiN%E+W&l<0siP91)Iy4MqhxA`}4^ zm?S_E!2~ccO8^sb2~fZy0hfp^zyU9kR42XO9fE%6KQwufx`FcWhyVZp07*qoM6N<$ Ef;0__C;$Ke literal 0 HcmV?d00001 diff --git a/art/tiles/ground_bottom.png.import b/art/tiles/ground_bottom.png.import new file mode 100644 index 0000000..248fce4 --- /dev/null +++ b/art/tiles/ground_bottom.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bpa4fpmkhv6ao" +path="res://.godot/imported/ground_bottom.png-d8a2059588952b722104cd772c3c3a06.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/tiles/ground_bottom.png" +dest_files=["res://.godot/imported/ground_bottom.png-d8a2059588952b722104cd772c3c3a06.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/art/tiles/ground_left.png b/art/tiles/ground_left.png new file mode 100644 index 0000000000000000000000000000000000000000..b4ff3ed60bc2912e55cc7fee856eccadc8dcaef8 GIT binary patch literal 342 zcmV-c0jd6pP)Px$5J^NqR9J=W)-MjiFc^p7ugk81r@_xn!U1*&JetXI2_y&L03dPrrFbk7^iW+& z({@UmG00KlWZiXk~A zOr1R+g9HK6Fa?r_p7^hYAo&#G7$loI?n6|miw*$bST*Q__A2lJ=6VH5xZi2-6^5+DW%0We_} oAOvv%lyH)jy6E&`CHgu40?jy$@8k3F_5c6?07*qoM6N<$f_1-y_W%F@ literal 0 HcmV?d00001 diff --git a/art/tiles/ground_left.png.import b/art/tiles/ground_left.png.import new file mode 100644 index 0000000..f0bd888 --- /dev/null +++ b/art/tiles/ground_left.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bwv5d4umos2we" +path="res://.godot/imported/ground_left.png-f29085d700bb612e942e2167f26ccb98.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/tiles/ground_left.png" +dest_files=["res://.godot/imported/ground_left.png-f29085d700bb612e942e2167f26ccb98.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/art/tiles/ground_left_bottom.png b/art/tiles/ground_left_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..12579078e9f138fdace546c5d580b7e7b036b0e9 GIT binary patch literal 368 zcmV-$0gwKPP)Px$DoI2^R9J=WmOT=JFc3yJ4A-zXV^2pZ2k;Q~)>6tPEIoh+fYQ$13B9eQ)>vgG z#3bwwc6=SM$$JSQL;*AA*beTsZYss;htFX{i%^FtA# z2)N*+07V2N5CWqFFd`{|6qqEC5(x=lz$}4~h$}z=&yrFXgI;Y!zwPx$9Z5t%R9J=WmN627Fc3u(hHKc9v8SWN18@j?Ybo&(mL9+ZXlZB9#GcktYb=~N zF(%9ICU*QTOqTbuK!_B~=Fpom}ud|;FS zMg$Uoz$5`k#3z6Ovjlu1wg3g3B$X;hwOB^|&R;L3lf}8$B2oYV002ovPDHLkV1nga BkT?JU literal 0 HcmV?d00001 diff --git a/art/tiles/ground_right.png.import b/art/tiles/ground_right.png.import new file mode 100644 index 0000000..1bba648 --- /dev/null +++ b/art/tiles/ground_right.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cibnnq23akjqa" +path="res://.godot/imported/ground_right.png-5294f2bc13ed7d1f06582c289081850a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/tiles/ground_right.png" +dest_files=["res://.godot/imported/ground_right.png-5294f2bc13ed7d1f06582c289081850a.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/art/tiles/ground_right_bottom.png b/art/tiles/ground_right_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..27a9ccdd5f59e985e57375ce5ab84d656d70293b GIT binary patch literal 366 zcmV-!0g?WRP)Px$C`m*?R9J=WmOT=JFc3yJ4A-zXV^2p32k;Q~)>6VHEIoh+fYQ$1iM_3*)>vgG zh9vF}c6=Qq+4mqJL;*AA(2wr5?rO!U!y4qnB@(0oF|b4g)e#Hkh$K5$@Vc!gZTDt~ z-lvGXg1WeRK?Cc3LtMtN#m*azI30S$Fy4*i(#&J6$n z9JejGfF#?~9sry*AQ4F|z!=zO@)cl2)@?<8= height.x: + tile_source_id = ground_left_tile_source_id + elif x == map_width - 1 && y >= height.x: + tile_source_id = ground_right_tile_source_id + elif y == height.y: + tile_source_id = ground_bottom_tile_source_id + else: + tile_source_id = ground_tile_source_id + set_cell(0, Vector2i(x, y), tile_source_id, Vector2i(0, 0), 0) func draw_wall(): var middle_height = floor(map_height / 2.0)