From 326366d6f2c63f463b089743bcea126140542537 Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Mon, 20 Dec 2021 18:15:58 +0000 Subject: [PATCH 01/15] Create draft PR for #273 From fe199f7228a9723ebe33189ed0bacda08d1edf12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Sza=C5=82yga?= Date: Mon, 14 Feb 2022 13:46:50 +0100 Subject: [PATCH 02/15] updated to current develop version --- Assets/Enemies/BigDevil.png.import | 6 ++-- Assets/Enemies/EarthBall.png.import | 6 ++-- Assets/Enemies/Goblin_Shaman.png.import | 8 ++--- Assets/Enemies/Lil_Devil_body.png.import | 6 ++-- Assets/Enemies/Lil_Devil_head.png.import | 6 ++-- Assets/Enemies/Little_Goblin.png.import | 6 ++-- Assets/Enemies/Orc.png.import | 6 ++-- Assets/Enemies/Potato.png.import | 6 ++-- Assets/Enemies/Shadow.png.import | 6 ++-- Assets/Enemies/Slime.png.import | 6 ++-- Assets/Enemies/WindBall.png.import | 6 ++-- Assets/Enemies/cuck.png.import | 1 + Assets/Enemies/cuckbullet.png.import | 1 + Assets/Enemies/cuckbulletupdated.png.import | 1 + Assets/Enemies/cuckshooter.png.import | 1 + Assets/Enemies/cuckshooterupdated.png.import | 1 + Assets/Enemies/fireball_new.png.import | 1 + Assets/Enemies/fireball_old.png.import | 1 + Assets/Enemies/goblin_ball.png.import | 1 + Assets/Enemies/snot.png.import | 1 + Assets/Loot/Weapons/BloodSword.png.import | 6 ++-- Assets/Loot/Weapons/FMS.png.import | 7 ++-- Assets/Loot/Weapons/FMS0.png.import | 7 ++-- Assets/Loot/Weapons/FMS1.png.import | 7 ++-- Assets/Loot/Weapons/FMS2.png.import | 7 ++-- Assets/Loot/Weapons/FMS3.png.import | 7 ++-- Assets/Loot/Weapons/FMS4.png.import | 7 ++-- Assets/npc/sklep.png.import | 1 + Scenes/Actors/Big Devil.gd | 2 +- Scenes/Actors/EnemyProjectileShield.tscn | 1 + Scenes/Actors/Lil Devil.gd | 2 +- Scenes/Actors/Little_Goblin.gd | 2 +- Scenes/Actors/MageBoss/MageBoss.tscn | 9 ++--- Scenes/Actors/MageBoss/Summon.gd | 6 ++-- Scenes/Actors/Orc.gd | 4 +-- Scenes/Actors/Player.tscn | 36 ++++++++++++++++++- Scenes/Actors/Potato.gd | 2 +- Scenes/Actors/Slime.tscn | 1 - Scenes/Actors/Snot.gd | 2 +- Scenes/Actors/cuck.gd | 2 +- Scenes/Actors/cuckshooter.gd | 2 +- Scenes/Actors/goblin_shaman.gd | 2 +- Scenes/Actors/goblin_shaman.tscn | 3 +- Scenes/Actors/slime.gd | 2 +- Scenes/Equipment/Weapons/Melee/Axe.gd | 1 + .../Weapons/Melee/Moon_particles.tscn | 30 ++++++++++++++-- Scenes/Levels/Main.tscn | 2 +- Scenes/Levels/Room.tscn | 4 +-- Scenes/Levels/Spawning_enemies.gd | 16 --------- Scenes/title_screen/TitleScreen.tscn | 4 +-- project.godot | 1 + 51 files changed, 159 insertions(+), 103 deletions(-) diff --git a/Assets/Enemies/BigDevil.png.import b/Assets/Enemies/BigDevil.png.import index 5d91dd9e..57c842f2 100644 --- a/Assets/Enemies/BigDevil.png.import +++ b/Assets/Enemies/BigDevil.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/bigdevil.png-e6fd35bed5757ab99a95b41c6811c7e6.stex" +path="res://.import/BigDevil.png-5c38b6de19d4dbe1a4e70d44f72414a0.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Enemies/bigdevil.png" -dest_files=[ "res://.import/bigdevil.png-e6fd35bed5757ab99a95b41c6811c7e6.stex" ] +source_file="res://Assets/Enemies/BigDevil.png" +dest_files=[ "res://.import/BigDevil.png-5c38b6de19d4dbe1a4e70d44f72414a0.stex" ] [params] diff --git a/Assets/Enemies/EarthBall.png.import b/Assets/Enemies/EarthBall.png.import index 0efebe35..4b3c4e0d 100644 --- a/Assets/Enemies/EarthBall.png.import +++ b/Assets/Enemies/EarthBall.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/earthball.png-8140742b3cbe6ae477dd1e4fd5a44f11.stex" +path="res://.import/EarthBall.png-4b32539cfbaaa727f975628d48832c0a.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Enemies/earthball.png" -dest_files=[ "res://.import/earthball.png-8140742b3cbe6ae477dd1e4fd5a44f11.stex" ] +source_file="res://Assets/Enemies/EarthBall.png" +dest_files=[ "res://.import/EarthBall.png-4b32539cfbaaa727f975628d48832c0a.stex" ] [params] diff --git a/Assets/Enemies/Goblin_Shaman.png.import b/Assets/Enemies/Goblin_Shaman.png.import index 0e5147fc..d6aab80e 100644 --- a/Assets/Enemies/Goblin_Shaman.png.import +++ b/Assets/Enemies/Goblin_Shaman.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/goblin_shaman.png-5c14dce1efa92690a6b1c744759e2023.stex" +path="res://.import/Goblin_Shaman.png-9fe32c38b23309b8b057bf7a2df62066.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Enemies/goblin_shaman.png" -dest_files=[ "res://.import/goblin_shaman.png-5c14dce1efa92690a6b1c744759e2023.stex" ] +source_file="res://Assets/Enemies/Goblin_Shaman.png" +dest_files=[ "res://.import/Goblin_Shaman.png-9fe32c38b23309b8b057bf7a2df62066.stex" ] [params] @@ -31,5 +31,5 @@ process/invert_color=false process/normal_map_invert_y=false stream=false size_limit=0 -detect_3d=true +detect_3d=false svg/scale=1.0 diff --git a/Assets/Enemies/Lil_Devil_body.png.import b/Assets/Enemies/Lil_Devil_body.png.import index aa392cc0..db10c6b2 100644 --- a/Assets/Enemies/Lil_Devil_body.png.import +++ b/Assets/Enemies/Lil_Devil_body.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/lil_devil_body.png-016f94c8a7f9117d63e88df168681efa.stex" +path="res://.import/Lil_Devil_body.png-720186befdd63fd37c3c339b03a5bac4.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Enemies/lil_devil_body.png" -dest_files=[ "res://.import/lil_devil_body.png-016f94c8a7f9117d63e88df168681efa.stex" ] +source_file="res://Assets/Enemies/Lil_Devil_body.png" +dest_files=[ "res://.import/Lil_Devil_body.png-720186befdd63fd37c3c339b03a5bac4.stex" ] [params] diff --git a/Assets/Enemies/Lil_Devil_head.png.import b/Assets/Enemies/Lil_Devil_head.png.import index c0e9860f..1a3e809e 100644 --- a/Assets/Enemies/Lil_Devil_head.png.import +++ b/Assets/Enemies/Lil_Devil_head.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/lil_devil_head.png-f76cf4eaa6c79def20bc6ba83b4a06e1.stex" +path="res://.import/Lil_Devil_head.png-a7d2d563b0f39127dff0d1b6f1c010bd.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Enemies/lil_devil_head.png" -dest_files=[ "res://.import/lil_devil_head.png-f76cf4eaa6c79def20bc6ba83b4a06e1.stex" ] +source_file="res://Assets/Enemies/Lil_Devil_head.png" +dest_files=[ "res://.import/Lil_Devil_head.png-a7d2d563b0f39127dff0d1b6f1c010bd.stex" ] [params] diff --git a/Assets/Enemies/Little_Goblin.png.import b/Assets/Enemies/Little_Goblin.png.import index 4dcab226..091f7aad 100644 --- a/Assets/Enemies/Little_Goblin.png.import +++ b/Assets/Enemies/Little_Goblin.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/little_goblin.png-8f807615484797a5c88eef8651e8d963.stex" +path="res://.import/Little_Goblin.png-674693612eee1fd8474128384d0cebc5.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Enemies/little_goblin.png" -dest_files=[ "res://.import/little_goblin.png-8f807615484797a5c88eef8651e8d963.stex" ] +source_file="res://Assets/Enemies/Little_Goblin.png" +dest_files=[ "res://.import/Little_Goblin.png-674693612eee1fd8474128384d0cebc5.stex" ] [params] diff --git a/Assets/Enemies/Orc.png.import b/Assets/Enemies/Orc.png.import index e75c31b4..2ebd47f6 100644 --- a/Assets/Enemies/Orc.png.import +++ b/Assets/Enemies/Orc.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/orc.png-95a2ae7892aeabd1d371ed08d9cd4366.stex" +path="res://.import/Orc.png-d250c1361fae935d6bf2699681eb00cd.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Enemies/orc.png" -dest_files=[ "res://.import/orc.png-95a2ae7892aeabd1d371ed08d9cd4366.stex" ] +source_file="res://Assets/Enemies/Orc.png" +dest_files=[ "res://.import/Orc.png-d250c1361fae935d6bf2699681eb00cd.stex" ] [params] diff --git a/Assets/Enemies/Potato.png.import b/Assets/Enemies/Potato.png.import index 412124d4..fe45bf77 100644 --- a/Assets/Enemies/Potato.png.import +++ b/Assets/Enemies/Potato.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/potato.png-076ea84eac4856a22ffdbcbe5c5dc2c2.stex" +path="res://.import/Potato.png-ac6fb7ba58446d8278b51dc6725f6757.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Enemies/potato.png" -dest_files=[ "res://.import/potato.png-076ea84eac4856a22ffdbcbe5c5dc2c2.stex" ] +source_file="res://Assets/Enemies/Potato.png" +dest_files=[ "res://.import/Potato.png-ac6fb7ba58446d8278b51dc6725f6757.stex" ] [params] diff --git a/Assets/Enemies/Shadow.png.import b/Assets/Enemies/Shadow.png.import index 03a16d81..20734189 100644 --- a/Assets/Enemies/Shadow.png.import +++ b/Assets/Enemies/Shadow.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/shadow.png-3cd7b019e0c319825532cb5ee1e4e9fe.stex" +path="res://.import/Shadow.png-d56849c6e07c92cbdf7b1f3e259df7e4.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Enemies/shadow.png" -dest_files=[ "res://.import/shadow.png-3cd7b019e0c319825532cb5ee1e4e9fe.stex" ] +source_file="res://Assets/Enemies/Shadow.png" +dest_files=[ "res://.import/Shadow.png-d56849c6e07c92cbdf7b1f3e259df7e4.stex" ] [params] diff --git a/Assets/Enemies/Slime.png.import b/Assets/Enemies/Slime.png.import index d5d39e15..a2a89d8b 100644 --- a/Assets/Enemies/Slime.png.import +++ b/Assets/Enemies/Slime.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/slime.png-3b311431684beafde68d2de815132ef4.stex" +path="res://.import/Slime.png-b000dd7a00740bc68a34a6d318d8cc82.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Enemies/slime.png" -dest_files=[ "res://.import/slime.png-3b311431684beafde68d2de815132ef4.stex" ] +source_file="res://Assets/Enemies/Slime.png" +dest_files=[ "res://.import/Slime.png-b000dd7a00740bc68a34a6d318d8cc82.stex" ] [params] diff --git a/Assets/Enemies/WindBall.png.import b/Assets/Enemies/WindBall.png.import index 52a65940..e2279073 100644 --- a/Assets/Enemies/WindBall.png.import +++ b/Assets/Enemies/WindBall.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/windball.png-0ab715aeeb7343cca4d74cb1985748be.stex" +path="res://.import/WindBall.png-d2161abc63b97219ce1cdc903c27e310.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Enemies/windball.png" -dest_files=[ "res://.import/windball.png-0ab715aeeb7343cca4d74cb1985748be.stex" ] +source_file="res://Assets/Enemies/WindBall.png" +dest_files=[ "res://.import/WindBall.png-d2161abc63b97219ce1cdc903c27e310.stex" ] [params] diff --git a/Assets/Enemies/cuck.png.import b/Assets/Enemies/cuck.png.import index 73061d39..06700358 100644 --- a/Assets/Enemies/cuck.png.import +++ b/Assets/Enemies/cuck.png.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=false diff --git a/Assets/Enemies/cuckbullet.png.import b/Assets/Enemies/cuckbullet.png.import index e6a81c8e..84ce2b99 100644 --- a/Assets/Enemies/cuckbullet.png.import +++ b/Assets/Enemies/cuckbullet.png.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=false diff --git a/Assets/Enemies/cuckbulletupdated.png.import b/Assets/Enemies/cuckbulletupdated.png.import index bff28030..34542340 100644 --- a/Assets/Enemies/cuckbulletupdated.png.import +++ b/Assets/Enemies/cuckbulletupdated.png.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=false diff --git a/Assets/Enemies/cuckshooter.png.import b/Assets/Enemies/cuckshooter.png.import index 284d5aa4..85c656cd 100644 --- a/Assets/Enemies/cuckshooter.png.import +++ b/Assets/Enemies/cuckshooter.png.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=false diff --git a/Assets/Enemies/cuckshooterupdated.png.import b/Assets/Enemies/cuckshooterupdated.png.import index b33fa0ca..b1ac3a69 100644 --- a/Assets/Enemies/cuckshooterupdated.png.import +++ b/Assets/Enemies/cuckshooterupdated.png.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=false diff --git a/Assets/Enemies/fireball_new.png.import b/Assets/Enemies/fireball_new.png.import index bf9a06ad..1833b5c1 100644 --- a/Assets/Enemies/fireball_new.png.import +++ b/Assets/Enemies/fireball_new.png.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/Assets/Enemies/fireball_old.png.import b/Assets/Enemies/fireball_old.png.import index fda8b886..60f47bd2 100644 --- a/Assets/Enemies/fireball_old.png.import +++ b/Assets/Enemies/fireball_old.png.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/Assets/Enemies/goblin_ball.png.import b/Assets/Enemies/goblin_ball.png.import index a06246bb..ca472afb 100644 --- a/Assets/Enemies/goblin_ball.png.import +++ b/Assets/Enemies/goblin_ball.png.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/Assets/Enemies/snot.png.import b/Assets/Enemies/snot.png.import index c709384b..180be759 100644 --- a/Assets/Enemies/snot.png.import +++ b/Assets/Enemies/snot.png.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=false diff --git a/Assets/Loot/Weapons/BloodSword.png.import b/Assets/Loot/Weapons/BloodSword.png.import index 391daa73..78918642 100644 --- a/Assets/Loot/Weapons/BloodSword.png.import +++ b/Assets/Loot/Weapons/BloodSword.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/bloodsword.png-adf6ee7c9bb1819b87b218cd6fb62f3a.stex" +path="res://.import/BloodSword.png-19f9794306d6fcc6be16b61cce3c671e.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Loot/Weapons/bloodsword.png" -dest_files=[ "res://.import/bloodsword.png-adf6ee7c9bb1819b87b218cd6fb62f3a.stex" ] +source_file="res://Assets/Loot/Weapons/BloodSword.png" +dest_files=[ "res://.import/BloodSword.png-19f9794306d6fcc6be16b61cce3c671e.stex" ] [params] diff --git a/Assets/Loot/Weapons/FMS.png.import b/Assets/Loot/Weapons/FMS.png.import index 13003424..90595107 100644 --- a/Assets/Loot/Weapons/FMS.png.import +++ b/Assets/Loot/Weapons/FMS.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/fms.png-382ec645bddfdf0bdf6880bae99f5f17.stex" +path="res://.import/FMS.png-483a82f7dc857b27c9dcb33f213b6e99.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Loot/Weapons/fms.png" -dest_files=[ "res://.import/fms.png-382ec645bddfdf0bdf6880bae99f5f17.stex" ] +source_file="res://Assets/Loot/Weapons/FMS.png" +dest_files=[ "res://.import/FMS.png-483a82f7dc857b27c9dcb33f213b6e99.stex" ] [params] @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=false diff --git a/Assets/Loot/Weapons/FMS0.png.import b/Assets/Loot/Weapons/FMS0.png.import index fca1f859..f80aedfe 100644 --- a/Assets/Loot/Weapons/FMS0.png.import +++ b/Assets/Loot/Weapons/FMS0.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/fms0.png-c7152999e2ef906f219a6ae8750a22ed.stex" +path="res://.import/FMS0.png-fe0aa179072db4ebdcc0ac989f483d2c.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Loot/Weapons/fms0.png" -dest_files=[ "res://.import/fms0.png-c7152999e2ef906f219a6ae8750a22ed.stex" ] +source_file="res://Assets/Loot/Weapons/FMS0.png" +dest_files=[ "res://.import/FMS0.png-fe0aa179072db4ebdcc0ac989f483d2c.stex" ] [params] @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=false diff --git a/Assets/Loot/Weapons/FMS1.png.import b/Assets/Loot/Weapons/FMS1.png.import index acddcdef..bf9ba7b8 100644 --- a/Assets/Loot/Weapons/FMS1.png.import +++ b/Assets/Loot/Weapons/FMS1.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/fms1.png-fc13cc537dc6fb475f1717dac1c7b281.stex" +path="res://.import/FMS1.png-a84a18730add9db172d599a062e88e21.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Loot/Weapons/fms1.png" -dest_files=[ "res://.import/fms1.png-fc13cc537dc6fb475f1717dac1c7b281.stex" ] +source_file="res://Assets/Loot/Weapons/FMS1.png" +dest_files=[ "res://.import/FMS1.png-a84a18730add9db172d599a062e88e21.stex" ] [params] @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=false diff --git a/Assets/Loot/Weapons/FMS2.png.import b/Assets/Loot/Weapons/FMS2.png.import index 5142f9d0..568d5eac 100644 --- a/Assets/Loot/Weapons/FMS2.png.import +++ b/Assets/Loot/Weapons/FMS2.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/fms2.png-5ee0562a527a5e978e742df90d58c892.stex" +path="res://.import/FMS2.png-a9af11453bada6d639cba6d83634489d.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Loot/Weapons/fms2.png" -dest_files=[ "res://.import/fms2.png-5ee0562a527a5e978e742df90d58c892.stex" ] +source_file="res://Assets/Loot/Weapons/FMS2.png" +dest_files=[ "res://.import/FMS2.png-a9af11453bada6d639cba6d83634489d.stex" ] [params] @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=false diff --git a/Assets/Loot/Weapons/FMS3.png.import b/Assets/Loot/Weapons/FMS3.png.import index af22c91f..33d3d02c 100644 --- a/Assets/Loot/Weapons/FMS3.png.import +++ b/Assets/Loot/Weapons/FMS3.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/fms3.png-5ddcf29c777d31c95b88e0fa1a5eae41.stex" +path="res://.import/FMS3.png-ad82bea65bd9fdd122b9eaffa68cced2.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Loot/Weapons/fms3.png" -dest_files=[ "res://.import/fms3.png-5ddcf29c777d31c95b88e0fa1a5eae41.stex" ] +source_file="res://Assets/Loot/Weapons/FMS3.png" +dest_files=[ "res://.import/FMS3.png-ad82bea65bd9fdd122b9eaffa68cced2.stex" ] [params] @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=false diff --git a/Assets/Loot/Weapons/FMS4.png.import b/Assets/Loot/Weapons/FMS4.png.import index 17e11161..8b602766 100644 --- a/Assets/Loot/Weapons/FMS4.png.import +++ b/Assets/Loot/Weapons/FMS4.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/fms4.png-a8e75cc225c123fb3fe2e33839c14104.stex" +path="res://.import/FMS4.png-cb9b849659e707f9beab3df34a49146e.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Loot/Weapons/fms4.png" -dest_files=[ "res://.import/fms4.png-a8e75cc225c123fb3fe2e33839c14104.stex" ] +source_file="res://Assets/Loot/Weapons/FMS4.png" +dest_files=[ "res://.import/FMS4.png-cb9b849659e707f9beab3df34a49146e.stex" ] [params] @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=false diff --git a/Assets/npc/sklep.png.import b/Assets/npc/sklep.png.import index 6252f501..6fde02f7 100644 --- a/Assets/npc/sklep.png.import +++ b/Assets/npc/sklep.png.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/Scenes/Actors/Big Devil.gd b/Scenes/Actors/Big Devil.gd index bf1ce6fc..62ab4f0f 100644 --- a/Scenes/Actors/Big Devil.gd +++ b/Scenes/Actors/Big Devil.gd @@ -242,7 +242,7 @@ func random_potion(): potion = int(rng.randi_range(2,3)) else: potion = int(rng.randi_range(0,2)) - print(potion) + print("[INFO]: at " + self.name + ": potion dropped: " + str(potion)) var tmp if potion == 0: diff --git a/Scenes/Actors/EnemyProjectileShield.tscn b/Scenes/Actors/EnemyProjectileShield.tscn index c3764d4c..8601a998 100644 --- a/Scenes/Actors/EnemyProjectileShield.tscn +++ b/Scenes/Actors/EnemyProjectileShield.tscn @@ -62,4 +62,5 @@ lifetime = 5.0 preprocess = 4.0 visibility_rect = Rect2( 0, 0, 0, 48.9708 ) process_material = SubResource( 8 ) + [connection signal="body_entered" from="." to="." method="_on_EnemyProjectileShield_body_entered"] diff --git a/Scenes/Actors/Lil Devil.gd b/Scenes/Actors/Lil Devil.gd index cf46574d..5865f1f9 100644 --- a/Scenes/Actors/Lil Devil.gd +++ b/Scenes/Actors/Lil Devil.gd @@ -174,7 +174,7 @@ func random_potion(): rng.randomize() var potion potion = int(rng.randi_range(0,1)) - print(potion) + print("[INFO]: at " + self.name + ": potion dropped: " + str(potion)) var tmp if potion == 0: tmp = load("res://Scenes/Loot/20healthPotion.tscn") diff --git a/Scenes/Actors/Little_Goblin.gd b/Scenes/Actors/Little_Goblin.gd index da210b0a..613481ba 100644 --- a/Scenes/Actors/Little_Goblin.gd +++ b/Scenes/Actors/Little_Goblin.gd @@ -140,7 +140,7 @@ func random_potion(): rng.randomize() var potion potion = int(rng.randi_range(0,1)) - print(potion) + print("[INFO]: at " + self.name + ": potion dropped: " + str(potion)) var tmp if potion == 0: tmp = load("res://Scenes/Loot/20healthPotion.tscn") diff --git a/Scenes/Actors/MageBoss/MageBoss.tscn b/Scenes/Actors/MageBoss/MageBoss.tscn index 1e1f214b..d5d597c8 100644 --- a/Scenes/Actors/MageBoss/MageBoss.tscn +++ b/Scenes/Actors/MageBoss/MageBoss.tscn @@ -2,12 +2,11 @@ [ext_resource path="res://Scenes/Actors/MageBoss/MageBoss.gd" type="Script" id=1] [ext_resource path="res://Assets/Light/Light.tscn" type="PackedScene" id=2] +[ext_resource path="res://Assets/Enemies/waterball.png" type="Texture" id=3] [ext_resource path="res://Assets/Enemies/fireball_new.png" type="Texture" id=4] -[ext_resource path="res://Assets/Enemies/WaterBall.png" type="Texture" id=5] [ext_resource path="res://Assets/Enemies/windball.png" type="Texture" id=6] [ext_resource path="res://Assets/Enemies/earthball.png" type="Texture" id=7] - [sub_resource type="Gradient" id=1] offsets = PoolRealArray( 0, 0.244444, 0.525926, 0.777778, 1 ) colors = PoolColorArray( 0.654902, 0.839216, 0.92549, 1, 0, 0.32549, 0.85098, 1, 0.960784, 0.486275, 0.00392157, 1, 0.262745, 0.203922, 0.152941, 1, 0.65098, 0.827451, 0.913725, 1 ) @@ -208,9 +207,7 @@ tracks/6/keys = { "values": [ SubResource( 1 ), SubResource( 20 ) ] } -[node name="MageBoss" type="KinematicBody2D" groups=[ -"Enemy", -]] +[node name="MageBoss" type="KinematicBody2D" groups=["Enemy"]] collision_layer = 4 collision_mask = 3 script = ExtResource( 1 ) @@ -271,7 +268,7 @@ local_coords = false process_material = SubResource( 15 ) [node name="Sprite" type="Sprite" parent="WaterFireCenter/Waterball"] -texture = ExtResource( 5 ) +texture = ExtResource( 3 ) [node name="Light2D2" parent="WaterFireCenter/Waterball" instance=ExtResource( 2 )] scale = Vector2( 0.2, 0.2 ) diff --git a/Scenes/Actors/MageBoss/Summon.gd b/Scenes/Actors/MageBoss/Summon.gd index 22619f9e..933cea88 100644 --- a/Scenes/Actors/MageBoss/Summon.gd +++ b/Scenes/Actors/MageBoss/Summon.gd @@ -21,13 +21,13 @@ func _ready(): $Particles2D.texture = load("res://Assets/Enemies/fireball_new.png") elif boss.phase == 2: $WaterL.visible = true #włącza odpowiednie światło - $Particles2D.texture = load("res://Assets/Enemies/WaterBall.png") + $Particles2D.texture = load("res://Assets/Enemies/waterball.png") elif boss.phase == 3: $EarthL.visible = true - $Particles2D.texture = load("res://Assets/Enemies/EarthBall.png") + $Particles2D.texture = load("res://Assets/Enemies/earthball.png") elif boss.phase == 4: $WindL.visible = true #włącza odpowiednie światło - $Particles2D.texture = load("res://Assets/Enemies/WindBall.png") + $Particles2D.texture = load("res://Assets/Enemies/windball.png") func _physics_process(delta): move = Vector2.ZERO diff --git a/Scenes/Actors/Orc.gd b/Scenes/Actors/Orc.gd index f1c8b566..a4e7e9cb 100644 --- a/Scenes/Actors/Orc.gd +++ b/Scenes/Actors/Orc.gd @@ -191,7 +191,7 @@ func get_dmg(dmg, weaponKnockback): # === ZMNIEJSZANIE HP === # hp -= dmg # zmniejszanie hp o otrzymany dmg health = hp/max_hp*100 # procentowo się zmienia ilośc hp na pasku - # Animacje obrażeń zostają aktywowane na sprite Body i Head + # Animacja obrażeń własnych $BodyAnimationPlayer.play("Hurt") health_bar.on_health_updated(health) # healthbar zostaje zupdateowany z nową procentową ilością hp @@ -247,7 +247,7 @@ func random_potion(): potion = int(rng.randi_range(2,3)) else: potion = int(rng.randi_range(0,3)) - print(potion) + print("[INFO]: at " + self.name + ": potion dropped: " + str(potion)) var tmp if potion == 0: tmp = load("res://Scenes/Loot/20healthPotion.tscn") diff --git a/Scenes/Actors/Player.tscn b/Scenes/Actors/Player.tscn index be2bb44f..f9c8c9f4 100644 --- a/Scenes/Actors/Player.tscn +++ b/Scenes/Actors/Player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=36 format=2] +[gd_scene load_steps=38 format=2] [ext_resource path="res://Assets/Hero/RedHero.png" type="Texture" id=1] [ext_resource path="res://Scenes/Actors/Player.gd" type="Script" id=2] @@ -72,6 +72,23 @@ tracks/0/keys = { "values": [ 8 ] } +[sub_resource type="Animation" id=29] +resource_name = "Hurt" +length = 0.25 +step = 0.05 +tracks/0/type = "value" +tracks/0/path = NodePath("PlayerSprite:self_modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.05, 0.1, 0.25 ), +"transitions": PoolRealArray( 1, 1, 1, 1 ), +"update": 0, +"values": [ Color( 1, 1, 1, 1 ), Color( 0.521569, 0.156863, 0.156863, 1 ), Color( 1, 0, 0, 1 ), Color( 1, 1, 1, 1 ) ] +} + [sub_resource type="Animation" id=12] length = 0.6 loop = true @@ -88,6 +105,21 @@ tracks/0/keys = { "values": [ 0, 1 ] } +[sub_resource type="Animation" id=30] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath("PlayerSprite:self_modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ Color( 1, 1, 1, 1 ) ] +} + [sub_resource type="Animation" id=13] length = 0.7 tracks/0/type = "value" @@ -231,7 +263,9 @@ autoplay = true [node name="AnimationPlayer" type="AnimationPlayer" parent="."] anims/Hit = SubResource( 11 ) +anims/Hurt = SubResource( 29 ) anims/Idle = SubResource( 12 ) +anims/RESET = SubResource( 30 ) anims/Run = SubResource( 13 ) anims/skok = SubResource( 14 ) diff --git a/Scenes/Actors/Potato.gd b/Scenes/Actors/Potato.gd index 7dcf89ce..12343137 100644 --- a/Scenes/Actors/Potato.gd +++ b/Scenes/Actors/Potato.gd @@ -162,7 +162,7 @@ func random_potion(): rng.randomize() var potion potion = int(rng.randi_range(0,1)) - print(potion) + print("[INFO]: at " + self.name + ": potion dropped: " + str(potion)) var tmp if potion == 0: diff --git a/Scenes/Actors/Slime.tscn b/Scenes/Actors/Slime.tscn index 3501c70d..3a980bad 100644 --- a/Scenes/Actors/Slime.tscn +++ b/Scenes/Actors/Slime.tscn @@ -5,7 +5,6 @@ [ext_resource path="res://Scenes/UI/HealthBar.tscn" type="PackedScene" id=3] [ext_resource path="res://Assets/Enemies/shadow.png" type="Texture" id=4] - [sub_resource type="CapsuleShape2D" id=1] radius = 6.14429 height = 8.49784 diff --git a/Scenes/Actors/Snot.gd b/Scenes/Actors/Snot.gd index 803db5be..72c0f37a 100644 --- a/Scenes/Actors/Snot.gd +++ b/Scenes/Actors/Snot.gd @@ -163,7 +163,7 @@ func get_dmg(dmg, weaponKnockback): func random_potion(): rng.randomize() var potion = int(rng.randi_range(0,1)) - print(potion) + print("[INFO]: at " + self.name + ": potion dropped: " + str(potion)) var tmp if potion == 0: diff --git a/Scenes/Actors/cuck.gd b/Scenes/Actors/cuck.gd index 81334844..beadbdbc 100644 --- a/Scenes/Actors/cuck.gd +++ b/Scenes/Actors/cuck.gd @@ -143,7 +143,7 @@ func get_dmg(dmg, weaponKnockback): func random_potion(): rng.randomize() var potion = int(rng.randi_range(0,1)) - print(potion) + print("[INFO]: at " + self.name + ": potion dropped: " + str(potion)) var tmp if potion == 0: diff --git a/Scenes/Actors/cuckshooter.gd b/Scenes/Actors/cuckshooter.gd index 9dc9a3a2..e7b13da2 100644 --- a/Scenes/Actors/cuckshooter.gd +++ b/Scenes/Actors/cuckshooter.gd @@ -159,7 +159,7 @@ func random_potion(): rng.randomize() var potion potion = int(rng.randi_range(1,2)) - print(potion) + print("[INFO]: at " + self.name + ": potion dropped: " + str(potion)) var tmp if potion == 1: diff --git a/Scenes/Actors/goblin_shaman.gd b/Scenes/Actors/goblin_shaman.gd index 4b4ab430..6bb44597 100644 --- a/Scenes/Actors/goblin_shaman.gd +++ b/Scenes/Actors/goblin_shaman.gd @@ -177,7 +177,7 @@ func random_potion(): potion = int(rng.randi_range(2,3)) else: potion = int(rng.randi_range(0,2)) - print(potion) + print("[INFO]: at " + self.name + ": potion dropped: " + str(potion)) var tmp if potion == 0: diff --git a/Scenes/Actors/goblin_shaman.tscn b/Scenes/Actors/goblin_shaman.tscn index e666a03c..c7376f19 100644 --- a/Scenes/Actors/goblin_shaman.tscn +++ b/Scenes/Actors/goblin_shaman.tscn @@ -1,11 +1,10 @@ [gd_scene load_steps=13 format=2] -[ext_resource path="res://Assets/Enemies/Goblin_shaman.png" type="Texture" id=1] +[ext_resource path="res://Assets/Enemies/goblin_shaman.png" type="Texture" id=1] [ext_resource path="res://Scenes/Actors/goblin_shaman.gd" type="Script" id=2] [ext_resource path="res://Scenes/UI/HealthBar.tscn" type="PackedScene" id=3] [ext_resource path="res://Assets/Enemies/shadow.png" type="Texture" id=4] - [sub_resource type="CapsuleShape2D" id=1] radius = 6.14429 height = 8.49784 diff --git a/Scenes/Actors/slime.gd b/Scenes/Actors/slime.gd index 58e344bd..ef8db603 100644 --- a/Scenes/Actors/slime.gd +++ b/Scenes/Actors/slime.gd @@ -155,7 +155,7 @@ func random_potion(): rng.randomize() var potion potion = int(rng.randi_range(0,1)) - print(potion) + print("[INFO]: at " + self.name + ": potion dropped: " + str(potion)) var tmp if potion == 0: diff --git a/Scenes/Equipment/Weapons/Melee/Axe.gd b/Scenes/Equipment/Weapons/Melee/Axe.gd index f991e62a..f10804c5 100644 --- a/Scenes/Equipment/Weapons/Melee/Axe.gd +++ b/Scenes/Equipment/Weapons/Melee/Axe.gd @@ -106,6 +106,7 @@ func _physics_process(delta): self.add_child(t) t.start() yield(t, "timeout") + t.queue_free() player_node.speed = tmpspeed damage = tmpdmg diff --git a/Scenes/Equipment/Weapons/Melee/Moon_particles.tscn b/Scenes/Equipment/Weapons/Melee/Moon_particles.tscn index 09b76854..80418058 100644 --- a/Scenes/Equipment/Weapons/Melee/Moon_particles.tscn +++ b/Scenes/Equipment/Weapons/Melee/Moon_particles.tscn @@ -1,4 +1,14 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=10 format=2] + +[ext_resource path="res://Assets/Light/Light_texture.png" type="Texture" id=1] + +[sub_resource type="Curve" id=5] +min_value = -360.0 +max_value = 360.0 +_data = [ Vector2( 0, -360 ), 0.0, 0.0, 0, 0, Vector2( 0.488038, 360 ), 0.0, 0.0, 0, 0, Vector2( 0.985646, -360 ), 0.0, 0.0, 0, 0 ] + +[sub_resource type="CurveTexture" id=6] +curve = SubResource( 5 ) [sub_resource type="Gradient" id=1] offsets = PoolRealArray( 0, 0.886667 ) @@ -7,16 +17,27 @@ colors = PoolColorArray( 0.933594, 0.878891, 0.878891, 1, 0.152588, 0.189304, 0. [sub_resource type="GradientTexture" id=2] gradient = SubResource( 1 ) +[sub_resource type="Curve" id=7] +_data = [ Vector2( 0, 0.376136 ), 0.0, 0.0, 0, 0, Vector2( 1, 1 ), 0.0, 0.0, 0, 0 ] + +[sub_resource type="CurveTexture" id=8] +curve = SubResource( 7 ) + [sub_resource type="ParticlesMaterial" id=3] flag_disable_z = true direction = Vector3( 0, 1, 0 ) spread = 52.1 gravity = Vector3( 0, 0.2, 0 ) initial_velocity = 0.1 +angular_velocity_random = 1.0 +angular_velocity_curve = SubResource( 6 ) orbit_velocity = 0.0 orbit_velocity_random = 0.0 linear_accel = 1.0 angle_random = 1.0 +scale = 5.0 +scale_random = 1.0 +scale_curve = SubResource( 8 ) color_ramp = SubResource( 2 ) [sub_resource type="GDScript" id=4] @@ -36,11 +57,16 @@ func _ready() -> void: " [node name="Node2D" type="Node2D"] +z_index = 1 [node name="Particles2D" type="Particles2D" parent="."] position = Vector2( 0.135067, 0.00236297 ) amount = 150 lifetime = 9.0 -speed_scale = 5.17 +speed_scale = 21.68 +randomness = 1.0 process_material = SubResource( 3 ) script = SubResource( 4 ) + +[node name="Light2D" type="Light2D" parent="."] +texture = ExtResource( 1 ) diff --git a/Scenes/Levels/Main.tscn b/Scenes/Levels/Main.tscn index a4a75f38..6915b132 100644 --- a/Scenes/Levels/Main.tscn +++ b/Scenes/Levels/Main.tscn @@ -80,6 +80,6 @@ z_index = 2 [node name="Weapons" parent="." instance=ExtResource( 4 )] [node name="CanvasModulate" type="CanvasModulate" parent="."] -color = Color( 0.364706, 0.231373, 0.513726, 1 ) +color = Color( 0.160784, 0.109804, 0.282353, 1 ) [connection signal="map_generated" from="." to="UI/Map" method="_on_map_generated"] diff --git a/Scenes/Levels/Room.tscn b/Scenes/Levels/Room.tscn index 68018100..6a890916 100644 --- a/Scenes/Levels/Room.tscn +++ b/Scenes/Levels/Room.tscn @@ -12,9 +12,7 @@ extents = Vector2( 208, 112 ) closed = false polygon = PoolVector2Array( -256, -144, 256, -144, 256, 144, -256, 144, -256, -144 ) -[node name="Node2D" type="Area2D" groups=[ -"walls", -]] +[node name="Node2D" type="Area2D" groups=["walls"]] collision_layer = 0 collision_mask = 5 diff --git a/Scenes/Levels/Spawning_enemies.gd b/Scenes/Levels/Spawning_enemies.gd index ddc26df4..d173cdd6 100644 --- a/Scenes/Levels/Spawning_enemies.gd +++ b/Scenes/Levels/Spawning_enemies.gd @@ -101,22 +101,6 @@ func _on_Node2D_body_entered(body): #Funkcja,która się aktywuje po wejsciu w k call_deferred("add_child",bossIns) #dodawanie sceny boss'a bossIns.connect("died", self, "open") #polaczenie sygnalu ktory otwiera drzwi po zabiciu bossa close_door() #zamkniecie drzwi - elif is_sklep: - if odwiedzony == false: - weapon() - potion() - var popup = load("res://Scenes/UI/Sklep_ceny.tscn") - popup = popup.instance() - popup.rect_scale.x = 0.5 - popup.rect_scale.y = 0.5 - call_deferred("add_child", popup) - popups[body] = popup - odwiedzony = true - Bufor.in_sklep = true - elif is_sklep == false: - if body in popups: - popups[body].call_deferred('free') - Bufor.in_sklep = false id_list.append(current_id) if body.is_in_group("Enemy"): #zamykanie drzwi po wejsciu do pokoju close_door() diff --git a/Scenes/title_screen/TitleScreen.tscn b/Scenes/title_screen/TitleScreen.tscn index 6acbf9c1..a7028dd2 100644 --- a/Scenes/title_screen/TitleScreen.tscn +++ b/Scenes/title_screen/TitleScreen.tscn @@ -76,7 +76,7 @@ position = Vector2( 226.176, 732.406 ) scale = Vector2( 5.22092, 5.22092 ) frames = SubResource( 2 ) animation = "octoboss_menu" -frame = 5 +frame = 6 playing = true flip_h = true @@ -86,7 +86,7 @@ position = Vector2( 1198.72, 619.51 ) scale = Vector2( 9.61799, 9.61799 ) frames = SubResource( 6 ) animation = "pandoboss_menu" -frame = 2 +frame = 10 playing = true [node name="Menu" type="VBoxContainer" parent="."] diff --git a/project.godot b/project.godot index 52aee266..d4cd6edd 100644 --- a/project.godot +++ b/project.godot @@ -133,3 +133,4 @@ skok={ [rendering] environment/default_environment="res://default_env.tres" +quality/dynamic_fonts/use_oversampling=false From 0fd15b2530c575aecb82c29133a186173938a4a2 Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Fri, 25 Feb 2022 15:36:24 +0100 Subject: [PATCH 03/15] =?UTF-8?q?Wersja=20pogl=C4=85dowa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scenes/Actors/Player.gd | 2 +- Scenes/Levels/Camera.gd | 4 +- Scenes/Levels/Level_gen.gd | 118 +++++++++++++++++++++++++++ Scenes/Levels/Main.tscn | 14 +++- Scenes/Levels/Room.gd | 11 +++ Scenes/Levels/Room_new.tscn | 9 ++ Scenes/title_screen/TitleScreen.tscn | 4 +- project.godot | 4 + 8 files changed, 158 insertions(+), 8 deletions(-) create mode 100644 Scenes/Levels/Level_gen.gd create mode 100644 Scenes/Levels/Room.gd create mode 100644 Scenes/Levels/Room_new.tscn diff --git a/Scenes/Actors/Player.gd b/Scenes/Actors/Player.gd index 4ef72720..9057b7f8 100644 --- a/Scenes/Actors/Player.gd +++ b/Scenes/Actors/Player.gd @@ -10,7 +10,7 @@ onready var statusEffect = get_node("../UI/StatusBar") var velocity = Vector2.ZERO #wektor prędkości bohatera var got_hitted = false #czy bohater jest aktualnie uderzany -export var speed = 100 #wartośc szybkości bohatera +export var speed = 500 #wartośc szybkości bohatera var direction = Vector2() #wektor kierunku bohatera export var health = 100 #ilośc punktów życia bohatera export var mana = 100 #ilość many (1pkt many ~= 1 użycie umki) diff --git a/Scenes/Levels/Camera.gd b/Scenes/Levels/Camera.gd index 47026f72..aa3aef39 100644 --- a/Scenes/Levels/Camera.gd +++ b/Scenes/Levels/Camera.gd @@ -8,8 +8,8 @@ var grid_position = Vector2() onready var parent = get_parent() #Odwołanie do playera func _ready(): - zoom.x = 0.4 #ustawienia zoom'a kamery - zoom.y = 0.4 + zoom.x = 5 #ustawienia zoom'a kamery + zoom.y = 5 set_as_toplevel(true) update_grid_position() diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd new file mode 100644 index 00000000..d838d305 --- /dev/null +++ b/Scenes/Levels/Level_gen.gd @@ -0,0 +1,118 @@ +extends Node2D + +var Room = preload("res://Scenes/Levels/Room_new.tscn") +var Player = preload("res://Scenes/Actors/Player.tscn") +onready var Map = $TileMap + +var tile_size = 32 +var room_num = 50 +var min_size = 4 +var max_size = 10 +var hspread = 400 +var cull = 0.6 +var path + +func _ready(): + randomize() + make_rooms() + +func make_rooms(): + for i in range(room_num): + var pos = Vector2(0, 0) + var r = Room.instance() + var w = min_size + randi()%(max_size-min_size) + var h = min_size + randi()%(max_size-min_size) + r.make_room(pos, Vector2(w,h) * tile_size) + $Rooms.add_child(r) + yield(get_tree().create_timer(1.5),"timeout") #zatrzymuje funkcje i wykonuje w tym czasie przerwe + var room_positions = [] + for room in $Rooms.get_children(): + if randf() < cull: + room.queue_free() + else: + room.mode = RigidBody2D.MODE_STATIC + room_positions.append(Vector3(room.position.x, + room.position.y, 0)) + yield(get_tree(),"idle_frame") + path = find_mst(room_positions) + make_map() + +func _process(delta): + update() + +func _input(event): + if event.is_action_pressed("ui_select"): + for n in $Rooms.get_children(): + n.queue_free() + path = null + make_rooms() + if event.is_action_pressed("ui_focus_next"): + make_map() + +func find_mst(nodes): #algorytm Prima + var path = AStar.new() + path.add_point(path.get_available_point_id(),nodes.pop_front()) + while nodes: + var min_dist = INF #minimalny dystans + var min_p = null #pozycja node'a + var p = null #obecna pozycja + for p1 in path.get_points(): + p1 = path.get_point_position(p1) + for p2 in nodes: + if p1.distance_to(p2)0): + x_y = pos2 + y_x = pos1 + for x in range(pos1.x, pos2.x, x_diff): + Map.set_cell(x, x_y.y, 11) + for y in range(pos1.y, pos2.y, y_diff): + Map.set_cell(y_x.x, y, 11) diff --git a/Scenes/Levels/Main.tscn b/Scenes/Levels/Main.tscn index 6915b132..0f643b67 100644 --- a/Scenes/Levels/Main.tscn +++ b/Scenes/Levels/Main.tscn @@ -1,12 +1,13 @@ -[gd_scene load_steps=11 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://Scenes/UI/StatusBar.tscn" type="PackedScene" id=1] [ext_resource path="res://Scenes/Actors/Player.tscn" type="PackedScene" id=2] -[ext_resource path="res://Scenes/Levels/Random_gen.gd" type="Script" id=3] +[ext_resource path="res://Scenes/Levels/Level_gen.gd" type="Script" id=3] [ext_resource path="res://autoloads/Weapons.tscn" type="PackedScene" id=4] [ext_resource path="res://Scenes/UI/MiniMap.tscn" type="PackedScene" id=5] [ext_resource path="res://Scenes/UI/BigMap.tscn" type="PackedScene" id=6] [ext_resource path="res://Scenes/UI/ManaBar.gd" type="Script" id=7] +[ext_resource path="res://Assets/TileMap/Room1.tres" type="TileSet" id=8] [ext_resource path="res://Scenes/UI/HealthBar.tscn" type="PackedScene" id=13] [ext_resource path="res://Scenes/UI/Slots.tscn" type="PackedScene" id=14] [ext_resource path="res://Scenes/UI/Coins.tscn" type="PackedScene" id=16] @@ -76,10 +77,17 @@ rect_scale = Vector2( 2, 2 ) [node name="Player" parent="." instance=ExtResource( 2 )] z_index = 2 +collision_layer = 0 +collision_mask = 0 [node name="Weapons" parent="." instance=ExtResource( 4 )] [node name="CanvasModulate" type="CanvasModulate" parent="."] color = Color( 0.160784, 0.109804, 0.282353, 1 ) -[connection signal="map_generated" from="." to="UI/Map" method="_on_map_generated"] +[node name="Rooms" type="Node" parent="."] + +[node name="TileMap" type="TileMap" parent="."] +tile_set = ExtResource( 8 ) +cell_size = Vector2( 32, 32 ) +format = 1 diff --git a/Scenes/Levels/Room.gd b/Scenes/Levels/Room.gd new file mode 100644 index 00000000..474f0f95 --- /dev/null +++ b/Scenes/Levels/Room.gd @@ -0,0 +1,11 @@ +extends RigidBody2D + +var size + +func make_room(_pos, _size): + position = _pos + size = _size + var s = RectangleShape2D.new() + s.custom_solver_bias = 0.75 + s.extents = size + $CollisionShape2D.shape = s diff --git a/Scenes/Levels/Room_new.tscn b/Scenes/Levels/Room_new.tscn new file mode 100644 index 00000000..1f6f6999 --- /dev/null +++ b/Scenes/Levels/Room_new.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://Scenes/Levels/Room.gd" type="Script" id=1] + +[node name="Room" type="RigidBody2D"] +mode = 2 +script = ExtResource( 1 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/Scenes/title_screen/TitleScreen.tscn b/Scenes/title_screen/TitleScreen.tscn index a7028dd2..3c13e931 100644 --- a/Scenes/title_screen/TitleScreen.tscn +++ b/Scenes/title_screen/TitleScreen.tscn @@ -76,7 +76,7 @@ position = Vector2( 226.176, 732.406 ) scale = Vector2( 5.22092, 5.22092 ) frames = SubResource( 2 ) animation = "octoboss_menu" -frame = 6 +frame = 12 playing = true flip_h = true @@ -86,7 +86,7 @@ position = Vector2( 1198.72, 619.51 ) scale = Vector2( 9.61799, 9.61799 ) frames = SubResource( 6 ) animation = "pandoboss_menu" -frame = 10 +frame = 7 playing = true [node name="Menu" type="VBoxContainer" parent="."] diff --git a/project.godot b/project.godot index d4cd6edd..0fbfb89d 100644 --- a/project.godot +++ b/project.godot @@ -130,6 +130,10 @@ skok={ 2d_physics/layer_7="coins" 2d_physics/projectiles=false +[physics] + +2d/default_gravity=0 + [rendering] environment/default_environment="res://default_env.tres" From e45cb5af1c4317126eb90ab81ddd8d62a887a5fa Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Thu, 3 Mar 2022 15:32:26 +0100 Subject: [PATCH 04/15] =?UTF-8?q?=C5=9Aciany=20(z=20bugami)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scenes/Actors/Player.gd | 2 +- Scenes/Levels/Camera.gd | 4 ++-- Scenes/Levels/Level_gen.gd | 39 +++++++++++++++++++++++++++++++------- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/Scenes/Actors/Player.gd b/Scenes/Actors/Player.gd index 9057b7f8..67d4ef58 100644 --- a/Scenes/Actors/Player.gd +++ b/Scenes/Actors/Player.gd @@ -10,7 +10,7 @@ onready var statusEffect = get_node("../UI/StatusBar") var velocity = Vector2.ZERO #wektor prędkości bohatera var got_hitted = false #czy bohater jest aktualnie uderzany -export var speed = 500 #wartośc szybkości bohatera +export var speed = 1000 #wartośc szybkości bohatera var direction = Vector2() #wektor kierunku bohatera export var health = 100 #ilośc punktów życia bohatera export var mana = 100 #ilość many (1pkt many ~= 1 użycie umki) diff --git a/Scenes/Levels/Camera.gd b/Scenes/Levels/Camera.gd index aa3aef39..62ac59ff 100644 --- a/Scenes/Levels/Camera.gd +++ b/Scenes/Levels/Camera.gd @@ -8,8 +8,8 @@ var grid_position = Vector2() onready var parent = get_parent() #Odwołanie do playera func _ready(): - zoom.x = 5 #ustawienia zoom'a kamery - zoom.y = 5 + zoom.x = 4 #ustawienia zoom'a kamery + zoom.y = 4 set_as_toplevel(true) update_grid_position() diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd index d838d305..23dc0123 100644 --- a/Scenes/Levels/Level_gen.gd +++ b/Scenes/Levels/Level_gen.gd @@ -6,12 +6,15 @@ onready var Map = $TileMap var tile_size = 32 var room_num = 50 -var min_size = 4 -var max_size = 10 -var hspread = 400 -var cull = 0.6 +var min_size = 10 +var max_size = 12 +var hspread = 600 +var cull = 0.7 var path +var start_room = null +var end_room = null + func _ready(): randomize() make_rooms() @@ -51,7 +54,7 @@ func _input(event): func find_mst(nodes): #algorytm Prima var path = AStar.new() - path.add_point(path.get_available_point_id(),nodes.pop_front()) + path.add_point(path.get_available_point_id(), nodes.pop_front()) while nodes: var min_dist = INF #minimalny dystans var min_p = null #pozycja node'a @@ -81,7 +84,7 @@ func make_map(): # for x in range(topleft.x, bottomright.x): # for y in range(topleft.y, bottomright.y): -# Map.set_cell(x,y,56) +# Map.set_cell(x,y,44) var corridors = [] for room in $Rooms.get_children(): var s = (room.size/tile_size).floor() @@ -90,6 +93,16 @@ func make_map(): for x in range(2, s.x * 2 - 1): for y in range(2, s.y * 2 - 1): Map.set_cell(ul.x + x, ul.y + y, 11) + for x in range(1, s.x * 2): + if(Map.get_cell(ul.x + x, ul.y + 1) != 11): + Map.set_cell(ul.x + x, ul.y + 1, 44) + if(Map.get_cell(ul.x + x, ul.y + s.y * 2 - 1) != 11): + Map.set_cell(ul.x + x, ul.y + s.y * 2 - 1, 44) + for y in range(1, s.y * 2): + if(Map.get_cell(ul.x + 1, ul.y + y) != 11): + Map.set_cell(ul.x + 1, ul.y + y, 47) + if(Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11): + Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 47) var p = path.get_closest_point(Vector3(room.position.x, room.position.y, 0)) for conn in path.get_point_connections(p): if not conn in corridors: @@ -108,11 +121,23 @@ func carve_path(pos1, pos2): if y_diff == 0: y_diff = pow(-1.0, randi() % 2) var x_y = pos1 - var y_x = pos2 + var y_x = pos2 if(randi()%2>0): x_y = pos2 y_x = pos1 for x in range(pos1.x, pos2.x, x_diff): Map.set_cell(x, x_y.y, 11) + for y in range(pos1.y, pos2.y, y_diff): Map.set_cell(y_x.x, y, 11) + + for x in range(pos1.x - 1, pos2.x + 1, x_diff): + if (Map.get_cell(x, x_y.y+1) != 11): + Map.set_cell(x, x_y.y+1, 44) + if (Map.get_cell(x, x_y.y-1) != 11): + Map.set_cell(x, x_y.y-1, 44) + for y in range(pos1.y - 1, pos2.y + 1, y_diff): + if (Map.get_cell(y_x.x+1, y) != 11): + Map.set_cell(y_x.x+1, y, 44) + if (Map.get_cell(y_x.x-1, y) != 11): + Map.set_cell(y_x.x-1, y, 44) From 51920cf564ae2343a3e0f314fe1db27ec007c64a Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Sun, 6 Mar 2022 16:44:15 +0100 Subject: [PATCH 05/15] Naprawa korytarzy (prawie) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Naprawa ścian korytarzy, trzeba tylko ustawić poprawnie wartości tile'ów, wstępna funkcja stawiania drzwi, poprawne tile ścian pokoju (do dopracowania), początkowy i końcowy pokój, naprawa kolizji gracza ze ścianami --- Scenes/Levels/Camera.gd | 4 +- Scenes/Levels/Level_gen.gd | 155 +++++++++++++++++++-------- Scenes/Levels/Main.tscn | 4 +- Scenes/Levels/Room_new.tscn | 2 + Scenes/title_screen/TitleScreen.tscn | 7 +- 5 files changed, 119 insertions(+), 53 deletions(-) diff --git a/Scenes/Levels/Camera.gd b/Scenes/Levels/Camera.gd index 62ac59ff..0d20d2c4 100644 --- a/Scenes/Levels/Camera.gd +++ b/Scenes/Levels/Camera.gd @@ -8,8 +8,8 @@ var grid_position = Vector2() onready var parent = get_parent() #Odwołanie do playera func _ready(): - zoom.x = 4 #ustawienia zoom'a kamery - zoom.y = 4 + zoom.x = 1 #ustawienia zoom'a kamery + zoom.y = 1 set_as_toplevel(true) update_grid_position() diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd index 23dc0123..63d68063 100644 --- a/Scenes/Levels/Level_gen.gd +++ b/Scenes/Levels/Level_gen.gd @@ -4,56 +4,56 @@ var Room = preload("res://Scenes/Levels/Room_new.tscn") var Player = preload("res://Scenes/Actors/Player.tscn") onready var Map = $TileMap -var tile_size = 32 -var room_num = 50 -var min_size = 10 -var max_size = 12 -var hspread = 600 -var cull = 0.7 -var path +var tile_size = 32 #rozmiar tile'a +var room_num = 50 #ilość pokoi (przed usunięciem) +var min_size = 10 #minimalny rozmiar pokoju +var max_size = 12 #max rozmiar pokoju +var cull = 0.7 #szansa na usunięcie pokoju podczas generacji +var path #zmienna przechowująca najkrótszą ścieżkę -var start_room = null -var end_room = null +var start_room = null #zmienna przechowująca początkowy pokój +var end_room = null #zmienna przechowująca końcowy pokój func _ready(): randomize() make_rooms() -func make_rooms(): +func make_rooms(): #tworzenie pokojów for i in range(room_num): var pos = Vector2(0, 0) var r = Room.instance() - var w = min_size + randi()%(max_size-min_size) - var h = min_size + randi()%(max_size-min_size) + var w = min_size + randi()%(max_size-min_size) #szerokość + var h = min_size + randi()%(max_size-min_size) #wysokość r.make_room(pos, Vector2(w,h) * tile_size) $Rooms.add_child(r) - yield(get_tree().create_timer(1.5),"timeout") #zatrzymuje funkcje i wykonuje w tym czasie przerwe + yield(get_tree().create_timer(2),"timeout") #zatrzymuje funkcje i wykonuje w tym czasie przerwe (inne rzeczy się dzieją w tym momencie) var room_positions = [] for room in $Rooms.get_children(): if randf() < cull: room.queue_free() else: - room.mode = RigidBody2D.MODE_STATIC + room.mode = RigidBody2D.MODE_STATIC #zmiana trybu kolizji pokoju na statyczny (żeby się nie poruszał więcej) room_positions.append(Vector3(room.position.x, - room.position.y, 0)) + room.position.y, 0)) #musi być Vector3 bo tego wymaga algorytm szykania najkrótszej drogi yield(get_tree(),"idle_frame") path = find_mst(room_positions) make_map() + func _process(delta): update() func _input(event): - if event.is_action_pressed("ui_select"): + if event.is_action_pressed("ui_select"): #naciśnięcie spacji - tworzenie nowej mapy for n in $Rooms.get_children(): n.queue_free() path = null make_rooms() - if event.is_action_pressed("ui_focus_next"): + if event.is_action_pressed("ui_focus_next"): #naciśnięcie tab - zmienienie korytarzy make_map() -func find_mst(nodes): #algorytm Prima - var path = AStar.new() +func find_mst(nodes): #szukanie najkrótszej drogi + var path = AStar.new() path.add_point(path.get_available_point_id(), nodes.pop_front()) while nodes: var min_dist = INF #minimalny dystans @@ -72,8 +72,11 @@ func find_mst(nodes): #algorytm Prima nodes.erase(min_p) return path -func make_map(): +func make_map(): #tworzenie mapy z dostępnych pokoi Map.clear() + find_start_room() + find_end_room() + $Player.position = start_room.position var full_rect = Rect2() for room in $Rooms.get_children(): var r = Rect2(room.position-room.size, @@ -81,8 +84,7 @@ func make_map(): full_rect = full_rect.merge(r) var topleft = Map.world_to_map(full_rect.position) var bottomright = Map.world_to_map(full_rect.end) - -# for x in range(topleft.x, bottomright.x): +# for x in range(topleft.x, bottomright.x): #ustawienie tła # for y in range(topleft.y, bottomright.y): # Map.set_cell(x,y,44) var corridors = [] @@ -90,21 +92,27 @@ func make_map(): var s = (room.size/tile_size).floor() var pos = Map.world_to_map(room.position) var ul = (room.position/tile_size).floor() - s - for x in range(2, s.x * 2 - 1): + for x in range(2, s.x * 2 - 1): #rysowanie pokoju for y in range(2, s.y * 2 - 1): Map.set_cell(ul.x + x, ul.y + y, 11) - for x in range(1, s.x * 2): + for x in range(1, s.x * 2): #rysowanie ścian pokoju if(Map.get_cell(ul.x + x, ul.y + 1) != 11): - Map.set_cell(ul.x + x, ul.y + 1, 44) + Map.set_cell(ul.x + x, ul.y + 1, 45) if(Map.get_cell(ul.x + x, ul.y + s.y * 2 - 1) != 11): - Map.set_cell(ul.x + x, ul.y + s.y * 2 - 1, 44) + Map.set_cell(ul.x + x, ul.y + s.y * 2 - 1, 60) for y in range(1, s.y * 2): if(Map.get_cell(ul.x + 1, ul.y + y) != 11): - Map.set_cell(ul.x + 1, ul.y + y, 47) + Map.set_cell(ul.x + 1, ul.y + y, 63) if(Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11): Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 47) + if y == 1: + Map.set_cell(ul.x + 1, ul.y + y, 35) + Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 46) + if y == s.y*2-1 : + Map.set_cell(ul.x + 1, ul.y + y, 62) + Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 51) var p = path.get_closest_point(Vector3(room.position.x, room.position.y, 0)) - for conn in path.get_point_connections(p): + for conn in path.get_point_connections(p): #szukanie połączeń if not conn in corridors: var start = Map.world_to_map(Vector2(path.get_point_position(p).x, path.get_point_position(p).y)) @@ -114,30 +122,89 @@ func make_map(): corridors.append(p) func carve_path(pos1, pos2): - var x_diff = sign(pos2.x - pos1.x) + var x_diff = sign(pos2.x - pos1.x) #różnica odległości pomiędzy pokojami var y_diff = sign(pos2.y - pos1.y) - if x_diff == 0: + if x_diff == 0: #jeżeli różnica jest równa 0, wylosuj różnicę -1 lub 1 x_diff = pow(-1.0, randi() % 2) if y_diff == 0: y_diff = pow(-1.0, randi() % 2) var x_y = pos1 - var y_x = pos2 + var y_x = pos2 if(randi()%2>0): x_y = pos2 y_x = pos1 - for x in range(pos1.x, pos2.x, x_diff): + for x in range(pos1.x, pos2.x, x_diff): #rysowanie korytarzy Map.set_cell(x, x_y.y, 11) - - for y in range(pos1.y, pos2.y, y_diff): + if (Map.get_cell(x, x_y.y+1) != 11 and Map.get_cell(x, x_y.y) == 11): + Map.set_cell(x, x_y.y + 1, 45) + if (Map.get_cell(x, x_y.y-1) != 11 and Map.get_cell(x, x_y.y) == 11): + Map.set_cell(x, x_y.y - 1, 60) + if x == pos1.x: + if (Map.get_cell(x+1, x_y.y) != 11): + Map.set_cell(x+1, x_y.y, 47) + if (Map.get_cell(x-1, x_y.y) != 11): + Map.set_cell(x-1, x_y.y, 63) + if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y+1) == 60 and #trzeba dobrze tile poustawiać i będzie działało + Map.get_cell(x+1, x_y.y) == 47): + Map.set_cell(x+1, x_y.y+1, 51) + if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y-1) == 45 and + Map.get_cell(x-1, x_y.y) == 63): + Map.set_cell(x-1, x_y.y-1, 35) + if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y-1) == 45 and + Map.get_cell(x+1, x_y.y) == 47): + Map.set_cell(x+1, x_y.y-1, 46) + if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y+1) == 60 and + Map.get_cell(x-1, x_y.y) == 63): + Map.set_cell(x-1, x_y.y+1, 62) + + for y in range(pos1.y, pos2.y, y_diff): #rysowanie korytarzy Map.set_cell(y_x.x, y, 11) + if (Map.get_cell(y_x.x+1, y) != 11 and Map.get_cell(y_x.x, y) == 11): + Map.set_cell(y_x.x+1, y, 47) + if (Map.get_cell(y_x.x-1, y) != 11 and Map.get_cell(y_x.x, y) == 11): + Map.set_cell(y_x.x-1, y, 63) + if y == pos1.y: + if (Map.get_cell(y_x.x, y+1) != 11): + Map.set_cell(y_x.x, y+1, 45) + if (Map.get_cell(y_x.x, y-1) != 11): + Map.set_cell(y_x.x, y-1, 60) + if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x+1, y) == 44 and + Map.get_cell(y_x.x, y+1) == 44): + Map.set_cell(y_x.x+1, y+1, 51) + if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x-1, y) == 44 and + Map.get_cell(y_x.x, y-1) == 44): + Map.set_cell(y_x.x-1, y-1, 35) + if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x+1, y) == 44 and + Map.get_cell(y_x.x, y-1) == 44): + Map.set_cell(y_x.x+1, y-1, 46) + if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x-1, y) == 44 and + Map.get_cell(y_x.x, y+1) == 44): + Map.set_cell(y_x.x-1, y+1, 62) +func find_start_room(): #szukanie pokoju startowego + var min_x = INF + for room in $Rooms.get_children(): + if room.position.x < min_x: + start_room = room + min_x = room.position.x + +func find_end_room(): #szukanie pokoju końcowego + var max_x = -INF + for room in $Rooms.get_children(): + if room.position.x > max_x: + end_room = room + max_x = room.position.x - for x in range(pos1.x - 1, pos2.x + 1, x_diff): - if (Map.get_cell(x, x_y.y+1) != 11): - Map.set_cell(x, x_y.y+1, 44) - if (Map.get_cell(x, x_y.y-1) != 11): - Map.set_cell(x, x_y.y-1, 44) - for y in range(pos1.y - 1, pos2.y + 1, y_diff): - if (Map.get_cell(y_x.x+1, y) != 11): - Map.set_cell(y_x.x+1, y, 44) - if (Map.get_cell(y_x.x-1, y) != 11): - Map.set_cell(y_x.x-1, y, 44) +func doors(): #stawianie drzwi (do dopracowania) + for room in $Rooms.get_children(): + var s = (room.size/tile_size).floor() + var pos = Map.world_to_map(room.position) + var ul = (room.position/tile_size).floor() - s + for x in range(1, s.x * 2): + if(Map.get_cell(ul.x + x - 1, ul.y + 1) == 43 and + Map.get_cell(ul.x + x + 1, ul.y + 1) == 43 and + Map.get_cell(ul.x + x, ul.y + 1) == 11): + Map.set_cell(ul.x + x, ul.y + 1, 9) + if(Map.get_cell(ul.x + x - 1, ul.y + s.y * 2 - 1 ) == 43 and + Map.get_cell(ul.x + x + 1, ul.y + s.y * 2 - 1 ) == 43 and + Map.get_cell(ul.x + x, ul.y + s.y * 2 - 1) == 11): + Map.set_cell(ul.x + x, ul.y + s.y * 2 - 1, 13) diff --git a/Scenes/Levels/Main.tscn b/Scenes/Levels/Main.tscn index 0f643b67..0c838904 100644 --- a/Scenes/Levels/Main.tscn +++ b/Scenes/Levels/Main.tscn @@ -77,8 +77,8 @@ rect_scale = Vector2( 2, 2 ) [node name="Player" parent="." instance=ExtResource( 2 )] z_index = 2 -collision_layer = 0 -collision_mask = 0 +collision_layer = 15 +collision_mask = 1 [node name="Weapons" parent="." instance=ExtResource( 4 )] diff --git a/Scenes/Levels/Room_new.tscn b/Scenes/Levels/Room_new.tscn index 1f6f6999..944a1d07 100644 --- a/Scenes/Levels/Room_new.tscn +++ b/Scenes/Levels/Room_new.tscn @@ -3,6 +3,8 @@ [ext_resource path="res://Scenes/Levels/Room.gd" type="Script" id=1] [node name="Room" type="RigidBody2D"] +collision_layer = 128 +collision_mask = 128 mode = 2 script = ExtResource( 1 ) diff --git a/Scenes/title_screen/TitleScreen.tscn b/Scenes/title_screen/TitleScreen.tscn index 3c13e931..1ef5b960 100644 --- a/Scenes/title_screen/TitleScreen.tscn +++ b/Scenes/title_screen/TitleScreen.tscn @@ -50,9 +50,6 @@ font_data = ExtResource( 5 ) anchor_right = 1.0 anchor_bottom = 1.0 script = ExtResource( 6 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="Background Decorations" type="Control" parent="."] margin_right = 1283.0 @@ -76,7 +73,7 @@ position = Vector2( 226.176, 732.406 ) scale = Vector2( 5.22092, 5.22092 ) frames = SubResource( 2 ) animation = "octoboss_menu" -frame = 12 +frame = 3 playing = true flip_h = true @@ -86,7 +83,7 @@ position = Vector2( 1198.72, 619.51 ) scale = Vector2( 9.61799, 9.61799 ) frames = SubResource( 6 ) animation = "pandoboss_menu" -frame = 7 +frame = 12 playing = true [node name="Menu" type="VBoxContainer" parent="."] From 6e5c2e9e37534d2d33ae8b6c1a2c754b956e7fe8 Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Fri, 11 Mar 2022 14:15:34 +0100 Subject: [PATCH 06/15] Funkcja stawiania drzwi --- Scenes/Levels/Level_gen.gd | 55 ++++++++++++++++++++++++---- Scenes/title_screen/TitleScreen.tscn | 4 +- 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd index 63d68063..836e3933 100644 --- a/Scenes/Levels/Level_gen.gd +++ b/Scenes/Levels/Level_gen.gd @@ -10,6 +10,8 @@ var min_size = 10 #minimalny rozmiar pokoju var max_size = 12 #max rozmiar pokoju var cull = 0.7 #szansa na usunięcie pokoju podczas generacji var path #zmienna przechowująca najkrótszą ścieżkę +var world_size_tl +var world_size_br var start_room = null #zmienna przechowująca początkowy pokój var end_room = null #zmienna przechowująca końcowy pokój @@ -18,6 +20,7 @@ func _ready(): randomize() make_rooms() + func make_rooms(): #tworzenie pokojów for i in range(room_num): var pos = Vector2(0, 0) @@ -38,6 +41,8 @@ func make_rooms(): #tworzenie pokojów yield(get_tree(),"idle_frame") path = find_mst(room_positions) make_map() + doors() +# global_tiles() func _process(delta): @@ -51,6 +56,7 @@ func _input(event): make_rooms() if event.is_action_pressed("ui_focus_next"): #naciśnięcie tab - zmienienie korytarzy make_map() + doors() func find_mst(nodes): #szukanie najkrótszej drogi var path = AStar.new() @@ -84,6 +90,8 @@ func make_map(): #tworzenie mapy z dostępnych pokoi full_rect = full_rect.merge(r) var topleft = Map.world_to_map(full_rect.position) var bottomright = Map.world_to_map(full_rect.end) + world_size_tl = topleft + world_size_br = bottomright # for x in range(topleft.x, bottomright.x): #ustawienie tła # for y in range(topleft.y, bottomright.y): # Map.set_cell(x,y,44) @@ -105,12 +113,29 @@ func make_map(): #tworzenie mapy z dostępnych pokoi Map.set_cell(ul.x + 1, ul.y + y, 63) if(Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11): Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 47) - if y == 1: + if y == 1 and Map.get_cell(ul.x + 1, ul.y + y) != 11 and Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11: Map.set_cell(ul.x + 1, ul.y + y, 35) Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 46) - if y == s.y*2-1 : + if y == s.y*2-1 and Map.get_cell(ul.x + 1, ul.y + y) != 11 and Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11: Map.set_cell(ul.x + 1, ul.y + y, 62) Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 51) + +# for x in range(1, s.x * 2): #rysowanie ścian pokoju +# if(Map.get_cell(ul.x + x, ul.y + 1) != 11): +# Map.set_cell(ul.x + x, ul.y + 1, 44) +# if(Map.get_cell(ul.x + x, ul.y + s.y * 2 - 1) != 11): +# Map.set_cell(ul.x + x, ul.y + s.y * 2 - 1, 44) +# for y in range(1, s.y * 2): +# if(Map.get_cell(ul.x + 1, ul.y + y) != 11): +# Map.set_cell(ul.x + 1, ul.y + y, 44) +# if(Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11): +# Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 44) +# if y == 1 and Map.get_cell(ul.x + 1, ul.y + y) != 11 and Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11: +# Map.set_cell(ul.x + 1, ul.y + y, 35) +# Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 46) +# if y == s.y*2-1 and Map.get_cell(ul.x + 1, ul.y + y) != 11 and Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11: +# Map.set_cell(ul.x + 1, ul.y + y, 62) +# Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 51) var p = path.get_closest_point(Vector3(room.position.x, room.position.y, 0)) for conn in path.get_point_connections(p): #szukanie połączeń if not conn in corridors: @@ -194,17 +219,31 @@ func find_end_room(): #szukanie pokoju końcowego end_room = room max_x = room.position.x -func doors(): #stawianie drzwi (do dopracowania) +func doors(): #stawianie drzwi for room in $Rooms.get_children(): var s = (room.size/tile_size).floor() var pos = Map.world_to_map(room.position) var ul = (room.position/tile_size).floor() - s - for x in range(1, s.x * 2): - if(Map.get_cell(ul.x + x - 1, ul.y + 1) == 43 and - Map.get_cell(ul.x + x + 1, ul.y + 1) == 43 and + for x in range(1, s.x * 2 + 1): + if(Map.get_cell(ul.x + x - 1, ul.y + 1) == 45 and + Map.get_cell(ul.x + x + 1, ul.y + 1) == 45 and Map.get_cell(ul.x + x, ul.y + 1) == 11): Map.set_cell(ul.x + x, ul.y + 1, 9) - if(Map.get_cell(ul.x + x - 1, ul.y + s.y * 2 - 1 ) == 43 and - Map.get_cell(ul.x + x + 1, ul.y + s.y * 2 - 1 ) == 43 and + if(Map.get_cell(ul.x + x - 1, ul.y + s.y * 2 - 1 ) == 60 and + Map.get_cell(ul.x + x + 1, ul.y + s.y * 2 - 1 ) == 60 and Map.get_cell(ul.x + x, ul.y + s.y * 2 - 1) == 11): Map.set_cell(ul.x + x, ul.y + s.y * 2 - 1, 13) + for y in range(1, s.y * 2 + 1): + if(Map.get_cell(ul.x + 1, ul.y + y - 1) == 63 and + Map.get_cell(ul.x + 1, ul.y + y + 1) == 63 and + Map.get_cell(ul.x + 1, ul.y + y) == 11): + Map.set_cell(ul.x + 1, ul.y + y, 1) + if(Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y - 1) == 47 and + Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y + 1) == 47 and + Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) == 11): + Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 5) + +func global_tiles(): #funkcja wykonująca się po wygenerowaniu całej mapy, będzie użyta do zmieniania rogów + for x in range(world_size_tl.x, world_size_br.x): + for y in range(world_size_tl.x, world_size_br.y): + Map.set_cell(x,y,1) diff --git a/Scenes/title_screen/TitleScreen.tscn b/Scenes/title_screen/TitleScreen.tscn index 1ef5b960..cc868a2c 100644 --- a/Scenes/title_screen/TitleScreen.tscn +++ b/Scenes/title_screen/TitleScreen.tscn @@ -73,7 +73,7 @@ position = Vector2( 226.176, 732.406 ) scale = Vector2( 5.22092, 5.22092 ) frames = SubResource( 2 ) animation = "octoboss_menu" -frame = 3 +frame = 1 playing = true flip_h = true @@ -83,7 +83,7 @@ position = Vector2( 1198.72, 619.51 ) scale = Vector2( 9.61799, 9.61799 ) frames = SubResource( 6 ) animation = "pandoboss_menu" -frame = 12 +frame = 9 playing = true [node name="Menu" type="VBoxContainer" parent="."] From 04ed74b3bd1cd988ff657ff4ca17e7f36059e638 Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Fri, 11 Mar 2022 15:06:08 +0100 Subject: [PATCH 07/15] =?UTF-8?q?Globalna=20funkcja=20zmieniaj=C4=85ca=20r?= =?UTF-8?q?ogi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nie nie działa na korytarze (nie wiem czemu) --- Scenes/Levels/Level_gen.gd | 89 +++++++++++++--------------- Scenes/title_screen/TitleScreen.tscn | 4 +- 2 files changed, 43 insertions(+), 50 deletions(-) diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd index 836e3933..a3af2ed0 100644 --- a/Scenes/Levels/Level_gen.gd +++ b/Scenes/Levels/Level_gen.gd @@ -20,7 +20,6 @@ func _ready(): randomize() make_rooms() - func make_rooms(): #tworzenie pokojów for i in range(room_num): var pos = Vector2(0, 0) @@ -41,9 +40,8 @@ func make_rooms(): #tworzenie pokojów yield(get_tree(),"idle_frame") path = find_mst(room_positions) make_map() + global_tiles() doors() -# global_tiles() - func _process(delta): update() @@ -56,6 +54,7 @@ func _input(event): make_rooms() if event.is_action_pressed("ui_focus_next"): #naciśnięcie tab - zmienienie korytarzy make_map() + global_tiles() doors() func find_mst(nodes): #szukanie najkrótszej drogi @@ -113,23 +112,6 @@ func make_map(): #tworzenie mapy z dostępnych pokoi Map.set_cell(ul.x + 1, ul.y + y, 63) if(Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11): Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 47) - if y == 1 and Map.get_cell(ul.x + 1, ul.y + y) != 11 and Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11: - Map.set_cell(ul.x + 1, ul.y + y, 35) - Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 46) - if y == s.y*2-1 and Map.get_cell(ul.x + 1, ul.y + y) != 11 and Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11: - Map.set_cell(ul.x + 1, ul.y + y, 62) - Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 51) - -# for x in range(1, s.x * 2): #rysowanie ścian pokoju -# if(Map.get_cell(ul.x + x, ul.y + 1) != 11): -# Map.set_cell(ul.x + x, ul.y + 1, 44) -# if(Map.get_cell(ul.x + x, ul.y + s.y * 2 - 1) != 11): -# Map.set_cell(ul.x + x, ul.y + s.y * 2 - 1, 44) -# for y in range(1, s.y * 2): -# if(Map.get_cell(ul.x + 1, ul.y + y) != 11): -# Map.set_cell(ul.x + 1, ul.y + y, 44) -# if(Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11): -# Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 44) # if y == 1 and Map.get_cell(ul.x + 1, ul.y + y) != 11 and Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11: # Map.set_cell(ul.x + 1, ul.y + y, 35) # Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 46) @@ -169,18 +151,18 @@ func carve_path(pos1, pos2): Map.set_cell(x+1, x_y.y, 47) if (Map.get_cell(x-1, x_y.y) != 11): Map.set_cell(x-1, x_y.y, 63) - if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y+1) == 60 and #trzeba dobrze tile poustawiać i będzie działało - Map.get_cell(x+1, x_y.y) == 47): - Map.set_cell(x+1, x_y.y+1, 51) - if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y-1) == 45 and - Map.get_cell(x-1, x_y.y) == 63): - Map.set_cell(x-1, x_y.y-1, 35) - if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y-1) == 45 and - Map.get_cell(x+1, x_y.y) == 47): - Map.set_cell(x+1, x_y.y-1, 46) - if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y+1) == 60 and - Map.get_cell(x-1, x_y.y) == 63): - Map.set_cell(x-1, x_y.y+1, 62) +# if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y+1) == 60 and #trzeba dobrze tile poustawiać i będzie działało +# Map.get_cell(x+1, x_y.y) == 47): +# Map.set_cell(x+1, x_y.y+1, 51) +# if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y-1) == 45 and +# Map.get_cell(x-1, x_y.y) == 63): +# Map.set_cell(x-1, x_y.y-1, 35) +# if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y-1) == 45 and +# Map.get_cell(x+1, x_y.y) == 47): +# Map.set_cell(x+1, x_y.y-1, 46) +# if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y+1) == 60 and +# Map.get_cell(x-1, x_y.y) == 63): +# Map.set_cell(x-1, x_y.y+1, 62) for y in range(pos1.y, pos2.y, y_diff): #rysowanie korytarzy Map.set_cell(y_x.x, y, 11) @@ -193,18 +175,18 @@ func carve_path(pos1, pos2): Map.set_cell(y_x.x, y+1, 45) if (Map.get_cell(y_x.x, y-1) != 11): Map.set_cell(y_x.x, y-1, 60) - if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x+1, y) == 44 and - Map.get_cell(y_x.x, y+1) == 44): - Map.set_cell(y_x.x+1, y+1, 51) - if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x-1, y) == 44 and - Map.get_cell(y_x.x, y-1) == 44): - Map.set_cell(y_x.x-1, y-1, 35) - if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x+1, y) == 44 and - Map.get_cell(y_x.x, y-1) == 44): - Map.set_cell(y_x.x+1, y-1, 46) - if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x-1, y) == 44 and - Map.get_cell(y_x.x, y+1) == 44): - Map.set_cell(y_x.x-1, y+1, 62) +# if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x+1, y) == 44 and +# Map.get_cell(y_x.x, y+1) == 44): +# Map.set_cell(y_x.x+1, y+1, 51) +# if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x-1, y) == 44 and +# Map.get_cell(y_x.x, y-1) == 44): +# Map.set_cell(y_x.x-1, y-1, 35) +# if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x+1, y) == 44 and +# Map.get_cell(y_x.x, y-1) == 44): +# Map.set_cell(y_x.x+1, y-1, 46) +# if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x-1, y) == 44 and +# Map.get_cell(y_x.x, y+1) == 44): +# Map.set_cell(y_x.x-1, y+1, 62) func find_start_room(): #szukanie pokoju startowego var min_x = INF for room in $Rooms.get_children(): @@ -219,7 +201,7 @@ func find_end_room(): #szukanie pokoju końcowego end_room = room max_x = room.position.x -func doors(): #stawianie drzwi +func doors(): #ustawianie drzwi for room in $Rooms.get_children(): var s = (room.size/tile_size).floor() var pos = Map.world_to_map(room.position) @@ -243,7 +225,18 @@ func doors(): #stawianie drzwi Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) == 11): Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 5) -func global_tiles(): #funkcja wykonująca się po wygenerowaniu całej mapy, będzie użyta do zmieniania rogów +func global_tiles(): #funkcja wykonująca się po wygenerowaniu całej mapy, nie działa na korytarz (why???) for x in range(world_size_tl.x, world_size_br.x): - for y in range(world_size_tl.x, world_size_br.y): - Map.set_cell(x,y,1) + for y in range(world_size_tl.y, world_size_br.y): + if (Map.get_cell(x + 1, y) == 45 and + Map.get_cell(x, y + 1) == 63): + Map.set_cell(x, y, 35) + if (Map.get_cell(x - 1, y) == 60 and + Map.get_cell(x, y - 1) == 47): + Map.set_cell(x, y, 51) + if (Map.get_cell(x + 1, y) == 60 and + Map.get_cell(x, y - 1) == 63): + Map.set_cell(x, y, 62) + if (Map.get_cell(x - 1, y) == 45 and + Map.get_cell(x, y + 1) == 47): + Map.set_cell(x, y, 46) diff --git a/Scenes/title_screen/TitleScreen.tscn b/Scenes/title_screen/TitleScreen.tscn index cc868a2c..55d138ee 100644 --- a/Scenes/title_screen/TitleScreen.tscn +++ b/Scenes/title_screen/TitleScreen.tscn @@ -73,7 +73,7 @@ position = Vector2( 226.176, 732.406 ) scale = Vector2( 5.22092, 5.22092 ) frames = SubResource( 2 ) animation = "octoboss_menu" -frame = 1 +frame = 4 playing = true flip_h = true @@ -83,7 +83,7 @@ position = Vector2( 1198.72, 619.51 ) scale = Vector2( 9.61799, 9.61799 ) frames = SubResource( 6 ) animation = "pandoboss_menu" -frame = 9 +frame = 6 playing = true [node name="Menu" type="VBoxContainer" parent="."] From 232309fdbca0c93ac3b1501cc1f16b1be6885ea2 Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Fri, 11 Mar 2022 17:09:04 +0100 Subject: [PATCH 08/15] =?UTF-8?q?Dzia=C5=82aj=C4=85ca=20funkcja=20zmiany?= =?UTF-8?q?=20rog=C3=B3w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scenes/Levels/Level_gen.gd | 29 ++++++++++++++++++++-------- Scenes/title_screen/TitleScreen.tscn | 3 +-- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd index a3af2ed0..98ee7532 100644 --- a/Scenes/Levels/Level_gen.gd +++ b/Scenes/Levels/Level_gen.gd @@ -5,10 +5,10 @@ var Player = preload("res://Scenes/Actors/Player.tscn") onready var Map = $TileMap var tile_size = 32 #rozmiar tile'a -var room_num = 50 #ilość pokoi (przed usunięciem) +var room_num = 30 #ilość pokoi (przed usunięciem) var min_size = 10 #minimalny rozmiar pokoju var max_size = 12 #max rozmiar pokoju -var cull = 0.7 #szansa na usunięcie pokoju podczas generacji +var cull = 0.5 #szansa na usunięcie pokoju podczas generacji var path #zmienna przechowująca najkrótszą ścieżkę var world_size_tl var world_size_br @@ -143,15 +143,15 @@ func carve_path(pos1, pos2): for x in range(pos1.x, pos2.x, x_diff): #rysowanie korytarzy Map.set_cell(x, x_y.y, 11) if (Map.get_cell(x, x_y.y+1) != 11 and Map.get_cell(x, x_y.y) == 11): - Map.set_cell(x, x_y.y + 1, 45) + Map.set_cell(x, x_y.y + 1, 60) if (Map.get_cell(x, x_y.y-1) != 11 and Map.get_cell(x, x_y.y) == 11): - Map.set_cell(x, x_y.y - 1, 60) + Map.set_cell(x, x_y.y - 1, 45) if x == pos1.x: if (Map.get_cell(x+1, x_y.y) != 11): Map.set_cell(x+1, x_y.y, 47) if (Map.get_cell(x-1, x_y.y) != 11): Map.set_cell(x-1, x_y.y, 63) -# if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y+1) == 60 and #trzeba dobrze tile poustawiać i będzie działało +# if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y+1) == 60 and # Map.get_cell(x+1, x_y.y) == 47): # Map.set_cell(x+1, x_y.y+1, 51) # if(Map.get_cell(x, x_y.y) == 11 and Map.get_cell(x, x_y.y-1) == 45 and @@ -172,9 +172,9 @@ func carve_path(pos1, pos2): Map.set_cell(y_x.x-1, y, 63) if y == pos1.y: if (Map.get_cell(y_x.x, y+1) != 11): - Map.set_cell(y_x.x, y+1, 45) + Map.set_cell(y_x.x, y+1, 60) if (Map.get_cell(y_x.x, y-1) != 11): - Map.set_cell(y_x.x, y-1, 60) + Map.set_cell(y_x.x, y-1, 45) # if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x+1, y) == 44 and # Map.get_cell(y_x.x, y+1) == 44): # Map.set_cell(y_x.x+1, y+1, 51) @@ -228,7 +228,7 @@ func doors(): #ustawianie drzwi func global_tiles(): #funkcja wykonująca się po wygenerowaniu całej mapy, nie działa na korytarz (why???) for x in range(world_size_tl.x, world_size_br.x): for y in range(world_size_tl.y, world_size_br.y): - if (Map.get_cell(x + 1, y) == 45 and + if (Map.get_cell(x + 1, y) == 45 and Map.get_cell(x, y + 1) == 63): Map.set_cell(x, y, 35) if (Map.get_cell(x - 1, y) == 60 and @@ -240,3 +240,16 @@ func global_tiles(): #funkcja wykonująca się po wygenerowaniu całej mapy, nie if (Map.get_cell(x - 1, y) == 45 and Map.get_cell(x, y + 1) == 47): Map.set_cell(x, y, 46) + + if (Map.get_cell(x + 1, y) == 60 and + Map.get_cell(x, y + 1) == 47): + Map.set_cell(x, y, 35) + if (Map.get_cell(x - 1, y) == 45 and + Map.get_cell(x, y - 1) == 63): + Map.set_cell(x, y, 51) + if (Map.get_cell(x + 1, y) == 45 and + Map.get_cell(x, y - 1) == 47): + Map.set_cell(x, y, 62) + if (Map.get_cell(x - 1, y) == 60 and + Map.get_cell(x, y + 1) == 63): + Map.set_cell(x, y, 46) diff --git a/Scenes/title_screen/TitleScreen.tscn b/Scenes/title_screen/TitleScreen.tscn index 55d138ee..062c7b89 100644 --- a/Scenes/title_screen/TitleScreen.tscn +++ b/Scenes/title_screen/TitleScreen.tscn @@ -73,7 +73,6 @@ position = Vector2( 226.176, 732.406 ) scale = Vector2( 5.22092, 5.22092 ) frames = SubResource( 2 ) animation = "octoboss_menu" -frame = 4 playing = true flip_h = true @@ -83,7 +82,7 @@ position = Vector2( 1198.72, 619.51 ) scale = Vector2( 9.61799, 9.61799 ) frames = SubResource( 6 ) animation = "pandoboss_menu" -frame = 6 +frame = 13 playing = true [node name="Menu" type="VBoxContainer" parent="."] From 17ce08bf3951979b98e496a49f7070671fb97f06 Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Sun, 13 Mar 2022 15:24:19 +0100 Subject: [PATCH 09/15] Korytarze co najmniej 2 kratki --- Scenes/Levels/Level_gen.gd | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd index 98ee7532..1bc573d1 100644 --- a/Scenes/Levels/Level_gen.gd +++ b/Scenes/Levels/Level_gen.gd @@ -99,19 +99,19 @@ func make_map(): #tworzenie mapy z dostępnych pokoi var s = (room.size/tile_size).floor() var pos = Map.world_to_map(room.position) var ul = (room.position/tile_size).floor() - s - for x in range(2, s.x * 2 - 1): #rysowanie pokoju - for y in range(2, s.y * 2 - 1): + for x in range(2, s.x * 2 - 2): #rysowanie pokoju + for y in range(2, s.y * 2 - 2): Map.set_cell(ul.x + x, ul.y + y, 11) - for x in range(1, s.x * 2): #rysowanie ścian pokoju + for x in range(1, s.x * 2-2): #rysowanie ścian pokoju if(Map.get_cell(ul.x + x, ul.y + 1) != 11): Map.set_cell(ul.x + x, ul.y + 1, 45) - if(Map.get_cell(ul.x + x, ul.y + s.y * 2 - 1) != 11): - Map.set_cell(ul.x + x, ul.y + s.y * 2 - 1, 60) - for y in range(1, s.y * 2): + if(Map.get_cell(ul.x + x, ul.y + s.y * 2 - 2) != 11): + Map.set_cell(ul.x + x, ul.y + s.y * 2 - 2, 60) + for y in range(1, s.y * 2-2): if(Map.get_cell(ul.x + 1, ul.y + y) != 11): Map.set_cell(ul.x + 1, ul.y + y, 63) - if(Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11): - Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 47) + if(Map.get_cell(ul.x + s.x * 2 - 2, ul.y + y) != 11): + Map.set_cell(ul.x + s.x * 2 - 2, ul.y + y, 47) # if y == 1 and Map.get_cell(ul.x + 1, ul.y + y) != 11 and Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) != 11: # Map.set_cell(ul.x + 1, ul.y + y, 35) # Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 46) From 93ccad97ca54e7b72c732ff2dca944a6a0c754b5 Mon Sep 17 00:00:00 2001 From: Marcin Bandos <80113567+marycin@users.noreply.github.com> Date: Mon, 14 Mar 2022 21:24:59 +0100 Subject: [PATCH 10/15] =?UTF-8?q?ko=C5=84cowe=20poprawki?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pierwotnie miałem jeszcze naprawić generacje korytarzy, ale po dłuższym teście poprawek naniesionych przez rema okazało się, że błąd został wyeliminowany. Zatem naniosłem tylko niezbędne poprawki. --- Scenes/Levels/Level_gen.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd index 1bc573d1..c6548693 100644 --- a/Scenes/Levels/Level_gen.gd +++ b/Scenes/Levels/Level_gen.gd @@ -225,7 +225,7 @@ func doors(): #ustawianie drzwi Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) == 11): Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 5) -func global_tiles(): #funkcja wykonująca się po wygenerowaniu całej mapy, nie działa na korytarz (why???) +func global_tiles(): #funkcja wykonująca się po wygenerowaniu całej mapy, pomocnicza do "zalepiania" rogów korytarzy i pokoi for x in range(world_size_tl.x, world_size_br.x): for y in range(world_size_tl.y, world_size_br.y): if (Map.get_cell(x + 1, y) == 45 and From 23c5cbf0b9dd993a598e09e3b13d17190351f526 Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Thu, 17 Mar 2022 14:29:17 +0100 Subject: [PATCH 11/15] Naprawa generacji MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stałe odległości pomiędzy pokojami, przez co nie ma błędów korytarzy, nie trzeba loading screena --- Scenes/Levels/Level_gen.gd | 25 +++++++++++++++++++++---- Scenes/Levels/Room.gd | 2 +- Scenes/Levels/Room_new.tscn | 4 ++-- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd index c6548693..c11b33d7 100644 --- a/Scenes/Levels/Level_gen.gd +++ b/Scenes/Levels/Level_gen.gd @@ -5,10 +5,10 @@ var Player = preload("res://Scenes/Actors/Player.tscn") onready var Map = $TileMap var tile_size = 32 #rozmiar tile'a -var room_num = 30 #ilość pokoi (przed usunięciem) +var room_num = 40 #ilość pokoi (przed usunięciem) var min_size = 10 #minimalny rozmiar pokoju var max_size = 12 #max rozmiar pokoju -var cull = 0.5 #szansa na usunięcie pokoju podczas generacji +var cull = 0.6 #szansa na usunięcie pokoju podczas generacji var path #zmienna przechowująca najkrótszą ścieżkę var world_size_tl var world_size_br @@ -16,19 +16,35 @@ var world_size_br var start_room = null #zmienna przechowująca początkowy pokój var end_room = null #zmienna przechowująca końcowy pokój +var rooms_pos = [] +var room_pos = Vector2(0,0) + +var x_1 = 0 +var y_1 = 0 + func _ready(): randomize() make_rooms() func make_rooms(): #tworzenie pokojów + room_pos = [] + for x in range(6): + for y in range(7): + room_pos = Vector2(x_1, y_1) + rooms_pos.append(room_pos) + y_1 += 1000 + y_1 = 0 + x_1 += 1000 + for i in range(room_num): - var pos = Vector2(0, 0) + var pos = rooms_pos[i] var r = Room.instance() var w = min_size + randi()%(max_size-min_size) #szerokość var h = min_size + randi()%(max_size-min_size) #wysokość r.make_room(pos, Vector2(w,h) * tile_size) $Rooms.add_child(r) - yield(get_tree().create_timer(2),"timeout") #zatrzymuje funkcje i wykonuje w tym czasie przerwe (inne rzeczy się dzieją w tym momencie) + + #yield(get_tree().create_timer(0.1),"timeout") #zatrzymuje funkcje i wykonuje w tym czasie przerwe (inne rzeczy się dzieją w tym momencie) var room_positions = [] for room in $Rooms.get_children(): if randf() < cull: @@ -52,6 +68,7 @@ func _input(event): n.queue_free() path = null make_rooms() + global_tiles() if event.is_action_pressed("ui_focus_next"): #naciśnięcie tab - zmienienie korytarzy make_map() global_tiles() diff --git a/Scenes/Levels/Room.gd b/Scenes/Levels/Room.gd index 474f0f95..45214789 100644 --- a/Scenes/Levels/Room.gd +++ b/Scenes/Levels/Room.gd @@ -6,6 +6,6 @@ func make_room(_pos, _size): position = _pos size = _size var s = RectangleShape2D.new() - s.custom_solver_bias = 0.75 +# s.custom_solver_bias = 0.75 s.extents = size $CollisionShape2D.shape = s diff --git a/Scenes/Levels/Room_new.tscn b/Scenes/Levels/Room_new.tscn index 944a1d07..91d0737b 100644 --- a/Scenes/Levels/Room_new.tscn +++ b/Scenes/Levels/Room_new.tscn @@ -3,8 +3,8 @@ [ext_resource path="res://Scenes/Levels/Room.gd" type="Script" id=1] [node name="Room" type="RigidBody2D"] -collision_layer = 128 -collision_mask = 128 +collision_layer = 0 +collision_mask = 0 mode = 2 script = ExtResource( 1 ) From 581a8e95cf4bf67442373f9ee58aea6fdcf28f09 Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Thu, 17 Mar 2022 14:43:49 +0100 Subject: [PATCH 12/15] Drobne poprawki, zatrzymanie muzyki z menu --- Scenes/Levels/Level_gen.gd | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd index c11b33d7..92b1ecdf 100644 --- a/Scenes/Levels/Level_gen.gd +++ b/Scenes/Levels/Level_gen.gd @@ -5,10 +5,10 @@ var Player = preload("res://Scenes/Actors/Player.tscn") onready var Map = $TileMap var tile_size = 32 #rozmiar tile'a -var room_num = 40 #ilość pokoi (przed usunięciem) +var room_num = 30 #ilość pokoi (przed usunięciem) var min_size = 10 #minimalny rozmiar pokoju -var max_size = 12 #max rozmiar pokoju -var cull = 0.6 #szansa na usunięcie pokoju podczas generacji +var max_size = 15 #max rozmiar pokoju +var cull = 0.5 #szansa na usunięcie pokoju podczas generacji var path #zmienna przechowująca najkrótszą ścieżkę var world_size_tl var world_size_br @@ -23,8 +23,10 @@ var x_1 = 0 var y_1 = 0 func _ready(): + MusicController.stop_music() #zapauzowanie muzyki z menu randomize() make_rooms() + func make_rooms(): #tworzenie pokojów room_pos = [] @@ -119,12 +121,12 @@ func make_map(): #tworzenie mapy z dostępnych pokoi for x in range(2, s.x * 2 - 2): #rysowanie pokoju for y in range(2, s.y * 2 - 2): Map.set_cell(ul.x + x, ul.y + y, 11) - for x in range(1, s.x * 2-2): #rysowanie ścian pokoju + for x in range(1, s.x * 2-1): #rysowanie ścian pokoju if(Map.get_cell(ul.x + x, ul.y + 1) != 11): Map.set_cell(ul.x + x, ul.y + 1, 45) if(Map.get_cell(ul.x + x, ul.y + s.y * 2 - 2) != 11): Map.set_cell(ul.x + x, ul.y + s.y * 2 - 2, 60) - for y in range(1, s.y * 2-2): + for y in range(1, s.y * 2-1): if(Map.get_cell(ul.x + 1, ul.y + y) != 11): Map.set_cell(ul.x + 1, ul.y + y, 63) if(Map.get_cell(ul.x + s.x * 2 - 2, ul.y + y) != 11): From 1923fc80102b12c0dce74c193376c27b360a7fdc Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Fri, 18 Mar 2022 15:25:45 +0100 Subject: [PATCH 13/15] Funkcja wstawiania drzwi --- Scenes/Levels/Camera.gd | 30 +++++++++--------- Scenes/Levels/Level_gen.gd | 65 ++++++++++++++++++++++++++++---------- 2 files changed, 64 insertions(+), 31 deletions(-) diff --git a/Scenes/Levels/Camera.gd b/Scenes/Levels/Camera.gd index 0d20d2c4..6e8db0a4 100644 --- a/Scenes/Levels/Camera.gd +++ b/Scenes/Levels/Camera.gd @@ -2,25 +2,25 @@ extends Camera2D #DO NAPRAWY -var grid_size = Vector2(512,288) #rozmiar kawałka siatki kamery -var grid_position = Vector2() +#var grid_size = Vector2(512,288) #rozmiar kawałka siatki kamery +#var grid_position = Vector2() onready var parent = get_parent() #Odwołanie do playera func _ready(): zoom.x = 1 #ustawienia zoom'a kamery zoom.y = 1 - set_as_toplevel(true) - update_grid_position() +# set_as_toplevel(true) +# update_grid_position() -func update_grid_position(): #sprawdzanie czy player wyszedł poza granice siatki, jeżeli tak to przełącza kamerę w nową pozycję - var x = round(parent.position.x / grid_size.x) - var y = round(parent.position.y / grid_size.y) - var new_grid_position = Vector2(x,y) - if grid_position == new_grid_position: - return - grid_position = new_grid_position - position = grid_position * grid_size - -func _physics_process(delta): - update_grid_position() +#func update_grid_position(): #sprawdzanie czy player wyszedł poza granice siatki, jeżeli tak to przełącza kamerę w nową pozycję +# var x = round(parent.position.x / grid_size.x) +# var y = round(parent.position.y / grid_size.y) +# var new_grid_position = Vector2(x,y) +# if grid_position == new_grid_position: +# return +# grid_position = new_grid_position +# position = grid_position * grid_size +# +#func _physics_process(delta): +# update_grid_position() diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd index 92b1ecdf..002c239f 100644 --- a/Scenes/Levels/Level_gen.gd +++ b/Scenes/Levels/Level_gen.gd @@ -6,9 +6,9 @@ onready var Map = $TileMap var tile_size = 32 #rozmiar tile'a var room_num = 30 #ilość pokoi (przed usunięciem) -var min_size = 10 #minimalny rozmiar pokoju +var min_size = 6 #minimalny rozmiar pokoju var max_size = 15 #max rozmiar pokoju -var cull = 0.5 #szansa na usunięcie pokoju podczas generacji +var cull = 0.4 #szansa na usunięcie pokoju podczas generacji var path #zmienna przechowująca najkrótszą ścieżkę var world_size_tl var world_size_br @@ -19,7 +19,7 @@ var end_room = null #zmienna przechowująca końcowy pokój var rooms_pos = [] var room_pos = Vector2(0,0) -var x_1 = 0 +var x_1 = 0 #zmienne pomocnicze do tworzenia pozycji pokoi var y_1 = 0 func _ready(): @@ -58,8 +58,8 @@ func make_rooms(): #tworzenie pokojów yield(get_tree(),"idle_frame") path = find_mst(room_positions) make_map() - global_tiles() doors() + global_tiles() func _process(delta): update() @@ -226,23 +226,55 @@ func doors(): #ustawianie drzwi var pos = Map.world_to_map(room.position) var ul = (room.position/tile_size).floor() - s for x in range(1, s.x * 2 + 1): - if(Map.get_cell(ul.x + x - 1, ul.y + 1) == 45 and - Map.get_cell(ul.x + x + 1, ul.y + 1) == 45 and + if(((Map.get_cell(ul.x + x - 1, ul.y + 1) == 45 and + Map.get_cell(ul.x + x + 1, ul.y + 1) == 45) or + (Map.get_cell(ul.x + x - 1, ul.y + 1) == 63 and + Map.get_cell(ul.x + x + 1, ul.y + 1) == 47)) and Map.get_cell(ul.x + x, ul.y + 1) == 11): + Map.set_cell(ul.x + x - 1, ul.y + 1, 8) + Map.set_cell(ul.x + x + 1, ul.y + 1, 10) Map.set_cell(ul.x + x, ul.y + 1, 9) - if(Map.get_cell(ul.x + x - 1, ul.y + s.y * 2 - 1 ) == 60 and - Map.get_cell(ul.x + x + 1, ul.y + s.y * 2 - 1 ) == 60 and - Map.get_cell(ul.x + x, ul.y + s.y * 2 - 1) == 11): - Map.set_cell(ul.x + x, ul.y + s.y * 2 - 1, 13) + + Map.set_cell(ul.x + x - 1, ul.y, 62) + Map.set_cell(ul.x + x + 1, ul.y, 51) + Map.set_cell(ul.x + x, ul.y, 13) + if(((Map.get_cell(ul.x + x - 1, ul.y + s.y * 2 - 2) == 60 and + Map.get_cell(ul.x + x + 1, ul.y + s.y * 2 - 2) == 60) or + (Map.get_cell(ul.x + x - 1, ul.y + s.y * 2 - 2) == 63 and + Map.get_cell(ul.x + x + 1, ul.y + s.y * 2 - 2) == 47)) and + Map.get_cell(ul.x + x, ul.y + s.y * 2 - 2) == 11): + Map.set_cell(ul.x + x-1, ul.y + s.y * 2 - 2, 12) + Map.set_cell(ul.x + x+1, ul.y + s.y * 2 - 2, 14) + Map.set_cell(ul.x + x, ul.y + s.y * 2 - 2, 13) + + Map.set_cell(ul.x + x-1, ul.y + s.y * 2 - 1, 35) + Map.set_cell(ul.x + x+1, ul.y + s.y * 2 - 1, 46) + Map.set_cell(ul.x + x, ul.y + s.y * 2 - 1, 9) for y in range(1, s.y * 2 + 1): - if(Map.get_cell(ul.x + 1, ul.y + y - 1) == 63 and - Map.get_cell(ul.x + 1, ul.y + y + 1) == 63 and + if(((Map.get_cell(ul.x + 1, ul.y + y - 1) == 63 and + Map.get_cell(ul.x + 1, ul.y + y + 1) == 63) or + (Map.get_cell(ul.x + 1, ul.y + y - 1) == 45 and + Map.get_cell(ul.x + 1, ul.y + y + 1) == 60)) and Map.get_cell(ul.x + 1, ul.y + y) == 11): + Map.set_cell(ul.x + 1, ul.y + y-1, 0) + Map.set_cell(ul.x + 1, ul.y + y+1, 2) Map.set_cell(ul.x + 1, ul.y + y, 1) - if(Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y - 1) == 47 and - Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y + 1) == 47 and - Map.get_cell(ul.x + s.x * 2 - 1, ul.y + y) == 11): - Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 5) + + Map.set_cell(ul.x, ul.y + y-1, 46) + Map.set_cell(ul.x, ul.y + y+1, 51) + Map.set_cell(ul.x, ul.y + y, 5) + if(((Map.get_cell(ul.x + s.x * 2 - 2, ul.y + y - 1) == 47 and + Map.get_cell(ul.x + s.x * 2 - 2, ul.y + y + 1) == 47) or + (Map.get_cell(ul.x + s.x * 2 - 2, ul.y + y - 1) == 45 and + Map.get_cell(ul.x + s.x * 2 - 2, ul.y + y + 1) == 60)) and + Map.get_cell(ul.x + s.x * 2 - 2, ul.y + y) == 11): + Map.set_cell(ul.x + s.x * 2 - 2, ul.y + y-1, 4) + Map.set_cell(ul.x + s.x * 2 - 2, ul.y + y+1, 6) + Map.set_cell(ul.x + s.x * 2 - 2, ul.y + y, 5) + + Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y-1, 35) + Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y+1, 62) + Map.set_cell(ul.x + s.x * 2 - 1, ul.y + y, 1) func global_tiles(): #funkcja wykonująca się po wygenerowaniu całej mapy, pomocnicza do "zalepiania" rogów korytarzy i pokoi for x in range(world_size_tl.x, world_size_br.x): @@ -260,6 +292,7 @@ func global_tiles(): #funkcja wykonująca się po wygenerowaniu całej mapy, pom Map.get_cell(x, y + 1) == 47): Map.set_cell(x, y, 46) + if (Map.get_cell(x + 1, y) == 60 and Map.get_cell(x, y + 1) == 47): Map.set_cell(x, y, 35) From f32f4d7b0237b25a1b34ef2f09ae17bcbca59957 Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Sat, 19 Mar 2022 15:27:43 +0100 Subject: [PATCH 14/15] =?UTF-8?q?Dodatkowe=20komentarze=20i=20poprawa=20wy?= =?UTF-8?q?pe=C5=82niania=20t=C5=82a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scenes/Levels/Camera.gd | 4 +-- Scenes/Levels/Level_gen.gd | 38 +++++++++++++++------------- Scenes/title_screen/TitleScreen.tscn | 1 + 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/Scenes/Levels/Camera.gd b/Scenes/Levels/Camera.gd index 6e8db0a4..0759e8d2 100644 --- a/Scenes/Levels/Camera.gd +++ b/Scenes/Levels/Camera.gd @@ -8,8 +8,8 @@ extends Camera2D onready var parent = get_parent() #Odwołanie do playera func _ready(): - zoom.x = 1 #ustawienia zoom'a kamery - zoom.y = 1 + zoom.x = 0.6 #ustawienia zoom'a kamery + zoom.y = 0.6 # set_as_toplevel(true) # update_grid_position() diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd index 002c239f..a3f11215 100644 --- a/Scenes/Levels/Level_gen.gd +++ b/Scenes/Levels/Level_gen.gd @@ -4,20 +4,21 @@ var Room = preload("res://Scenes/Levels/Room_new.tscn") var Player = preload("res://Scenes/Actors/Player.tscn") onready var Map = $TileMap + var tile_size = 32 #rozmiar tile'a var room_num = 30 #ilość pokoi (przed usunięciem) var min_size = 6 #minimalny rozmiar pokoju var max_size = 15 #max rozmiar pokoju var cull = 0.4 #szansa na usunięcie pokoju podczas generacji var path #zmienna przechowująca najkrótszą ścieżkę -var world_size_tl -var world_size_br +var world_size_tl #położenie lewego-górnego końca mapy +var world_size_br #położenie prawego-dolnego końca mapy var start_room = null #zmienna przechowująca początkowy pokój var end_room = null #zmienna przechowująca końcowy pokój -var rooms_pos = [] -var room_pos = Vector2(0,0) +var rooms_pos = [] #tablica przechowująca położenie pokoi +var room_pos = Vector2(0,0) #pozycja pokoju var x_1 = 0 #zmienne pomocnicze do tworzenia pozycji pokoi var y_1 = 0 @@ -26,19 +27,18 @@ func _ready(): MusicController.stop_music() #zapauzowanie muzyki z menu randomize() make_rooms() - func make_rooms(): #tworzenie pokojów room_pos = [] - for x in range(6): + for x in range(6): #ustalanie pozycji pokojów for y in range(7): room_pos = Vector2(x_1, y_1) rooms_pos.append(room_pos) - y_1 += 1000 + y_1 += 1000 #odległość między pokojami y_1 = 0 x_1 += 1000 - for i in range(room_num): + for i in range(room_num): #ustalanie wielkości pokoju var pos = rooms_pos[i] var r = Room.instance() var w = min_size + randi()%(max_size-min_size) #szerokość @@ -46,9 +46,8 @@ func make_rooms(): #tworzenie pokojów r.make_room(pos, Vector2(w,h) * tile_size) $Rooms.add_child(r) - #yield(get_tree().create_timer(0.1),"timeout") #zatrzymuje funkcje i wykonuje w tym czasie przerwe (inne rzeczy się dzieją w tym momencie) var room_positions = [] - for room in $Rooms.get_children(): + for room in $Rooms.get_children(): #usuwanie pokojów (żeby wyglądało bardziej na randomowe XD) if randf() < cull: room.queue_free() else: @@ -110,8 +109,8 @@ func make_map(): #tworzenie mapy z dostępnych pokoi var bottomright = Map.world_to_map(full_rect.end) world_size_tl = topleft world_size_br = bottomright -# for x in range(topleft.x, bottomright.x): #ustawienie tła -# for y in range(topleft.y, bottomright.y): +# for x in range(topleft.x - 10, bottomright.x + 10): #ustawienie tła +# for y in range(topleft.y - 10, bottomright.y + 10): # Map.set_cell(x,y,44) var corridors = [] for room in $Rooms.get_children(): @@ -206,6 +205,7 @@ func carve_path(pos1, pos2): # if (Map.get_cell(y_x.x, y) == 11 and Map.get_cell(y_x.x-1, y) == 44 and # Map.get_cell(y_x.x, y+1) == 44): # Map.set_cell(y_x.x-1, y+1, 62) + func find_start_room(): #szukanie pokoju startowego var min_x = INF for room in $Rooms.get_children(): @@ -225,8 +225,8 @@ func doors(): #ustawianie drzwi var s = (room.size/tile_size).floor() var pos = Map.world_to_map(room.position) var ul = (room.position/tile_size).floor() - s - for x in range(1, s.x * 2 + 1): - if(((Map.get_cell(ul.x + x - 1, ul.y + 1) == 45 and + for x in range(1, s.x * 2 + 1): + if(((Map.get_cell(ul.x + x - 1, ul.y + 1) == 45 and #górne drzwi Map.get_cell(ul.x + x + 1, ul.y + 1) == 45) or (Map.get_cell(ul.x + x - 1, ul.y + 1) == 63 and Map.get_cell(ul.x + x + 1, ul.y + 1) == 47)) and @@ -238,7 +238,8 @@ func doors(): #ustawianie drzwi Map.set_cell(ul.x + x - 1, ul.y, 62) Map.set_cell(ul.x + x + 1, ul.y, 51) Map.set_cell(ul.x + x, ul.y, 13) - if(((Map.get_cell(ul.x + x - 1, ul.y + s.y * 2 - 2) == 60 and + + if(((Map.get_cell(ul.x + x - 1, ul.y + s.y * 2 - 2) == 60 and #dolne drzwi Map.get_cell(ul.x + x + 1, ul.y + s.y * 2 - 2) == 60) or (Map.get_cell(ul.x + x - 1, ul.y + s.y * 2 - 2) == 63 and Map.get_cell(ul.x + x + 1, ul.y + s.y * 2 - 2) == 47)) and @@ -250,8 +251,9 @@ func doors(): #ustawianie drzwi Map.set_cell(ul.x + x-1, ul.y + s.y * 2 - 1, 35) Map.set_cell(ul.x + x+1, ul.y + s.y * 2 - 1, 46) Map.set_cell(ul.x + x, ul.y + s.y * 2 - 1, 9) + for y in range(1, s.y * 2 + 1): - if(((Map.get_cell(ul.x + 1, ul.y + y - 1) == 63 and + if(((Map.get_cell(ul.x + 1, ul.y + y - 1) == 63 and #lewe drzwi Map.get_cell(ul.x + 1, ul.y + y + 1) == 63) or (Map.get_cell(ul.x + 1, ul.y + y - 1) == 45 and Map.get_cell(ul.x + 1, ul.y + y + 1) == 60)) and @@ -263,7 +265,8 @@ func doors(): #ustawianie drzwi Map.set_cell(ul.x, ul.y + y-1, 46) Map.set_cell(ul.x, ul.y + y+1, 51) Map.set_cell(ul.x, ul.y + y, 5) - if(((Map.get_cell(ul.x + s.x * 2 - 2, ul.y + y - 1) == 47 and + + if(((Map.get_cell(ul.x + s.x * 2 - 2, ul.y + y - 1) == 47 and #prawe drzwi Map.get_cell(ul.x + s.x * 2 - 2, ul.y + y + 1) == 47) or (Map.get_cell(ul.x + s.x * 2 - 2, ul.y + y - 1) == 45 and Map.get_cell(ul.x + s.x * 2 - 2, ul.y + y + 1) == 60)) and @@ -292,7 +295,6 @@ func global_tiles(): #funkcja wykonująca się po wygenerowaniu całej mapy, pom Map.get_cell(x, y + 1) == 47): Map.set_cell(x, y, 46) - if (Map.get_cell(x + 1, y) == 60 and Map.get_cell(x, y + 1) == 47): Map.set_cell(x, y, 35) diff --git a/Scenes/title_screen/TitleScreen.tscn b/Scenes/title_screen/TitleScreen.tscn index 062c7b89..372922a8 100644 --- a/Scenes/title_screen/TitleScreen.tscn +++ b/Scenes/title_screen/TitleScreen.tscn @@ -73,6 +73,7 @@ position = Vector2( 226.176, 732.406 ) scale = Vector2( 5.22092, 5.22092 ) frames = SubResource( 2 ) animation = "octoboss_menu" +frame = 8 playing = true flip_h = true From ed1737c279071f11c18db16a55739df651119c6a Mon Sep 17 00:00:00 2001 From: Mixu285 Date: Sun, 27 Mar 2022 15:34:19 +0200 Subject: [PATCH 15/15] =?UTF-8?q?Okluzja,=20spawn=20przeciwnik=C3=B3w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dodanie okluzji do tiles'ów, kawałek przerabiania skryptu do spawnowania przeciwników, funkcja zamykająca drzwi --- Assets/TileMap/Room1.tres | 82 +++++++++++++++++++++++++++- Scenes/Actors/Player.tscn | 2 + Scenes/Levels/Enemies.gd | 34 ++++++++++++ Scenes/Levels/Level_gen.gd | 20 ++++++- Scenes/Levels/Room_new.tscn | 6 +- Scenes/title_screen/TitleScreen.tscn | 4 +- 6 files changed, 141 insertions(+), 7 deletions(-) create mode 100644 Scenes/Levels/Enemies.gd diff --git a/Assets/TileMap/Room1.tres b/Assets/TileMap/Room1.tres index 5f2b96bd..8239e6ac 100644 --- a/Assets/TileMap/Room1.tres +++ b/Assets/TileMap/Room1.tres @@ -1,34 +1,55 @@ -[gd_resource type="TileSet" load_steps=56 format=2] +[gd_resource type="TileSet" load_steps=76 format=2] [ext_resource path="res://Assets/TileMap/Room1.png" type="Texture" id=1] +[sub_resource type="OccluderPolygon2D" id=63] +polygon = PoolVector2Array( 2.18792, 0.0779419, 0, 0, 0, 32, 1.8003, 32 ) + [sub_resource type="ConvexPolygonShape2D" id=1] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=64] +polygon = PoolVector2Array( 32, 1.95141, 0, 1.95141, 0, 0, 32, 0 ) + [sub_resource type="ConvexPolygonShape2D" id=2] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=65] +polygon = PoolVector2Array( 0, 30.1088, 32, 30.1088, 32, 32, 0, 32 ) + [sub_resource type="ConvexPolygonShape2D" id=3] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=66] +polygon = PoolVector2Array( 32, 32, 32, 30.1088, 0, 30.1088, 0, 32 ) + [sub_resource type="ConvexPolygonShape2D" id=4] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=5] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=71] +polygon = PoolVector2Array( 0, 0, 1.87566, 0, 2.01025, 32, 0, 32 ) + [sub_resource type="ConvexPolygonShape2D" id=6] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=7] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=67] +polygon = PoolVector2Array( 1.99412, 0, 1.8003, 32, 0, 32, 0, 0 ) + [sub_resource type="ConvexPolygonShape2D" id=8] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=9] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=72] +polygon = PoolVector2Array( 29.9064, 0, 32, 0, 32, 32, 30.041, 32 ) + [sub_resource type="ConvexPolygonShape2D" id=10] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) @@ -38,6 +59,9 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=12] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=73] +polygon = PoolVector2Array( 0, 1.90416, 32, 1.90416, 32, 0, 0, 0 ) + [sub_resource type="ConvexPolygonShape2D" id=13] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) @@ -47,6 +71,9 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=15] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=74] +polygon = PoolVector2Array( 0, 29.9942, 32, 29.9942, 32, 32, 0, 32 ) + [sub_resource type="ConvexPolygonShape2D" id=16] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) @@ -59,6 +86,9 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=19] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=58] +polygon = PoolVector2Array( 1.80838, 32, 2.07755, 1.84373, 32, 1.84373, 32, 0, 0, 0, 0, 32 ) + [sub_resource type="ConvexPolygonShape2D" id=20] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) @@ -74,6 +104,9 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=24] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=68] +polygon = PoolVector2Array( 30.0304, 0, 32, 0, 32, 32, 30.2242, 31.8622 ) + [sub_resource type="ConvexPolygonShape2D" id=25] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) @@ -92,12 +125,21 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=30] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=55] +polygon = PoolVector2Array( 0, 0, 32, 0, 32, 1.94296, 0, 1.94296 ) + [sub_resource type="ConvexPolygonShape2D" id=31] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=57] +polygon = PoolVector2Array( 30.1779, 32, 32, 32, 32, 0, 0, 0, 0, 1.90932, 29.9088, 1.90932 ) + [sub_resource type="ConvexPolygonShape2D" id=32] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=59] +polygon = PoolVector2Array( 30.0433, 0, 32, 0, 32, 32, 30.1779, 32 ) + [sub_resource type="ConvexPolygonShape2D" id=33] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) @@ -110,6 +152,9 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=36] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=60] +polygon = PoolVector2Array( 30.0486, 0, 32, 0, 32, 32, 0, 32, 0, 29.9842, 30.0486, 29.9842 ) + [sub_resource type="ConvexPolygonShape2D" id=37] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) @@ -137,18 +182,30 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=45] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=69] +polygon = PoolVector2Array( 30.0304, 0, 32, 0, 32, 32, 30.2242, 31.8427 ) + [sub_resource type="ConvexPolygonShape2D" id=46] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=56] +polygon = PoolVector2Array( 32, 32, 0, 32, 0, 29.9153, 32, 29.7807 ) + [sub_resource type="ConvexPolygonShape2D" id=47] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) [sub_resource type="ConvexPolygonShape2D" id=48] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=61] +polygon = PoolVector2Array( 32, 29.8143, 32, 32, 0, 32, 0, 0, 1.97488, 0, 1.97488, 29.9489 ) + [sub_resource type="ConvexPolygonShape2D" id=49] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) +[sub_resource type="OccluderPolygon2D" id=62] +polygon = PoolVector2Array( 2.1095, 0, 1.8403, 32, 0, 32, 0, 0 ) + [sub_resource type="ConvexPolygonShape2D" id=50] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) @@ -161,6 +218,9 @@ points = PoolVector2Array( 16, 0, 32, 0, 29.8779, 0, 16.0203, 0 ) [sub_resource type="ConvexPolygonShape2D" id=53] points = PoolVector2Array( 0, 0, 16, 0, 15.954, 0, 0, 0 ) +[sub_resource type="OccluderPolygon2D" id=70] +polygon = PoolVector2Array( 0, 0.0133438, 32, 0, 32, 1.7899, 0, 1.7899 ) + [sub_resource type="ConvexPolygonShape2D" id=54] points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) @@ -172,6 +232,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 0/region = Rect2( 32, 0, 32, 32 ) 0/tile_mode = 0 0/occluder_offset = Vector2( 0, 0 ) +0/occluder = SubResource( 63 ) 0/navigation_offset = Vector2( 0, 0 ) 0/shape_offset = Vector2( 0, 0 ) 0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -207,6 +268,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 2/region = Rect2( 32, 64, 32, 32 ) 2/tile_mode = 0 2/occluder_offset = Vector2( 0, 0 ) +2/occluder = SubResource( 67 ) 2/navigation_offset = Vector2( 0, 0 ) 2/shape_offset = Vector2( 0, 0 ) 2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -242,6 +304,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 4/region = Rect2( 128, 0, 32, 32 ) 4/tile_mode = 0 4/occluder_offset = Vector2( 0, 0 ) +4/occluder = SubResource( 68 ) 4/navigation_offset = Vector2( 0, 0 ) 4/shape_offset = Vector2( 0, 0 ) 4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -277,6 +340,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 6/region = Rect2( 128, 64, 32, 32 ) 6/tile_mode = 0 6/occluder_offset = Vector2( 0, 0 ) +6/occluder = SubResource( 69 ) 6/navigation_offset = Vector2( 0, 0 ) 6/shape_offset = Vector2( 0, 0 ) 6/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -312,6 +376,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 8/region = Rect2( 192, 0, 32, 32 ) 8/tile_mode = 0 8/occluder_offset = Vector2( 0, 0 ) +8/occluder = SubResource( 70 ) 8/navigation_offset = Vector2( 0, 0 ) 8/shape_offset = Vector2( 0, 0 ) 8/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -347,6 +412,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 10/region = Rect2( 256, 0, 32, 32 ) 10/tile_mode = 0 10/occluder_offset = Vector2( 0, 0 ) +10/occluder = SubResource( 64 ) 10/navigation_offset = Vector2( 0, 0 ) 10/shape_offset = Vector2( 0, 0 ) 10/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -382,6 +448,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 12/region = Rect2( 192, 96, 32, 32 ) 12/tile_mode = 0 12/occluder_offset = Vector2( 0, 0 ) +12/occluder = SubResource( 65 ) 12/navigation_offset = Vector2( 0, 0 ) 12/shape_offset = Vector2( 0, 0 ) 12/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -417,6 +484,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 14/region = Rect2( 256, 96, 32, 32 ) 14/tile_mode = 0 14/occluder_offset = Vector2( 0, 0 ) +14/occluder = SubResource( 66 ) 14/navigation_offset = Vector2( 0, 0 ) 14/shape_offset = Vector2( 0, 0 ) 14/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -473,6 +541,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 17/region = Rect2( 32, 128, 32, 32 ) 17/tile_mode = 0 17/occluder_offset = Vector2( 0, 0 ) +17/occluder = SubResource( 71 ) 17/navigation_offset = Vector2( 0, 0 ) 17/shape_offset = Vector2( 0, 0 ) 17/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -550,6 +619,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 21/region = Rect2( 128, 128, 32, 32 ) 21/tile_mode = 0 21/occluder_offset = Vector2( 0, 0 ) +21/occluder = SubResource( 72 ) 21/navigation_offset = Vector2( 0, 0 ) 21/shape_offset = Vector2( 0, 0 ) 21/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -627,6 +697,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 25/region = Rect2( 224, 128, 32, 32 ) 25/tile_mode = 0 25/occluder_offset = Vector2( 0, 0 ) +25/occluder = SubResource( 73 ) 25/navigation_offset = Vector2( 0, 0 ) 25/shape_offset = Vector2( 0, 0 ) 25/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -704,6 +775,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 29/region = Rect2( 224, 224, 32, 32 ) 29/tile_mode = 0 29/occluder_offset = Vector2( 0, 0 ) +29/occluder = SubResource( 74 ) 29/navigation_offset = Vector2( 0, 0 ) 29/shape_offset = Vector2( 0, 0 ) 29/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -816,6 +888,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 35/region = Rect2( 288, 0, 32, 32 ) 35/tile_mode = 0 35/occluder_offset = Vector2( 0, 0 ) +35/occluder = SubResource( 58 ) 35/navigation_offset = Vector2( 0, 0 ) 35/shape_offset = Vector2( 0, 0 ) 35/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -1026,6 +1099,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 45/region = Rect2( 448, 32, 32, 32 ) 45/tile_mode = 0 45/occluder_offset = Vector2( 0, 0 ) +45/occluder = SubResource( 55 ) 45/navigation_offset = Vector2( 0, 0 ) 45/shape_offset = Vector2( 0, 0 ) 45/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -1047,6 +1121,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 46/region = Rect2( 480, 32, 32, 32 ) 46/tile_mode = 0 46/occluder_offset = Vector2( 0, 0 ) +46/occluder = SubResource( 57 ) 46/navigation_offset = Vector2( 0, 0 ) 46/shape_offset = Vector2( 0, 0 ) 46/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -1068,6 +1143,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 47/region = Rect2( 480, 64, 32, 32 ) 47/tile_mode = 0 47/occluder_offset = Vector2( 0, 0 ) +47/occluder = SubResource( 59 ) 47/navigation_offset = Vector2( 0, 0 ) 47/shape_offset = Vector2( 0, 0 ) 47/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -1152,6 +1228,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 51/region = Rect2( 512, 160, 32, 32 ) 51/tile_mode = 0 51/occluder_offset = Vector2( 0, 0 ) +51/occluder = SubResource( 60 ) 51/navigation_offset = Vector2( 0, 0 ) 51/shape_offset = Vector2( 0, 0 ) 51/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -1341,6 +1418,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 60/region = Rect2( 384, 128, 32, 32 ) 60/tile_mode = 0 60/occluder_offset = Vector2( 0, 0 ) +60/occluder = SubResource( 56 ) 60/navigation_offset = Vector2( 0, 0 ) 60/shape_offset = Vector2( 0, 0 ) 60/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -1383,6 +1461,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 62/region = Rect2( 320, 128, 32, 32 ) 62/tile_mode = 0 62/occluder_offset = Vector2( 0, 0 ) +62/occluder = SubResource( 61 ) 62/navigation_offset = Vector2( 0, 0 ) 62/shape_offset = Vector2( 0, 0 ) 62/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) @@ -1404,6 +1483,7 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) 63/region = Rect2( 320, 96, 32, 32 ) 63/tile_mode = 0 63/occluder_offset = Vector2( 0, 0 ) +63/occluder = SubResource( 62 ) 63/navigation_offset = Vector2( 0, 0 ) 63/shape_offset = Vector2( 0, 0 ) 63/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) diff --git a/Scenes/Actors/Player.tscn b/Scenes/Actors/Player.tscn index f9c8c9f4..4fd5317d 100644 --- a/Scenes/Actors/Player.tscn +++ b/Scenes/Actors/Player.tscn @@ -309,6 +309,8 @@ light_mask = 4 [node name="Light2D" parent="." instance=ExtResource( 7 )] color = Color( 1, 0.964706, 0.686275, 1 ) +shadow_filter = 4 +shadow_filter_smooth = 8.0 shadow_item_cull_mask = 1 [node name="CoolDownS1" type="Timer" parent="."] diff --git a/Scenes/Levels/Enemies.gd b/Scenes/Levels/Enemies.gd new file mode 100644 index 00000000..1d665a3e --- /dev/null +++ b/Scenes/Levels/Enemies.gd @@ -0,0 +1,34 @@ +extends Node + +onready var all_weapons = get_tree().get_root().find_node("Weapons", true, false).all_weapons #Wczytanie z niewidzialnego node wszystkich broni +var level = load("res://Scenes/Levels/Level_gen.gd").new() +var all_enemies = { + 0 : preload("res://Scenes/Actors/Big Devil.tscn"), + 1 : preload("res://Scenes/Actors/cuck.tscn"), + 2 : preload("res://Scenes/Actors/cuckshooter.tscn"), + 3 : preload("res://Scenes/Actors/goblin_shaman.tscn"), + 4 : preload("res://Scenes/Actors/Lil Devil.tscn"), + 5 : preload("res://Scenes/Actors/Little_Goblin.tscn"), + 6 : preload("res://Scenes/Actors/Potato.tscn"), + 7 : preload("res://Scenes/Actors/Slime.tscn"), + 8 : preload("res://Scenes/Actors/Snot.tscn"), + 9 : preload("res://Scenes/Actors/Orc.tscn"), + } +var bossScene = [load("res://Scenes/Actors/MageBoss/MageBoss.tscn"), + load("res://Scenes/Actors/PandoBoss/PandaBoss.tscn"), + load("res://Scenes/Actors/OctoBoss/OctoBoss.tscn")] +var id_list = [] #Lista ID pokojów, w których był już player +var current_id #ID aktualnego pokoju +var ilosc_enemy #aktualna ilosc przeciwnikow +var boss = false #czy to jest pokoj z bossem +var item +var popups = {} +onready var main := get_tree().get_root().find_node("Main", true, false) +onready var generation = get_node("../../../Main") #pobranie maina + +func _ready(): + pass # Replace with function body. + +func close_door(): + $level_node.close_door() + diff --git a/Scenes/Levels/Level_gen.gd b/Scenes/Levels/Level_gen.gd index a3f11215..a88b20bf 100644 --- a/Scenes/Levels/Level_gen.gd +++ b/Scenes/Levels/Level_gen.gd @@ -4,6 +4,7 @@ var Room = preload("res://Scenes/Levels/Room_new.tscn") var Player = preload("res://Scenes/Actors/Player.tscn") onready var Map = $TileMap +signal boss(boss_room) var tile_size = 32 #rozmiar tile'a var room_num = 30 #ilość pokoi (przed usunięciem) @@ -109,9 +110,9 @@ func make_map(): #tworzenie mapy z dostępnych pokoi var bottomright = Map.world_to_map(full_rect.end) world_size_tl = topleft world_size_br = bottomright -# for x in range(topleft.x - 10, bottomright.x + 10): #ustawienie tła -# for y in range(topleft.y - 10, bottomright.y + 10): -# Map.set_cell(x,y,44) + for x in range(topleft.x - 10, bottomright.x + 10): #ustawienie tła + for y in range(topleft.y - 10, bottomright.y + 10): + Map.set_cell(x,y,44) var corridors = [] for room in $Rooms.get_children(): var s = (room.size/tile_size).floor() @@ -219,6 +220,7 @@ func find_end_room(): #szukanie pokoju końcowego if room.position.x > max_x: end_room = room max_x = room.position.x + emit_signal("boss", end_room) func doors(): #ustawianie drzwi for room in $Rooms.get_children(): @@ -307,3 +309,15 @@ func global_tiles(): #funkcja wykonująca się po wygenerowaniu całej mapy, pom if (Map.get_cell(x - 1, y) == 60 and Map.get_cell(x, y + 1) == 63): Map.set_cell(x, y, 46) + +func close_door(): + for x in range(world_size_tl.x, world_size_br.x): + for y in range(world_size_tl.y, world_size_br.y): + if(Map.get_cell(x,y) == 9): + Map.set_cell(x,y,25) + if(Map.get_cell(x,y) == 13): + Map.set_cell(x,y,29) + if(Map.get_cell(x,y) == 1): + Map.set_cell(x,y,17) + if(Map.get_cell(x,y) == 5): + Map.set_cell(x,y,21) diff --git a/Scenes/Levels/Room_new.tscn b/Scenes/Levels/Room_new.tscn index 91d0737b..f3ca42ff 100644 --- a/Scenes/Levels/Room_new.tscn +++ b/Scenes/Levels/Room_new.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://Scenes/Levels/Room.gd" type="Script" id=1] +[ext_resource path="res://Scenes/Levels/Enemies.gd" type="Script" id=2] [node name="Room" type="RigidBody2D"] collision_layer = 0 @@ -9,3 +10,6 @@ mode = 2 script = ExtResource( 1 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="."] + +[node name="Enemies" type="Node2D" parent="."] +script = ExtResource( 2 ) diff --git a/Scenes/title_screen/TitleScreen.tscn b/Scenes/title_screen/TitleScreen.tscn index 372922a8..8a0d7dd6 100644 --- a/Scenes/title_screen/TitleScreen.tscn +++ b/Scenes/title_screen/TitleScreen.tscn @@ -73,7 +73,7 @@ position = Vector2( 226.176, 732.406 ) scale = Vector2( 5.22092, 5.22092 ) frames = SubResource( 2 ) animation = "octoboss_menu" -frame = 8 +frame = 7 playing = true flip_h = true @@ -83,7 +83,7 @@ position = Vector2( 1198.72, 619.51 ) scale = Vector2( 9.61799, 9.61799 ) frames = SubResource( 6 ) animation = "pandoboss_menu" -frame = 13 +frame = 4 playing = true [node name="Menu" type="VBoxContainer" parent="."]