diff --git a/.gitignore b/.gitignore index 0af181c..382b80a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ # Godot 4+ specific ignores .godot/ /android/ +/[Bb]uilds/ diff --git a/Assets/Fonts/MintsodaLimeGreen13X16Regular-KVvzA.ttf b/Assets/Fonts/MintsodaLimeGreen13X16Regular-KVvzA.ttf new file mode 100644 index 0000000..1701b91 Binary files /dev/null and b/Assets/Fonts/MintsodaLimeGreen13X16Regular-KVvzA.ttf differ diff --git a/Assets/Fonts/MintsodaLimeGreen13X16Regular-KVvzA.ttf.import b/Assets/Fonts/MintsodaLimeGreen13X16Regular-KVvzA.ttf.import new file mode 100644 index 0000000..5c81a88 --- /dev/null +++ b/Assets/Fonts/MintsodaLimeGreen13X16Regular-KVvzA.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://b8lsp07ucxq6p" +path="res://.godot/imported/MintsodaLimeGreen13X16Regular-KVvzA.ttf-b52548e3b00b42a0e0269a48cb6fa33e.fontdata" + +[deps] + +source_file="res://Assets/Fonts/MintsodaLimeGreen13X16Regular-KVvzA.ttf" +dest_files=["res://.godot/imported/MintsodaLimeGreen13X16Regular-KVvzA.ttf-b52548e3b00b42a0e0269a48cb6fa33e.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=1 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Assets/Sounds/Music/8bit-mysterious-kyouto_reverb_Loop.ogg b/Assets/Sounds/Music/8bit-mysterious-kyouto_reverb_Loop.ogg new file mode 100644 index 0000000..bfcbc80 Binary files /dev/null and b/Assets/Sounds/Music/8bit-mysterious-kyouto_reverb_Loop.ogg differ diff --git a/Assets/Sounds/Music/8bit-mysterious-kyouto_reverb_Loop.ogg.import b/Assets/Sounds/Music/8bit-mysterious-kyouto_reverb_Loop.ogg.import new file mode 100644 index 0000000..0af9498 --- /dev/null +++ b/Assets/Sounds/Music/8bit-mysterious-kyouto_reverb_Loop.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://dbsuw8omrcx1d" +path="res://.godot/imported/8bit-mysterious-kyouto_reverb_Loop.ogg-b44e9dc45b48b3a04f14348acaf5ca70.oggvorbisstr" + +[deps] + +source_file="res://Assets/Sounds/Music/8bit-mysterious-kyouto_reverb_Loop.ogg" +dest_files=["res://.godot/imported/8bit-mysterious-kyouto_reverb_Loop.ogg-b44e9dc45b48b3a04f14348acaf5ca70.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Assets/Sounds/Music/TraditionalJapanese_2.mp3 b/Assets/Sounds/Music/TraditionalJapanese_2.mp3 new file mode 100644 index 0000000..2cb093c Binary files /dev/null and b/Assets/Sounds/Music/TraditionalJapanese_2.mp3 differ diff --git a/Assets/Sounds/Music/TraditionalJapanese_2.mp3.import b/Assets/Sounds/Music/TraditionalJapanese_2.mp3.import new file mode 100644 index 0000000..f959272 --- /dev/null +++ b/Assets/Sounds/Music/TraditionalJapanese_2.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://dyeb6onb7ojhj" +path="res://.godot/imported/TraditionalJapanese_2.mp3-cb2c1a9e0e18dd40278b141cf24277e5.mp3str" + +[deps] + +source_file="res://Assets/Sounds/Music/TraditionalJapanese_2.mp3" +dest_files=["res://.godot/imported/TraditionalJapanese_2.mp3-cb2c1a9e0e18dd40278b141cf24277e5.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Assets/Sounds/Sfx/kitsune.wav b/Assets/Sounds/Sfx/kitsune.wav new file mode 100644 index 0000000..77644ac Binary files /dev/null and b/Assets/Sounds/Sfx/kitsune.wav differ diff --git a/Assets/Sounds/Sfx/kitsune.wav.import b/Assets/Sounds/Sfx/kitsune.wav.import new file mode 100644 index 0000000..7285922 --- /dev/null +++ b/Assets/Sounds/Sfx/kitsune.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://dt18fd3icyuxu" +path="res://.godot/imported/kitsune.wav-b4682e28f2d41e862863349ec5141309.sample" + +[deps] + +source_file="res://Assets/Sounds/Sfx/kitsune.wav" +dest_files=["res://.godot/imported/kitsune.wav-b4682e28f2d41e862863349ec5141309.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/Assets/Sounds/Sfx/liquidhit.wav b/Assets/Sounds/Sfx/liquidhit.wav new file mode 100644 index 0000000..ffaaf91 Binary files /dev/null and b/Assets/Sounds/Sfx/liquidhit.wav differ diff --git a/Assets/Sounds/Sfx/liquidhit.wav.import b/Assets/Sounds/Sfx/liquidhit.wav.import new file mode 100644 index 0000000..a142302 --- /dev/null +++ b/Assets/Sounds/Sfx/liquidhit.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://d3x711iom306x" +path="res://.godot/imported/liquidhit.wav-cc00bf09333d553e9fb953703be61f48.sample" + +[deps] + +source_file="res://Assets/Sounds/Sfx/liquidhit.wav" +dest_files=["res://.godot/imported/liquidhit.wav-cc00bf09333d553e9fb953703be61f48.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/Assets/Sounds/Sfx/oni.wav b/Assets/Sounds/Sfx/oni.wav new file mode 100644 index 0000000..764ab69 Binary files /dev/null and b/Assets/Sounds/Sfx/oni.wav differ diff --git a/Assets/Sounds/Sfx/oni.wav.import b/Assets/Sounds/Sfx/oni.wav.import new file mode 100644 index 0000000..19f4a78 --- /dev/null +++ b/Assets/Sounds/Sfx/oni.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://ce5vqm3tts58o" +path="res://.godot/imported/oni.wav-d0d8f752f5e5258e3e2ab1f1997533a8.sample" + +[deps] + +source_file="res://Assets/Sounds/Sfx/oni.wav" +dest_files=["res://.godot/imported/oni.wav-d0d8f752f5e5258e3e2ab1f1997533a8.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/Assets/Sounds/Sfx/stonehit.wav b/Assets/Sounds/Sfx/stonehit.wav new file mode 100644 index 0000000..fe6ec99 Binary files /dev/null and b/Assets/Sounds/Sfx/stonehit.wav differ diff --git a/Assets/Sounds/Sfx/stonehit.wav.import b/Assets/Sounds/Sfx/stonehit.wav.import new file mode 100644 index 0000000..5fffcde --- /dev/null +++ b/Assets/Sounds/Sfx/stonehit.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://cjc3oi8xonu6q" +path="res://.godot/imported/stonehit.wav-c1aa23719415b9c4e29d5c5a35f950d6.sample" + +[deps] + +source_file="res://Assets/Sounds/Sfx/stonehit.wav" +dest_files=["res://.godot/imported/stonehit.wav-c1aa23719415b9c4e29d5c5a35f950d6.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/Assets/Sounds/Sfx/stumphit.wav b/Assets/Sounds/Sfx/stumphit.wav new file mode 100644 index 0000000..230b4c0 Binary files /dev/null and b/Assets/Sounds/Sfx/stumphit.wav differ diff --git a/Assets/Sounds/Sfx/stumphit.wav.import b/Assets/Sounds/Sfx/stumphit.wav.import new file mode 100644 index 0000000..c0a87b7 --- /dev/null +++ b/Assets/Sounds/Sfx/stumphit.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://qx5kenslqkk6" +path="res://.godot/imported/stumphit.wav-07143d2bfb72abcee6c0c39949a7b7a7.sample" + +[deps] + +source_file="res://Assets/Sounds/Sfx/stumphit.wav" +dest_files=["res://.godot/imported/stumphit.wav-07143d2bfb72abcee6c0c39949a7b7a7.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/Assets/Sounds/Sfx/tengu.wav b/Assets/Sounds/Sfx/tengu.wav new file mode 100644 index 0000000..16fc4e7 Binary files /dev/null and b/Assets/Sounds/Sfx/tengu.wav differ diff --git a/Assets/Sounds/Sfx/tengu.wav.import b/Assets/Sounds/Sfx/tengu.wav.import new file mode 100644 index 0000000..a4a53c0 --- /dev/null +++ b/Assets/Sounds/Sfx/tengu.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://wvrhsssfi7w3" +path="res://.godot/imported/tengu.wav-1c2a7c5257677455893fa37186969079.sample" + +[deps] + +source_file="res://Assets/Sounds/Sfx/tengu.wav" +dest_files=["res://.godot/imported/tengu.wav-1c2a7c5257677455893fa37186969079.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/Assets/Sprites/Projectiles/projectile_green-Sheet.png b/Assets/Sprites/Projectiles/projectile_green-Sheet.png new file mode 100644 index 0000000..a7c9654 Binary files /dev/null and b/Assets/Sprites/Projectiles/projectile_green-Sheet.png differ diff --git a/Assets/Sprites/Projectiles/projectile_green-Sheet.png.import b/Assets/Sprites/Projectiles/projectile_green-Sheet.png.import new file mode 100644 index 0000000..0115a49 --- /dev/null +++ b/Assets/Sprites/Projectiles/projectile_green-Sheet.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bfclgdy7dusmg" +path="res://.godot/imported/projectile_green-Sheet.png-c5093c09470fe51ed60583ba4e846711.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Sprites/Projectiles/projectile_green-Sheet.png" +dest_files=["res://.godot/imported/projectile_green-Sheet.png-c5093c09470fe51ed60583ba4e846711.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Sprites/UI/MASKS.png b/Assets/Sprites/UI/MASKS.png new file mode 100644 index 0000000..8ee9a91 Binary files /dev/null and b/Assets/Sprites/UI/MASKS.png differ diff --git a/Assets/Sprites/UI/MASKS.png.import b/Assets/Sprites/UI/MASKS.png.import new file mode 100644 index 0000000..895230e --- /dev/null +++ b/Assets/Sprites/UI/MASKS.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cnoy4do2talkr" +path="res://.godot/imported/MASKS.png-5f7d41e449a8733ec1bd79efe0e1623d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Sprites/UI/MASKS.png" +dest_files=["res://.godot/imported/MASKS.png-5f7d41e449a8733ec1bd79efe0e1623d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Sprites/UI/soul.png b/Assets/Sprites/UI/soul.png new file mode 100644 index 0000000..000efbf Binary files /dev/null and b/Assets/Sprites/UI/soul.png differ diff --git a/Assets/Sprites/UI/soul.png.import b/Assets/Sprites/UI/soul.png.import new file mode 100644 index 0000000..81d81e1 --- /dev/null +++ b/Assets/Sprites/UI/soul.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b2wa0rqssefiy" +path="res://.godot/imported/soul.png-bfa45a24db5871c67a944fb79e1a8619.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Sprites/UI/soul.png" +dest_files=["res://.godot/imported/soul.png-bfa45a24db5871c67a944fb79e1a8619.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Sprites/Vfx/particle.png b/Assets/Sprites/Vfx/particle.png new file mode 100644 index 0000000..2d0b79e Binary files /dev/null and b/Assets/Sprites/Vfx/particle.png differ diff --git a/Assets/Sprites/Vfx/particle.png.import b/Assets/Sprites/Vfx/particle.png.import new file mode 100644 index 0000000..67a3ab4 --- /dev/null +++ b/Assets/Sprites/Vfx/particle.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://2x62ipg12256" +path="res://.godot/imported/particle.png-8182658a2fdd9b1eb91f1f1871e284d9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Sprites/Vfx/particle.png" +dest_files=["res://.godot/imported/particle.png-8182658a2fdd9b1eb91f1f1871e284d9.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Credits.txt b/Credits.txt new file mode 100644 index 0000000..4fa0d8e --- /dev/null +++ b/Credits.txt @@ -0,0 +1,2 @@ +BG Music - https://www.youtube.com/watch?v=r-PYsYKhn54 +https://music.storyinvention.com/en/8bit-mysterious-kyouto-en/#comments diff --git a/Prefabs/Enemies/liquid.tscn b/Prefabs/Enemies/liquid.tscn index 58f919f..b27476c 100644 --- a/Prefabs/Enemies/liquid.tscn +++ b/Prefabs/Enemies/liquid.tscn @@ -1,9 +1,11 @@ -[gd_scene load_steps=11 format=3 uid="uid://c37hbbbx8wje"] +[gd_scene load_steps=13 format=3 uid="uid://c37hbbbx8wje"] [ext_resource type="Script" uid="uid://bj52mq7uip7di" path="res://Scripts/Enemies/Enemy.cs" id="1_rmkli"] [ext_resource type="Texture2D" uid="uid://dab3cq4y0d2pm" path="res://Assets/Sprites/Characters/Enemies/water-Sheet.png" id="2_rmkli"] [ext_resource type="Script" uid="uid://cu37tswrk107q" path="res://Scripts/Enemies/EnemyMovement.cs" id="3_t8by4"] [ext_resource type="Script" uid="uid://dvkd1keu854so" path="res://Scripts/Components/Health.cs" id="4_cyy2q"] +[ext_resource type="Script" uid="uid://c247m8m3qmlk0" path="res://Scripts/Enemies/EnemyArea.cs" id="5_frtie"] +[ext_resource type="AudioStream" uid="uid://d3x711iom306x" path="res://Assets/Sounds/Sfx/liquidhit.wav" id="6_t8by4"] [sub_resource type="AtlasTexture" id="AtlasTexture_frtie"] atlas = ExtResource("2_rmkli") @@ -44,21 +46,25 @@ animations = [{ [sub_resource type="CircleShape2D" id="CircleShape2D_7puah"] radius = 12.0 -[node name="enemy" type="PathFollow2D" node_paths=PackedStringArray("Health")] +[node name="enemy" type="PathFollow2D" node_paths=PackedStringArray("Health", "_audio")] rotates = false loop = false script = ExtResource("1_rmkli") +Type = 2 Health = NodePath("Scripts/Health") +_audio = NodePath("AudioStreamPlayer2D") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] texture_filter = 1 sprite_frames = SubResource("SpriteFrames_ewbju") +autoplay = "default" offset = Vector2(0, -16) [node name="Scripts" type="Node" parent="."] -[node name="Movement" type="Node" parent="Scripts" node_paths=PackedStringArray("_pathFollow2D")] +[node name="Movement" type="Node" parent="Scripts" node_paths=PackedStringArray("_enemy", "_pathFollow2D")] script = ExtResource("3_t8by4") +_enemy = NodePath("../..") _pathFollow2D = NodePath("../..") _speed = 25.0 @@ -66,10 +72,16 @@ _speed = 25.0 script = ExtResource("4_cyy2q") _baseMaxHp = 50.0 -[node name="HitBox" type="Area2D" parent="."] +[node name="HitBox" type="Area2D" parent="." node_paths=PackedStringArray("Enemy")] collision_layer = 4 collision_mask = 0 +script = ExtResource("5_frtie") +Enemy = NodePath("..") [node name="CollisionShape2D" type="CollisionShape2D" parent="HitBox"] position = Vector2(-1, -9) shape = SubResource("CircleShape2D_7puah") + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("6_t8by4") +volume_db = -20.0 diff --git a/Prefabs/Enemies/stone.tscn b/Prefabs/Enemies/stone.tscn index f83dde9..f97bd7a 100644 --- a/Prefabs/Enemies/stone.tscn +++ b/Prefabs/Enemies/stone.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=15 format=3 uid="uid://y54cvugsx75b"] +[gd_scene load_steps=23 format=3 uid="uid://y54cvugsx75b"] [ext_resource type="Script" uid="uid://bj52mq7uip7di" path="res://Scripts/Enemies/Enemy.cs" id="1_qqq3s"] [ext_resource type="Texture2D" uid="uid://cm8gnfvfysyyl" path="res://Assets/Sprites/Characters/Enemies/stone-Sheet.png" id="2_ymaxx"] +[ext_resource type="Texture2D" uid="uid://cpyntpwy5riy8" path="res://Assets/Sprites/Characters/Enemies/stone_walk-Sheet.png" id="3_njiku"] [ext_resource type="Script" uid="uid://cu37tswrk107q" path="res://Scripts/Enemies/EnemyMovement.cs" id="3_pbvk1"] [ext_resource type="Script" uid="uid://dvkd1keu854so" path="res://Scripts/Components/Health.cs" id="4_njiku"] [ext_resource type="Script" uid="uid://c247m8m3qmlk0" path="res://Scripts/Enemies/EnemyArea.cs" id="5_ymaxx"] +[ext_resource type="AudioStream" uid="uid://cjc3oi8xonu6q" path="res://Assets/Sounds/Sfx/stonehit.wav" id="6_pbvk1"] [sub_resource type="AtlasTexture" id="AtlasTexture_ldgsr"] atlas = ExtResource("2_ymaxx") @@ -34,6 +36,30 @@ region = Rect2(160, 0, 32, 32) atlas = ExtResource("2_ymaxx") region = Rect2(192, 0, 32, 32) +[sub_resource type="AtlasTexture" id="AtlasTexture_gkxry"] +atlas = ExtResource("3_njiku") +region = Rect2(0, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0k7sk"] +atlas = ExtResource("3_njiku") +region = Rect2(32, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_g3mu5"] +atlas = ExtResource("3_njiku") +region = Rect2(64, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nlfdx"] +atlas = ExtResource("3_njiku") +region = Rect2(96, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_km1he"] +atlas = ExtResource("3_njiku") +region = Rect2(128, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xa2pf"] +atlas = ExtResource("3_njiku") +region = Rect2(160, 0, 32, 32) + [sub_resource type="SpriteFrames" id="SpriteFrames_ewbju"] animations = [{ "frames": [{ @@ -61,27 +87,55 @@ animations = [{ "loop": true, "name": &"default", "speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_gkxry") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0k7sk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_g3mu5") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nlfdx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_km1he") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xa2pf") +}], +"loop": true, +"name": &"walk", +"speed": 5.0 }] [sub_resource type="CircleShape2D" id="CircleShape2D_7puah"] radius = 12.0 -[node name="enemy" type="PathFollow2D" node_paths=PackedStringArray("Health")] +[node name="enemy" type="PathFollow2D" node_paths=PackedStringArray("Health", "_audio")] rotates = false loop = false script = ExtResource("1_qqq3s") Health = NodePath("Scripts/Health") +_audio = NodePath("AudioStreamPlayer2D") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] self_modulate = Color(1.8247963, 1.8247963, 1.8247963, 1) texture_filter = 1 sprite_frames = SubResource("SpriteFrames_ewbju") +animation = &"walk" +autoplay = "walk" +frame_progress = 0.2934902 offset = Vector2(0, -16) [node name="Scripts" type="Node" parent="."] -[node name="Movement" type="Node" parent="Scripts" node_paths=PackedStringArray("_pathFollow2D")] +[node name="Movement" type="Node" parent="Scripts" node_paths=PackedStringArray("_enemy", "_pathFollow2D")] script = ExtResource("3_pbvk1") +_enemy = NodePath("../..") _pathFollow2D = NodePath("../..") _speed = 25.0 @@ -98,3 +152,7 @@ Enemy = NodePath("..") [node name="CollisionShape2D" type="CollisionShape2D" parent="HitBox"] position = Vector2(0, -14) shape = SubResource("CircleShape2D_7puah") + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("6_pbvk1") +volume_db = -20.0 diff --git a/Prefabs/Enemies/stump.tscn b/Prefabs/Enemies/stump.tscn index 229fd1a..ab2fb2b 100644 --- a/Prefabs/Enemies/stump.tscn +++ b/Prefabs/Enemies/stump.tscn @@ -1,9 +1,11 @@ -[gd_scene load_steps=15 format=3 uid="uid://bawoevqlooah0"] +[gd_scene load_steps=17 format=3 uid="uid://bawoevqlooah0"] [ext_resource type="Script" uid="uid://bj52mq7uip7di" path="res://Scripts/Enemies/Enemy.cs" id="1_0paat"] [ext_resource type="Texture2D" uid="uid://blkxqlgahm4al" path="res://Assets/Sprites/Characters/Enemies/stump-Sheet.png" id="2_0paat"] [ext_resource type="Script" uid="uid://cu37tswrk107q" path="res://Scripts/Enemies/EnemyMovement.cs" id="3_8v58s"] [ext_resource type="Script" uid="uid://dvkd1keu854so" path="res://Scripts/Components/Health.cs" id="4_04dlg"] +[ext_resource type="Script" uid="uid://c247m8m3qmlk0" path="res://Scripts/Enemies/EnemyArea.cs" id="5_pitds"] +[ext_resource type="AudioStream" uid="uid://qx5kenslqkk6" path="res://Assets/Sounds/Sfx/stumphit.wav" id="6_8v58s"] [sub_resource type="AtlasTexture" id="AtlasTexture_pitds"] atlas = ExtResource("2_0paat") @@ -72,24 +74,27 @@ animations = [{ [sub_resource type="CircleShape2D" id="CircleShape2D_7puah"] radius = 12.0 -[node name="enemy" type="PathFollow2D" node_paths=PackedStringArray("Health")] +[node name="enemy" type="PathFollow2D" node_paths=PackedStringArray("Health", "_audio")] rotates = false loop = false script = ExtResource("1_0paat") Type = 1 Health = NodePath("Scripts/Health") +_audio = NodePath("AudioStreamPlayer2D") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] texture_filter = 1 sprite_frames = SubResource("SpriteFrames_ewbju") +autoplay = "default" frame = 1 frame_progress = 0.31093782 offset = Vector2(0, -16) [node name="Scripts" type="Node" parent="."] -[node name="Movement" type="Node" parent="Scripts" node_paths=PackedStringArray("_pathFollow2D")] +[node name="Movement" type="Node" parent="Scripts" node_paths=PackedStringArray("_enemy", "_pathFollow2D")] script = ExtResource("3_8v58s") +_enemy = NodePath("../..") _pathFollow2D = NodePath("../..") _speed = 25.0 @@ -97,10 +102,16 @@ _speed = 25.0 script = ExtResource("4_04dlg") _baseMaxHp = 50.0 -[node name="HitBox" type="Area2D" parent="."] +[node name="HitBox" type="Area2D" parent="." node_paths=PackedStringArray("Enemy")] collision_layer = 4 collision_mask = 0 +script = ExtResource("5_pitds") +Enemy = NodePath("..") [node name="CollisionShape2D" type="CollisionShape2D" parent="HitBox"] position = Vector2(0, -14) shape = SubResource("CircleShape2D_7puah") + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("6_8v58s") +volume_db = -20.0 diff --git a/Prefabs/Projectiles/Blueflame.tscn b/Prefabs/Projectiles/Blueflame.tscn new file mode 100644 index 0000000..82ac60f --- /dev/null +++ b/Prefabs/Projectiles/Blueflame.tscn @@ -0,0 +1,66 @@ +[gd_scene load_steps=9 format=3 uid="uid://wucwxtp1w12q"] + +[ext_resource type="Script" uid="uid://ln2lt16fi47q" path="res://Scripts/Projectiles/Projectile.cs" id="1_yxym4"] +[ext_resource type="Texture2D" uid="uid://dxon2g2sn48jq" path="res://Assets/Sprites/Projectiles/blueflame.png" id="2_yxym4"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_llqe1"] +radius = 8.062258 + +[sub_resource type="AtlasTexture" id="AtlasTexture_opdl0"] +atlas = ExtResource("2_yxym4") +region = Rect2(0, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_baewk"] +atlas = ExtResource("2_yxym4") +region = Rect2(16, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_laj71"] +atlas = ExtResource("2_yxym4") +region = Rect2(32, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_e8kgl"] +atlas = ExtResource("2_yxym4") +region = Rect2(48, 0, 16, 32) + +[sub_resource type="SpriteFrames" id="SpriteFrames_0qapt"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_opdl0") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_baewk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_laj71") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_e8kgl") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[node name="Fireball" type="Node2D" node_paths=PackedStringArray("_hurtBox")] +texture_filter = 1 +scale = Vector2(0.75, 0.75) +script = ExtResource("1_yxym4") +_superEffective = Array[int]([2]) +_baseDamage = 25.0 +_speed = 250.0 +_hurtBox = NodePath("Hurtbox") + +[node name="Hurtbox" type="Area2D" parent="."] +collision_layer = 0 +collision_mask = 4 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox"] +shape = SubResource("CircleShape2D_llqe1") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +self_modulate = Color(1.8247963, 1.8247963, 1.8247963, 1) +rotation = -1.5707964 +sprite_frames = SubResource("SpriteFrames_0qapt") +autoplay = "default" +offset = Vector2(0, -8) diff --git a/Prefabs/Projectiles/Fireball.tscn b/Prefabs/Projectiles/Fireball.tscn index e640034..a6a6736 100644 --- a/Prefabs/Projectiles/Fireball.tscn +++ b/Prefabs/Projectiles/Fireball.tscn @@ -44,6 +44,7 @@ animations = [{ [node name="Fireball" type="Node2D" node_paths=PackedStringArray("_hurtBox")] texture_filter = 1 +scale = Vector2(0.75, 0.75) script = ExtResource("1_llqe1") _superEffective = Array[int]([1]) _baseDamage = 25.0 @@ -61,4 +62,5 @@ shape = SubResource("CircleShape2D_llqe1") self_modulate = Color(1.8247963, 1.8247963, 1.8247963, 1) rotation = -1.5707964 sprite_frames = SubResource("SpriteFrames_0qapt") +autoplay = "default" offset = Vector2(0, -8) diff --git a/Prefabs/Projectiles/GreenFist.tscn b/Prefabs/Projectiles/GreenFist.tscn new file mode 100644 index 0000000..5321c96 --- /dev/null +++ b/Prefabs/Projectiles/GreenFist.tscn @@ -0,0 +1,59 @@ +[gd_scene load_steps=8 format=3 uid="uid://deud430j2w18n"] + +[ext_resource type="Script" uid="uid://ln2lt16fi47q" path="res://Scripts/Projectiles/Projectile.cs" id="1_g5vj3"] +[ext_resource type="Texture2D" uid="uid://bfclgdy7dusmg" path="res://Assets/Sprites/Projectiles/projectile_green-Sheet.png" id="2_g5vj3"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_llqe1"] +radius = 8.062258 + +[sub_resource type="AtlasTexture" id="AtlasTexture_pj5bm"] +atlas = ExtResource("2_g5vj3") +region = Rect2(0, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8cpk0"] +atlas = ExtResource("2_g5vj3") +region = Rect2(16, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nbvp2"] +atlas = ExtResource("2_g5vj3") +region = Rect2(32, 0, 16, 32) + +[sub_resource type="SpriteFrames" id="SpriteFrames_0qapt"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_pj5bm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8cpk0") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nbvp2") +}], +"loop": true, +"name": &"default", +"speed": 5.0 +}] + +[node name="Fireball" type="Node2D" node_paths=PackedStringArray("_hurtBox")] +texture_filter = 1 +scale = Vector2(0.75, 0.75) +script = ExtResource("1_g5vj3") +_superEffective = Array[int]([0]) +_baseDamage = 25.0 +_speed = 250.0 +_hurtBox = NodePath("Hurtbox") + +[node name="Hurtbox" type="Area2D" parent="."] +collision_layer = 0 +collision_mask = 4 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox"] +shape = SubResource("CircleShape2D_llqe1") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +self_modulate = Color(1.8247963, 1.8247963, 1.8247963, 1) +rotation = -1.5707964 +sprite_frames = SubResource("SpriteFrames_0qapt") +autoplay = "default" +offset = Vector2(0, -8) diff --git a/Prefabs/Turrets/Placeholders/kitsune_ph.tscn b/Prefabs/Turrets/Placeholders/kitsune_ph.tscn new file mode 100644 index 0000000..da49010 --- /dev/null +++ b/Prefabs/Turrets/Placeholders/kitsune_ph.tscn @@ -0,0 +1,85 @@ +[gd_scene load_steps=12 format=3 uid="uid://8230dpmp7mic"] + +[ext_resource type="Texture2D" uid="uid://be7hl01iuo5af" path="res://Assets/Sprites/Characters/Player/kitsune-Sheet.png" id="1_8pa4j"] +[ext_resource type="Script" uid="uid://c4764ubjc3tan" path="res://Scripts/Turrets/TurretPlaceholder.cs" id="1_m8yif"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_m8yif"] +atlas = ExtResource("1_8pa4j") +region = Rect2(0, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mxl7p"] +atlas = ExtResource("1_8pa4j") +region = Rect2(16, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5c7uc"] +atlas = ExtResource("1_8pa4j") +region = Rect2(32, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_27ihx"] +atlas = ExtResource("1_8pa4j") +region = Rect2(48, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_rkws8"] +atlas = ExtResource("1_8pa4j") +region = Rect2(64, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ppr0o"] +atlas = ExtResource("1_8pa4j") +region = Rect2(80, 0, 16, 32) + +[sub_resource type="SpriteFrames" id="SpriteFrames_ebmjs"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_m8yif") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_mxl7p") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5c7uc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_27ihx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_rkws8") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ppr0o") +}], +"loop": true, +"name": &"idle", +"speed": 8.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_y5hcb"] +radius = 7.0 + +[sub_resource type="QuadMesh" id="QuadMesh_5wxv7"] +size = Vector2(100, 100) + +[node name="Turret" type="Node2D" node_paths=PackedStringArray("_placementChecker")] +y_sort_enabled = true +texture_filter = 1 +script = ExtResource("1_m8yif") +_placementChecker = NodePath("PlacementCollider") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +self_modulate = Color(1, 1, 1, 0.49803922) +sprite_frames = SubResource("SpriteFrames_ebmjs") +animation = &"idle" +autoplay = "idle" +frame_progress = 0.66817015 +offset = Vector2(0, -16) + +[node name="PlacementCollider" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="PlacementCollider"] +position = Vector2(0, -5) +rotation = 1.5707964 +shape = SubResource("CircleShape2D_y5hcb") + +[node name="MeshInstance2D" type="MeshInstance2D" parent="."] +visible = false +mesh = SubResource("QuadMesh_5wxv7") diff --git a/Prefabs/Turrets/Placeholders/oni_ph.tscn b/Prefabs/Turrets/Placeholders/oni_ph.tscn new file mode 100644 index 0000000..6ef0750 --- /dev/null +++ b/Prefabs/Turrets/Placeholders/oni_ph.tscn @@ -0,0 +1,85 @@ +[gd_scene load_steps=12 format=3 uid="uid://dmyv5hki78wf7"] + +[ext_resource type="Script" uid="uid://c4764ubjc3tan" path="res://Scripts/Turrets/TurretPlaceholder.cs" id="1_eybvl"] +[ext_resource type="Texture2D" uid="uid://c6dl0tlkdtis1" path="res://Assets/Sprites/Characters/Player/oniSheet.png" id="2_eybvl"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_o7til"] +atlas = ExtResource("2_eybvl") +region = Rect2(0, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_d2vfx"] +atlas = ExtResource("2_eybvl") +region = Rect2(16, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_oap50"] +atlas = ExtResource("2_eybvl") +region = Rect2(32, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8du7j"] +atlas = ExtResource("2_eybvl") +region = Rect2(48, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_q65kb"] +atlas = ExtResource("2_eybvl") +region = Rect2(64, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tw2se"] +atlas = ExtResource("2_eybvl") +region = Rect2(80, 0, 16, 32) + +[sub_resource type="SpriteFrames" id="SpriteFrames_ebmjs"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_o7til") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_d2vfx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_oap50") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8du7j") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_q65kb") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tw2se") +}], +"loop": true, +"name": &"idle", +"speed": 8.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_y5hcb"] +radius = 7.0 + +[sub_resource type="QuadMesh" id="QuadMesh_5wxv7"] +size = Vector2(100, 100) + +[node name="Turret" type="Node2D" node_paths=PackedStringArray("_placementChecker")] +y_sort_enabled = true +texture_filter = 1 +script = ExtResource("1_eybvl") +_placementChecker = NodePath("PlacementCollider") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +self_modulate = Color(1, 1, 1, 0.49803922) +sprite_frames = SubResource("SpriteFrames_ebmjs") +animation = &"idle" +autoplay = "idle" +frame_progress = 0.66817015 +offset = Vector2(0, -16) + +[node name="PlacementCollider" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="PlacementCollider"] +position = Vector2(0, -5) +rotation = 1.5707964 +shape = SubResource("CircleShape2D_y5hcb") + +[node name="MeshInstance2D" type="MeshInstance2D" parent="."] +visible = false +mesh = SubResource("QuadMesh_5wxv7") diff --git a/Prefabs/Turrets/Placeholders/tengu_ph.tscn b/Prefabs/Turrets/Placeholders/tengu_ph.tscn new file mode 100644 index 0000000..ff71f8b --- /dev/null +++ b/Prefabs/Turrets/Placeholders/tengu_ph.tscn @@ -0,0 +1,85 @@ +[gd_scene load_steps=12 format=3 uid="uid://dqyr3m6o0e3i"] + +[ext_resource type="Script" uid="uid://c4764ubjc3tan" path="res://Scripts/Turrets/TurretPlaceholder.cs" id="1_1ptjx"] +[ext_resource type="Texture2D" uid="uid://codbtra5i6ara" path="res://Assets/Sprites/Characters/Player/tengu-Sheet.png" id="2_1ptjx"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_a6rco"] +atlas = ExtResource("2_1ptjx") +region = Rect2(0, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_42avh"] +atlas = ExtResource("2_1ptjx") +region = Rect2(16, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_e075m"] +atlas = ExtResource("2_1ptjx") +region = Rect2(32, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tmypy"] +atlas = ExtResource("2_1ptjx") +region = Rect2(48, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_lgt5p"] +atlas = ExtResource("2_1ptjx") +region = Rect2(64, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_66d3b"] +atlas = ExtResource("2_1ptjx") +region = Rect2(80, 0, 16, 32) + +[sub_resource type="SpriteFrames" id="SpriteFrames_ebmjs"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_a6rco") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_42avh") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_e075m") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tmypy") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_lgt5p") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_66d3b") +}], +"loop": true, +"name": &"idle", +"speed": 8.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_y5hcb"] +radius = 7.0 + +[sub_resource type="QuadMesh" id="QuadMesh_5wxv7"] +size = Vector2(100, 100) + +[node name="Turret" type="Node2D" node_paths=PackedStringArray("_placementChecker")] +y_sort_enabled = true +texture_filter = 1 +script = ExtResource("1_1ptjx") +_placementChecker = NodePath("PlacementCollider") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +self_modulate = Color(1, 1, 1, 0.49803922) +sprite_frames = SubResource("SpriteFrames_ebmjs") +animation = &"idle" +autoplay = "idle" +frame_progress = 0.8244228 +offset = Vector2(0, -16) + +[node name="PlacementCollider" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="PlacementCollider"] +position = Vector2(0, -5) +rotation = 1.5707964 +shape = SubResource("CircleShape2D_y5hcb") + +[node name="MeshInstance2D" type="MeshInstance2D" parent="."] +visible = false +mesh = SubResource("QuadMesh_5wxv7") diff --git a/Prefabs/Turrets/kitsune.tscn b/Prefabs/Turrets/kitsune.tscn index cef8629..4045490 100644 --- a/Prefabs/Turrets/kitsune.tscn +++ b/Prefabs/Turrets/kitsune.tscn @@ -1,9 +1,11 @@ -[gd_scene load_steps=15 format=3 uid="uid://cx7gr555b1gov"] +[gd_scene load_steps=18 format=3 uid="uid://cx7gr555b1gov"] [ext_resource type="Texture2D" uid="uid://be7hl01iuo5af" path="res://Assets/Sprites/Characters/Player/kitsune-Sheet.png" id="1_0bpay"] [ext_resource type="Script" uid="uid://cxrhl65cjw4yr" path="res://Scripts/Turrets/Turret.cs" id="2_jjtgc"] [ext_resource type="Script" uid="uid://cy00plvsi6vkn" path="res://Scripts/Projectiles/ProjectilePool.cs" id="3_d0rgn"] -[ext_resource type="PackedScene" uid="uid://cr6shokga0dy6" path="res://Prefabs/Projectiles/Fireball.tscn" id="4_jjtgc"] +[ext_resource type="PackedScene" uid="uid://wucwxtp1w12q" path="res://Prefabs/Projectiles/Blueflame.tscn" id="4_jjtgc"] +[ext_resource type="Script" uid="uid://bpqof3jshxnug" path="res://Scripts/Turrets/DragMover.cs" id="5_d0rgn"] +[ext_resource type="AudioStream" uid="uid://dt18fd3icyuxu" path="res://Assets/Sounds/Sfx/kitsune.wav" id="6_cnydl"] [sub_resource type="AtlasTexture" id="AtlasTexture_3dryh"] atlas = ExtResource("1_0bpay") @@ -61,6 +63,9 @@ radius = 50.0 [sub_resource type="CircleShape2D" id="CircleShape2D_y5hcb"] radius = 7.0 +[sub_resource type="RectangleShape2D" id="RectangleShape2D_jjtgc"] +size = Vector2(32, 16) + [sub_resource type="QuadMesh" id="QuadMesh_5wxv7"] size = Vector2(100, 100) @@ -78,33 +83,56 @@ offset = Vector2(0, -16) [node name="Scripts" type="Node" parent="."] -[node name="Turret" type="Node" parent="Scripts" node_paths=PackedStringArray("_Attackrange", "_parent", "_projectilePool")] +[node name="Turret" type="Node" parent="Scripts" node_paths=PackedStringArray("_Attackrange", "_parent", "_projectilePool", "_audio")] script = ExtResource("2_jjtgc") _Attackrange = NodePath("../../ShootArea") _fireRate = 1.0 _parent = NodePath("../..") _projectilePool = NodePath("../ProjectilePool") +_audio = NodePath("../../AudioStreamPlayer2D") [node name="ProjectilePool" type="Node" parent="Scripts"] script = ExtResource("3_d0rgn") _scene = ExtResource("4_jjtgc") _poolSize = 10 +[node name="DragMover" type="Node" parent="Scripts" node_paths=PackedStringArray("Parent", "DragArea", "CheckArea", "ShootArea")] +script = ExtResource("5_d0rgn") +Parent = NodePath("../..") +DragArea = NodePath("../../DragCollider") +CheckArea = NodePath("../../PlacementCollider") +ShootArea = NodePath("../../ShootArea") + [node name="ShootArea" type="Area2D" parent="."] collision_layer = 0 collision_mask = 4 +input_pickable = false [node name="CollisionShape2D" type="CollisionShape2D" parent="ShootArea"] rotation = 1.5707964 shape = SubResource("CircleShape2D_5wxv7") [node name="PlacementCollider" type="Area2D" parent="."] +input_pickable = false [node name="CollisionShape2D" type="CollisionShape2D" parent="PlacementCollider"] position = Vector2(0, -5) rotation = 1.5707964 shape = SubResource("CircleShape2D_y5hcb") +[node name="DragCollider" type="Area2D" parent="."] +collision_layer = 2147483648 +collision_mask = 2147483648 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="DragCollider"] +position = Vector2(0, -16) +rotation = 1.5707964 +shape = SubResource("RectangleShape2D_jjtgc") + [node name="MeshInstance2D" type="MeshInstance2D" parent="."] visible = false mesh = SubResource("QuadMesh_5wxv7") + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("6_cnydl") +volume_db = -20.0 diff --git a/Prefabs/Turrets/oni.tscn b/Prefabs/Turrets/oni.tscn new file mode 100644 index 0000000..b90536f --- /dev/null +++ b/Prefabs/Turrets/oni.tscn @@ -0,0 +1,136 @@ +[gd_scene load_steps=18 format=3 uid="uid://8fsvnmto0ckj"] + +[ext_resource type="Texture2D" uid="uid://c6dl0tlkdtis1" path="res://Assets/Sprites/Characters/Player/oniSheet.png" id="1_rg6xk"] +[ext_resource type="Script" uid="uid://cxrhl65cjw4yr" path="res://Scripts/Turrets/Turret.cs" id="2_hi1ge"] +[ext_resource type="Script" uid="uid://cy00plvsi6vkn" path="res://Scripts/Projectiles/ProjectilePool.cs" id="3_if52b"] +[ext_resource type="PackedScene" uid="uid://deud430j2w18n" path="res://Prefabs/Projectiles/GreenFist.tscn" id="4_rg6xk"] +[ext_resource type="Script" uid="uid://bpqof3jshxnug" path="res://Scripts/Turrets/DragMover.cs" id="5_hi1ge"] +[ext_resource type="AudioStream" uid="uid://ce5vqm3tts58o" path="res://Assets/Sounds/Sfx/oni.wav" id="6_if52b"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_hi1ge"] +atlas = ExtResource("1_rg6xk") +region = Rect2(0, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_if52b"] +atlas = ExtResource("1_rg6xk") +region = Rect2(16, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_aqbic"] +atlas = ExtResource("1_rg6xk") +region = Rect2(32, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nxpwl"] +atlas = ExtResource("1_rg6xk") +region = Rect2(48, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tmcq1"] +atlas = ExtResource("1_rg6xk") +region = Rect2(64, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ahiq0"] +atlas = ExtResource("1_rg6xk") +region = Rect2(80, 0, 16, 32) + +[sub_resource type="SpriteFrames" id="SpriteFrames_ebmjs"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_hi1ge") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_if52b") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_aqbic") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nxpwl") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tmcq1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ahiq0") +}], +"loop": true, +"name": &"idle", +"speed": 8.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_5wxv7"] +radius = 50.0 + +[sub_resource type="CircleShape2D" id="CircleShape2D_y5hcb"] +radius = 7.0 + +[sub_resource type="QuadMesh" id="QuadMesh_5wxv7"] +size = Vector2(100, 100) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_rg6xk"] +size = Vector2(32, 16) + +[node name="Turret" type="Node2D"] +y_sort_enabled = true +texture_filter = 1 + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +self_modulate = Color(1.8247963, 1.8247963, 1.8247963, 1) +sprite_frames = SubResource("SpriteFrames_ebmjs") +animation = &"idle" +autoplay = "idle" +frame_progress = 0.8244228 +offset = Vector2(0, -16) + +[node name="Scripts" type="Node" parent="."] + +[node name="Turret" type="Node" parent="Scripts" node_paths=PackedStringArray("_Attackrange", "_parent", "_projectilePool", "_audio")] +script = ExtResource("2_hi1ge") +_Attackrange = NodePath("../../ShootArea") +_fireRate = 1.0 +_parent = NodePath("../..") +_projectilePool = NodePath("../ProjectilePool") +_audio = NodePath("../../AudioStreamPlayer2D") + +[node name="ProjectilePool" type="Node" parent="Scripts"] +script = ExtResource("3_if52b") +_scene = ExtResource("4_rg6xk") +_poolSize = 10 + +[node name="DragMover" type="Node" parent="Scripts" node_paths=PackedStringArray("Parent", "DragArea", "CheckArea", "ShootArea")] +script = ExtResource("5_hi1ge") +Parent = NodePath("../..") +DragArea = NodePath("../../DragCollider") +CheckArea = NodePath("../../PlacementCollider") +ShootArea = NodePath("../../ShootArea") + +[node name="ShootArea" type="Area2D" parent="."] +collision_layer = 0 +collision_mask = 4 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="ShootArea"] +rotation = 1.5707964 +shape = SubResource("CircleShape2D_5wxv7") + +[node name="PlacementCollider" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="PlacementCollider"] +position = Vector2(0, -5) +rotation = 1.5707964 +shape = SubResource("CircleShape2D_y5hcb") + +[node name="MeshInstance2D" type="MeshInstance2D" parent="."] +visible = false +mesh = SubResource("QuadMesh_5wxv7") + +[node name="DragCollider" type="Area2D" parent="."] +collision_layer = 2147483648 +collision_mask = 2147483648 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="DragCollider"] +position = Vector2(0, -16) +rotation = 1.5707964 +shape = SubResource("RectangleShape2D_rg6xk") + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("6_if52b") +volume_db = -20.0 diff --git a/Prefabs/Turrets/tengu.tscn b/Prefabs/Turrets/tengu.tscn new file mode 100644 index 0000000..82719ea --- /dev/null +++ b/Prefabs/Turrets/tengu.tscn @@ -0,0 +1,136 @@ +[gd_scene load_steps=18 format=3 uid="uid://cthdcnxhbyad2"] + +[ext_resource type="Texture2D" uid="uid://codbtra5i6ara" path="res://Assets/Sprites/Characters/Player/tengu-Sheet.png" id="1_3e4v5"] +[ext_resource type="Script" uid="uid://cxrhl65cjw4yr" path="res://Scripts/Turrets/Turret.cs" id="2_ahbvo"] +[ext_resource type="Script" uid="uid://cy00plvsi6vkn" path="res://Scripts/Projectiles/ProjectilePool.cs" id="3_466qr"] +[ext_resource type="PackedScene" uid="uid://cr6shokga0dy6" path="res://Prefabs/Projectiles/Fireball.tscn" id="4_mtyrr"] +[ext_resource type="Script" uid="uid://bpqof3jshxnug" path="res://Scripts/Turrets/DragMover.cs" id="5_ahbvo"] +[ext_resource type="AudioStream" uid="uid://wvrhsssfi7w3" path="res://Assets/Sounds/Sfx/tengu.wav" id="6_466qr"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_ahbvo"] +atlas = ExtResource("1_3e4v5") +region = Rect2(0, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_466qr"] +atlas = ExtResource("1_3e4v5") +region = Rect2(16, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mtyrr"] +atlas = ExtResource("1_3e4v5") +region = Rect2(32, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wfhqm"] +atlas = ExtResource("1_3e4v5") +region = Rect2(48, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1ekx4"] +atlas = ExtResource("1_3e4v5") +region = Rect2(64, 0, 16, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_u8dw0"] +atlas = ExtResource("1_3e4v5") +region = Rect2(80, 0, 16, 32) + +[sub_resource type="SpriteFrames" id="SpriteFrames_ebmjs"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_ahbvo") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_466qr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_mtyrr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wfhqm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1ekx4") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_u8dw0") +}], +"loop": true, +"name": &"idle", +"speed": 8.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_5wxv7"] +radius = 50.0 + +[sub_resource type="CircleShape2D" id="CircleShape2D_y5hcb"] +radius = 7.0 + +[sub_resource type="QuadMesh" id="QuadMesh_5wxv7"] +size = Vector2(100, 100) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_3e4v5"] +size = Vector2(32, 16) + +[node name="Turret" type="Node2D"] +y_sort_enabled = true +texture_filter = 1 + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +self_modulate = Color(1.8247963, 1.8247963, 1.8247963, 1) +sprite_frames = SubResource("SpriteFrames_ebmjs") +animation = &"idle" +autoplay = "idle" +frame_progress = 0.8244228 +offset = Vector2(0, -16) + +[node name="Scripts" type="Node" parent="."] + +[node name="Turret" type="Node" parent="Scripts" node_paths=PackedStringArray("_Attackrange", "_parent", "_projectilePool", "_audio")] +script = ExtResource("2_ahbvo") +_Attackrange = NodePath("../../ShootArea") +_fireRate = 1.0 +_parent = NodePath("../..") +_projectilePool = NodePath("../ProjectilePool") +_audio = NodePath("../../AudioStreamPlayer2D") + +[node name="ProjectilePool" type="Node" parent="Scripts"] +script = ExtResource("3_466qr") +_scene = ExtResource("4_mtyrr") +_poolSize = 10 + +[node name="DragMover" type="Node" parent="Scripts" node_paths=PackedStringArray("Parent", "DragArea", "CheckArea", "ShootArea")] +script = ExtResource("5_ahbvo") +Parent = NodePath("../..") +DragArea = NodePath("../../DragCollider") +CheckArea = NodePath("../../PlacementCollider") +ShootArea = NodePath("../../ShootArea") + +[node name="ShootArea" type="Area2D" parent="."] +collision_layer = 0 +collision_mask = 4 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="ShootArea"] +rotation = 1.5707964 +shape = SubResource("CircleShape2D_5wxv7") + +[node name="PlacementCollider" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="PlacementCollider"] +position = Vector2(0, -5) +rotation = 1.5707964 +shape = SubResource("CircleShape2D_y5hcb") + +[node name="MeshInstance2D" type="MeshInstance2D" parent="."] +visible = false +mesh = SubResource("QuadMesh_5wxv7") + +[node name="DragCollider" type="Area2D" parent="."] +collision_layer = 2147483648 +collision_mask = 2147483648 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="DragCollider"] +position = Vector2(0, -16) +rotation = 1.5707964 +shape = SubResource("RectangleShape2D_3e4v5") + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("6_466qr") +volume_db = -20.0 diff --git a/Scenes/game.tres b/Scenes/game.tres new file mode 100644 index 0000000..6e57546 --- /dev/null +++ b/Scenes/game.tres @@ -0,0 +1,25 @@ +[gd_resource type="VisualShader" load_steps=3 format=3 uid="uid://8dk8mi2w1xl6"] + +[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_nmayw"] +input_name = "texture" + +[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_v3wud"] +output_port_for_preview = 0 +expanded_output_ports = [0] +source = 5 + +[resource] +code = "shader_type canvas_item; +render_mode blend_mix; + + + +" +mode = 1 +flags/light_only = false +nodes/fragment/0/position = Vector2(660, 140) +nodes/fragment/2/node = SubResource("VisualShaderNodeInput_nmayw") +nodes/fragment/2/position = Vector2(-420, 100) +nodes/fragment/3/node = SubResource("VisualShaderNodeTexture_v3wud") +nodes/fragment/3/position = Vector2(-40, 80) +nodes/fragment/connections = PackedInt32Array(2, 0, 3, 2) diff --git a/Scenes/game.tscn b/Scenes/game.tscn index 31c4884..3f052e8 100644 --- a/Scenes/game.tscn +++ b/Scenes/game.tscn @@ -1,19 +1,39 @@ -[gd_scene load_steps=23 format=4 uid="uid://csyk43kt3xbyx"] +[gd_scene load_steps=45 format=4 uid="uid://csyk43kt3xbyx"] [ext_resource type="TileSet" uid="uid://b15j7vhkfu415" path="res://Resources/environmentTileMap.tres" id="1_ebmjs"] [ext_resource type="Script" uid="uid://djp8dmixf6sq2" path="res://Scripts/Common/GameController.cs" id="1_i6g32"] +[ext_resource type="Script" uid="uid://b0uosq6r5dbqa" path="res://Scripts/Turrets/TurretController.cs" id="1_nb51f"] [ext_resource type="Script" uid="uid://bhxyvnirfeipr" path="res://Scripts/Enemies/EnemyPool.cs" id="2_i6g32"] [ext_resource type="Script" uid="uid://cds2rrl4yjexf" path="res://Scripts/Enemies/EnemySpawner.cs" id="3_1l0tm"] +[ext_resource type="PackedScene" uid="uid://8230dpmp7mic" path="res://Prefabs/Turrets/Placeholders/kitsune_ph.tscn" id="3_ewbju"] +[ext_resource type="PackedScene" uid="uid://8fsvnmto0ckj" path="res://Prefabs/Turrets/oni.tscn" id="3_exi56"] +[ext_resource type="PackedScene" uid="uid://cthdcnxhbyad2" path="res://Prefabs/Turrets/tengu.tscn" id="4_7t8sx"] +[ext_resource type="PackedScene" uid="uid://dmyv5hki78wf7" path="res://Prefabs/Turrets/Placeholders/oni_ph.tscn" id="4_iivbl"] +[ext_resource type="PackedScene" uid="uid://dqyr3m6o0e3i" path="res://Prefabs/Turrets/Placeholders/tengu_ph.tscn" id="5_7nbq1"] [ext_resource type="Texture2D" uid="uid://bnq8qxou2sgvw" path="res://Assets/Sprites/Environments/sakura.png" id="5_i6g32"] [ext_resource type="PackedScene" uid="uid://y54cvugsx75b" path="res://Prefabs/Enemies/stone.tscn" id="5_wowpa"] [ext_resource type="Texture2D" uid="uid://cs7vjtoap8v26" path="res://Assets/Sprites/Environments/environment.png" id="6_i6g32"] +[ext_resource type="PackedScene" uid="uid://cx7gr555b1gov" path="res://Prefabs/Turrets/kitsune.tscn" id="8_h4fw4"] [ext_resource type="Texture2D" uid="uid://dxon2g2sn48jq" path="res://Assets/Sprites/Projectiles/blueflame.png" id="8_ldgsr"] [ext_resource type="Script" uid="uid://dxx6nyrs12mr6" path="res://Scripts/Common/ProjectileParent.cs" id="8_v158k"] [ext_resource type="Script" uid="uid://df0osorq00h7v" path="res://Scripts/CameraController.cs" id="10_ldgsr"] +[ext_resource type="Texture2D" uid="uid://cnoy4do2talkr" path="res://Assets/Sprites/UI/MASKS.png" id="11_o5yvi"] +[ext_resource type="PackedScene" uid="uid://bawoevqlooah0" path="res://Prefabs/Enemies/stump.tscn" id="11_vm72l"] +[ext_resource type="PackedScene" uid="uid://c37hbbbx8wje" path="res://Prefabs/Enemies/liquid.tscn" id="12_22asu"] +[ext_resource type="FontFile" uid="uid://b8lsp07ucxq6p" path="res://Assets/Fonts/MintsodaLimeGreen13X16Regular-KVvzA.ttf" id="12_rfjv2"] +[ext_resource type="Texture2D" uid="uid://b2wa0rqssefiy" path="res://Assets/Sprites/UI/soul.png" id="13_1phco"] +[ext_resource type="Shader" uid="uid://8dk8mi2w1xl6" path="res://Scenes/game.tres" id="14_1phco"] +[ext_resource type="Texture2D" uid="uid://2x62ipg12256" path="res://Assets/Sprites/Vfx/particle.png" id="16_22asu"] +[ext_resource type="Script" uid="uid://dxcke7geb20dm" path="res://Scripts/Misc/Floating.gd" id="19_fkdbe"] +[ext_resource type="AudioStream" uid="uid://dbsuw8omrcx1d" path="res://Assets/Sounds/Music/8bit-mysterious-kyouto_reverb_Loop.ogg" id="26_fkdbe"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_1l0tm"] size = Vector2(19, 11) +[sub_resource type="Gradient" id="Gradient_fkdbe"] +offsets = PackedFloat32Array(0, 0.6683673, 1) +colors = PackedColorArray(0, 0, 0, 0, 4.416, 2.127, 3.729, 1, 1, 1, 1, 0) + [sub_resource type="AtlasTexture" id="AtlasTexture_1l0tm"] atlas = ExtResource("6_i6g32") region = Rect2(176, 107, 32, 37) @@ -95,21 +115,61 @@ adjustment_enabled = true adjustment_brightness = 0.75 adjustment_contrast = 1.1 +[sub_resource type="AtlasTexture" id="AtlasTexture_nb51f"] +atlas = ExtResource("11_o5yvi") +region = Rect2(0, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nnt18"] +atlas = ExtResource("11_o5yvi") +region = Rect2(0, 16, 16, 15) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ewbju"] +atlas = ExtResource("11_o5yvi") +region = Rect2(0, 32, 16, 16) + +[sub_resource type="LabelSettings" id="LabelSettings_o5yvi"] +font = ExtResource("12_rfjv2") +font_size = 24 +outline_size = 6 +outline_color = Color(0, 0, 0, 1) +shadow_size = 0 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_nb51f"] +shader = ExtResource("14_1phco") + [node name="Root" type="Node2D"] texture_filter = 1 -[node name="TurretController" type="Node" parent="."] +[node name="TurretController" type="Node2D" parent="." node_paths=PackedStringArray("_turretParent")] +script = ExtResource("1_nb51f") +_typeToPrefab = Dictionary[int, PackedScene]({ +0: ExtResource("8_h4fw4"), +1: ExtResource("3_exi56"), +2: ExtResource("4_7t8sx") +}) +_typeToPlaceholder = Dictionary[int, PackedScene]({ +0: ExtResource("3_ewbju"), +1: ExtResource("4_iivbl"), +2: ExtResource("5_7nbq1") +}) +_turretParent = NodePath("../Level/YSorted/Turrets") -[node name="GameController" type="Node" parent="."] +[node name="GameController" type="Node" parent="." node_paths=PackedStringArray("_CurrencyLabel", "_ShrineHealthLabel")] script = ExtResource("1_i6g32") +_ShrineStartHP = 100.0 +_CurrencyLabel = NodePath("../CanvasLayer/UIRoot/CurrencyImg/CurrencyLabel") +_ShrineHealthLabel = NodePath("../CanvasLayer/UIRoot/ShrineHealthImg/ShrineHealthLabel") [node name="EnemyController" type="Node" parent="."] [node name="EnemyPool" type="Node" parent="EnemyController"] script = ExtResource("2_i6g32") _scenes = Dictionary[int, PackedScene]({ -0: ExtResource("5_wowpa") +0: ExtResource("5_wowpa"), +1: ExtResource("11_vm72l"), +2: ExtResource("12_22asu") }) +_poolSize = 50 [node name="EnemySpawner" type="Node" parent="EnemyController" node_paths=PackedStringArray("_pathParent", "_pool")] script = ExtResource("3_1l0tm") @@ -155,12 +215,64 @@ flip_h = true position = Vector2(33.5, -8.5) shape = SubResource("RectangleShape2D_1l0tm") +[node name="CPUParticles2D" type="CPUParticles2D" parent="Level/YSorted/StaticBody2D"] +position = Vector2(16, -72) +rotation = 0.7532681 +amount = 6 +texture = ExtResource("16_22asu") +lifetime = 3.0 +randomness = 1.0 +lifetime_randomness = 0.31 +emission_shape = 1 +emission_sphere_radius = 20.55 +spread = 0.0 +gravity = Vector2(7, 15) +angular_velocity_min = -50.0 +angular_velocity_max = 50.0 +radial_accel_min = -10.0 +radial_accel_max = 10.0 +scale_amount_min = 0.2 +scale_amount_max = 0.3 +color = Color(4.415934, 2.1274936, 3.7294016, 1) +color_ramp = SubResource("Gradient_fkdbe") + +[node name="CPUParticles2D2" type="CPUParticles2D" parent="Level/YSorted/StaticBody2D"] +position = Vector2(56, -56) +rotation = 0.7532681 +amount = 6 +texture = ExtResource("16_22asu") +lifetime = 3.0 +randomness = 1.0 +lifetime_randomness = 0.31 +emission_shape = 1 +emission_sphere_radius = 20.55 +spread = 0.0 +gravity = Vector2(7, 15) +angular_velocity_min = -50.0 +angular_velocity_max = 50.0 +radial_accel_min = -10.0 +radial_accel_max = 10.0 +scale_amount_min = 0.2 +scale_amount_max = 0.3 +color = Color(4.416, 2.127, 3.729, 1) +color_ramp = SubResource("Gradient_fkdbe") + [node name="Shrine" type="Sprite2D" parent="Level/YSorted"] position = Vector2(0, 44) texture = SubResource("AtlasTexture_1l0tm") offset = Vector2(8, -54) flip_h = true +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Level/YSorted/Shrine"] +self_modulate = Color(3.6229699, 1.2174728, 1.8589382, 1) +position = Vector2(8, -60) +scale = Vector2(0.5, 0.5) +sprite_frames = SubResource("SpriteFrames_nb51f") +autoplay = "default" +frame = 2 +frame_progress = 0.84720045 +script = ExtResource("19_fkdbe") + [node name="FairyLights" type="Node2D" parent="Level/YSorted"] modulate = Color(1.8247963, 1.8247963, 1.8247963, 1) @@ -170,6 +282,7 @@ scale = Vector2(0.5, 0.5) sprite_frames = SubResource("SpriteFrames_nb51f") autoplay = "default" frame_progress = 0.41686898 +script = ExtResource("19_fkdbe") [node name="AnimatedSprite2D2" type="AnimatedSprite2D" parent="Level/YSorted/FairyLights"] position = Vector2(-129, -28) @@ -177,6 +290,7 @@ scale = Vector2(0.5, 0.5) sprite_frames = SubResource("SpriteFrames_nb51f") autoplay = "default" frame_progress = 0.7475089 +script = ExtResource("19_fkdbe") [node name="AnimatedSprite2D3" type="AnimatedSprite2D" parent="Level/YSorted/FairyLights"] position = Vector2(104, 139) @@ -184,6 +298,7 @@ scale = Vector2(0.5, 0.5) sprite_frames = SubResource("SpriteFrames_nb51f") autoplay = "default" frame_progress = 0.7475089 +script = ExtResource("19_fkdbe") [node name="AnimatedSprite2D5" type="AnimatedSprite2D" parent="Level/YSorted/FairyLights"] position = Vector2(278, 54) @@ -191,6 +306,7 @@ scale = Vector2(0.5, 0.5) sprite_frames = SubResource("SpriteFrames_nb51f") autoplay = "default" frame_progress = 0.7475089 +script = ExtResource("19_fkdbe") [node name="AnimatedSprite2D6" type="AnimatedSprite2D" parent="Level/YSorted/FairyLights"] position = Vector2(-91, 247) @@ -198,6 +314,7 @@ scale = Vector2(0.5, 0.5) sprite_frames = SubResource("SpriteFrames_nb51f") autoplay = "default" frame_progress = 0.7475089 +script = ExtResource("19_fkdbe") [node name="AnimatedSprite2D7" type="AnimatedSprite2D" parent="Level/YSorted/FairyLights"] position = Vector2(-250, 92) @@ -205,6 +322,7 @@ scale = Vector2(0.5, 0.5) sprite_frames = SubResource("SpriteFrames_nb51f") autoplay = "default" frame_progress = 0.7475089 +script = ExtResource("19_fkdbe") [node name="AnimatedSprite2D8" type="AnimatedSprite2D" parent="Level/YSorted/FairyLights"] position = Vector2(40, -200) @@ -212,6 +330,7 @@ scale = Vector2(0.5, 0.5) sprite_frames = SubResource("SpriteFrames_nb51f") autoplay = "default" frame_progress = 0.7475089 +script = ExtResource("19_fkdbe") [node name="AnimatedSprite2D4" type="AnimatedSprite2D" parent="Level/YSorted/FairyLights"] position = Vector2(140, -98) @@ -219,6 +338,7 @@ scale = Vector2(0.5, 0.5) sprite_frames = SubResource("SpriteFrames_nb51f") autoplay = "default" frame_progress = 0.7475089 +script = ExtResource("19_fkdbe") [node name="Enemies" type="Node2D" parent="Level/YSorted"] y_sort_enabled = true @@ -269,5 +389,116 @@ maxX = 300.0 minY = -300.0 maxY = 300.0 +[node name="AudioListener2D" type="AudioListener2D" parent="Camera2D"] +current = true + [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("Environment_h4fw4") + +[node name="CanvasLayer" type="CanvasLayer" parent="."] + +[node name="UIRoot" type="Control" parent="CanvasLayer"] +texture_filter = 1 +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 1 + +[node name="GridContainer" type="GridContainer" parent="CanvasLayer/UIRoot"] +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -568.0 +offset_top = -96.0 +offset_right = -434.0 +offset_bottom = -54.0 +grow_horizontal = 2 +grow_vertical = 0 +scale = Vector2(2, 2) +columns = 3 + +[node name="Oni" type="Button" parent="CanvasLayer/UIRoot/GridContainer"] +custom_minimum_size = Vector2(42, 42) +layout_mode = 2 +icon = SubResource("AtlasTexture_nb51f") +icon_alignment = 1 +expand_icon = true + +[node name="Kitsune" type="Button" parent="CanvasLayer/UIRoot/GridContainer"] +custom_minimum_size = Vector2(42, 42) +layout_mode = 2 +icon = SubResource("AtlasTexture_nnt18") +icon_alignment = 1 +expand_icon = true + +[node name="Tengu" type="Button" parent="CanvasLayer/UIRoot/GridContainer"] +custom_minimum_size = Vector2(42, 42) +layout_mode = 2 +icon = SubResource("AtlasTexture_ewbju") +icon_alignment = 1 +expand_icon = true + +[node name="CurrencyImg" type="TextureRect" parent="CanvasLayer/UIRoot"] +layout_mode = 1 +offset_left = 8.0 +offset_top = 8.0 +offset_right = 48.0 +offset_bottom = 48.0 +scale = Vector2(2, 2) +texture = ExtResource("13_1phco") + +[node name="CurrencyLabel" type="Label" parent="CanvasLayer/UIRoot/CurrencyImg"] +layout_mode = 1 +offset_left = 40.0 +offset_top = 8.0 +offset_right = 158.0 +offset_bottom = 36.0 +text = "99999999" +label_settings = SubResource("LabelSettings_o5yvi") + +[node name="ShrineHealthImg" type="TextureRect" parent="CanvasLayer/UIRoot"] +self_modulate = Color(1, 0, 0, 1) +material = SubResource("ShaderMaterial_nb51f") +layout_mode = 1 +offset_left = 8.0 +offset_top = 104.0 +offset_right = 48.0 +offset_bottom = 144.0 +scale = Vector2(2, 2) +texture = ExtResource("13_1phco") + +[node name="ShrineHealthLabel" type="Label" parent="CanvasLayer/UIRoot/ShrineHealthImg"] +layout_mode = 1 +offset_left = 40.0 +offset_top = 8.0 +offset_right = 158.0 +offset_bottom = 36.0 +text = "100%" +label_settings = SubResource("LabelSettings_o5yvi") + +[node name="StartWaveBtn" type="Button" parent="CanvasLayer/UIRoot"] +visible = false +layout_mode = 0 +offset_left = 872.0 +offset_top = 568.0 +offset_right = 1005.0 +offset_bottom = 599.0 +scale = Vector2(2, 2) +text = "Start Next Wave" + +[node name="MusicPLayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource("26_fkdbe") +volume_db = -30.0 +autoplay = true +parameters/looping = true + +[connection signal="pressed" from="CanvasLayer/UIRoot/GridContainer/Oni" to="TurretController" method="StartPlaceingTurret" binds= [2]] +[connection signal="pressed" from="CanvasLayer/UIRoot/GridContainer/Kitsune" to="TurretController" method="StartPlaceingTurret" binds= [0]] +[connection signal="pressed" from="CanvasLayer/UIRoot/GridContainer/Tengu" to="TurretController" method="StartPlaceingTurret" binds= [1]] +[connection signal="pressed" from="CanvasLayer/UIRoot/StartWaveBtn" to="GameController" method="StartWave"] diff --git a/Scripts/CameraController.cs b/Scripts/CameraController.cs index 5975ba4..98c5d99 100644 --- a/Scripts/CameraController.cs +++ b/Scripts/CameraController.cs @@ -11,7 +11,7 @@ public partial class CameraController : Camera2D [Export] private float maxX = 0f; [Export] private float minY = 0f; [Export] private float maxY = 0f; - + private bool _dragging; private Vector2 _grabWorldPos; diff --git a/Scripts/Common/GameController.cs b/Scripts/Common/GameController.cs index ba6fb4e..7525df8 100644 --- a/Scripts/Common/GameController.cs +++ b/Scripts/Common/GameController.cs @@ -6,13 +6,90 @@ public partial class GameController : Node public static GameController Instance; [Export] private float _ShrineStartHP; + [Export] private Label _CurrencyLabel; + [Export] private Label _ShrineHealthLabel; public int Wave { get; private set; } public int Currency { get; private set; } public float ShrineHealth { get; private set; } + private bool _waveOnGoing = false; + public override void _Ready() { GameController.Instance = this; + Wave = 0; + Currency = 300; + ShrineHealth = 100; + + _CurrencyLabel.Text = Currency.ToString(); + _ShrineHealthLabel.Text = $"{(100f * (ShrineHealth /_ShrineStartHP)):F1}%"; + + CallDeferred(nameof(DelayNextWave)); + } + + private void StartWave() + { + if (_waveOnGoing) return; + Wave++; + _waveOnGoing = true; + + int amountToSpawn = (int)Math.Round(5 * Math.Pow(Wave, 1.05)); + + for (int i = 0; i < 100; i++) + { + // GD.Print((int)Math.Round(5 * Math.Pow(i + 1, 1.05))); + } + + EnemySpawner.Instance.EnemiesSpawned = amountToSpawn; + + float baseDelay = 0.67f; + float minDelay = 0.12f; // never go below this + + float delay = Math.Max(minDelay, baseDelay * (float)Math.Pow(0.96f, Wave)); + + for (int i = 0; i < amountToSpawn; i++) + { + EnemySpawner.Instance.SpawnWithDelay(i * delay); + } + } + + private async void DelayNextWave() + { + await ToSignal(GetTree().CreateTimer(7.5f), SceneTreeTimer.SignalName.Timeout); + CallDeferred(nameof(StartWave)); + } + + public void WaveComplete() + { + _waveOnGoing = false; + CallDeferred(nameof(DelayNextWave)); + } + + public void DamageShrine(float v) + { + v = Math.Abs(v); + ShrineHealth -= v; + _ShrineHealthLabel.Text = $"{(100f * (ShrineHealth /_ShrineStartHP)):F1}%"; + if (ShrineHealth <= 0) + { + // TODO LOSE SCENARIO + } + } + + public void AddCurrency(int v) + { + v = Math.Abs(v); + Currency += v; + _CurrencyLabel.Text = Currency.ToString(); + } + + public bool TryRemoveCurrency(int v) + { + v = Math.Abs(v); + if (Currency < v) return false; + Currency -= v; + _CurrencyLabel.Text = Currency.ToString(); + return true; } } diff --git a/Scripts/Components/Health.cs b/Scripts/Components/Health.cs index 90a7c4e..3d452d2 100644 --- a/Scripts/Components/Health.cs +++ b/Scripts/Components/Health.cs @@ -11,15 +11,20 @@ public partial class Health : Node [Signal] public delegate void DeathEventHandler(Node2D node); + [Signal] + public delegate void DamagedEventHandler(); + public override void _EnterTree() { - CurHP = MaxHP = _baseMaxHp * Mathf.Pow(GameController.Instance.Wave, 1.067f); + // CurHP = MaxHP = _baseMaxHp * Mathf.Pow(GameController.Instance.Wave, 1.067f); + Reset(); } public void Substract(float v) { v = Mathf.Abs(v); CurHP -= v; + EmitSignalDamaged(); if (CurHP <= 0) { EmitSignalDeath(_parent); @@ -34,6 +39,8 @@ public partial class Health : Node public void Reset() { - CurHP = MaxHP = _baseMaxHp * Mathf.Pow(GameController.Instance.Wave, 1.067f); + CurHP = MaxHP = _baseMaxHp * Mathf.Pow(1.075f, GameController.Instance.Wave); + GD.Print("Curhp"); + GD.Print(CurHP); } } diff --git a/Scripts/Enemies/Enemy.cs b/Scripts/Enemies/Enemy.cs index 4e9839f..53b7190 100644 --- a/Scripts/Enemies/Enemy.cs +++ b/Scripts/Enemies/Enemy.cs @@ -5,14 +5,21 @@ public partial class Enemy : PathFollow2D { [Export] public EnemyType Type; [Export] public Health Health; + [Export] private AudioStreamPlayer2D _audio; public event Action Died; + public event Action ReachedShrine; public override void _Ready() { Health.Death += _ => Died?.Invoke(this); + Health.Damaged += () => + { + _audio?.SetPitchScale(RandomHelper.Float(0.8f, 1.2f)); + _audio?.Play(); + }; } - + public void ResetEnemy() { GlobalPosition = Vector2.Zero; @@ -23,4 +30,9 @@ public partial class Enemy : PathFollow2D Health.Reset(); // reset velocity, animation, AI, etc here } + + public void Despawn() + { + ReachedShrine?.Invoke(this); + } } \ No newline at end of file diff --git a/Scripts/Enemies/EnemyMovement.cs b/Scripts/Enemies/EnemyMovement.cs index 1a5d610..edbe598 100644 --- a/Scripts/Enemies/EnemyMovement.cs +++ b/Scripts/Enemies/EnemyMovement.cs @@ -3,9 +3,12 @@ using System; public partial class EnemyMovement : Node { + [Export] private Enemy _enemy; [Export] private PathFollow2D _pathFollow2D; [Export] private float _speed; + private float _finalSpeed => _speed + 0.15f * (float)Math.Log(GameController.Instance.Wave + 1); + private double _time = 0; public override void _EnterTree() @@ -15,6 +18,11 @@ public partial class EnemyMovement : Node public override void _Process(double delta) { - _pathFollow2D.ProgressRatio += (float)delta * (_speed / 1000f); + _pathFollow2D.ProgressRatio += (float)delta * (_finalSpeed / 1000f); + + if (_pathFollow2D.ProgressRatio >= 1.0) + { + _enemy.Despawn(); + } } } diff --git a/Scripts/Enemies/EnemyPool.cs b/Scripts/Enemies/EnemyPool.cs index bba4338..9c8c22c 100644 --- a/Scripts/Enemies/EnemyPool.cs +++ b/Scripts/Enemies/EnemyPool.cs @@ -30,7 +30,8 @@ public partial class EnemyPool : Node private Enemy CreateEnemy(EnemyType type) { var e = _scenes[type].Instantiate(); - e.Died += ReturnToPool; + e.Died += Died; + e.ReachedShrine += DamageShrine; return e; } @@ -44,8 +45,25 @@ public partial class EnemyPool : Node return e; } + private void DamageShrine(Enemy e) + { + GameController.Instance.DamageShrine(5); + ReturnToPool(e); + } + + private void Died(Enemy e) + { + GameController.Instance.AddCurrency(25); + ReturnToPool(e); + } + private void ReturnToPool(Enemy e) { + EnemySpawner.Instance.EnemiesSpawned--; + if (EnemySpawner.Instance.EnemiesSpawned <= 0) + { + GameController.Instance.WaveComplete(); + } e.GetParent()?.RemoveChild(e); e.ProcessMode = ProcessModeEnum.Disabled; _pool[e.Type].Enqueue(e); diff --git a/Scripts/Enemies/EnemySpawner.cs b/Scripts/Enemies/EnemySpawner.cs index 1cffaf6..b5e7108 100644 --- a/Scripts/Enemies/EnemySpawner.cs +++ b/Scripts/Enemies/EnemySpawner.cs @@ -3,22 +3,28 @@ using System.Collections.Generic; public partial class EnemySpawner : Node { + public static EnemySpawner Instance; + [Export] private Node _pathParent; [Export] private EnemyPool _pool; private readonly List _paths = new(); + public int EnemiesSpawned = 0; + public override void _Ready() { + Instance = this; + foreach (var c in _pathParent.GetChildren()) if (c is Path2D p) _paths.Add(p); - for (int i = 0; i < 10; i++) - SpawnWithDelay(i * 0.33f); + // for (int i = 0; i < 10; i++) + // SpawnWithDelay(i * 0.33f); } - private async void SpawnWithDelay(float t) + public async void SpawnWithDelay(float t) { await ToSignal(GetTree().CreateTimer(t), SceneTreeTimer.SignalName.Timeout); Spawn(); diff --git a/Scripts/Misc/Floating.gd b/Scripts/Misc/Floating.gd new file mode 100644 index 0000000..6cee002 --- /dev/null +++ b/Scripts/Misc/Floating.gd @@ -0,0 +1,16 @@ +extends Node2D + +@export var float_height := 2.0 +@export var float_speed := 1.25 + +var start_y := 0.0 +var time := 0.0 +var phase := 0.0 + +func _ready(): + start_y = position.y + phase = randf() * TAU # Random value between 0–2π + +func _process(delta): + time += delta * float_speed + position.y = start_y + sin(time + phase) * float_height \ No newline at end of file diff --git a/Scripts/Misc/Floating.gd.uid b/Scripts/Misc/Floating.gd.uid new file mode 100644 index 0000000..85c2361 --- /dev/null +++ b/Scripts/Misc/Floating.gd.uid @@ -0,0 +1 @@ +uid://dxcke7geb20dm diff --git a/Scripts/Projectiles/ProjectilePool.cs b/Scripts/Projectiles/ProjectilePool.cs index fa4f1f4..580b83a 100644 --- a/Scripts/Projectiles/ProjectilePool.cs +++ b/Scripts/Projectiles/ProjectilePool.cs @@ -26,14 +26,16 @@ public partial class ProjectilePool : Node public Projectile Get() { - var p = _pool.Count > 0 ? _pool.Dequeue() : CreateProjectile(); - return p; + // var p = _pool.Count > 0 ? _pool.Dequeue() : CreateProjectile(); + // return p; + return CreateProjectile(); } private void ReturnToPool(Projectile p) { p.GetParent()?.RemoveChild(p); - p.ProcessMode = ProcessModeEnum.Disabled; - _pool.Enqueue(p); + p.QueueFree(); + // p.ProcessMode = ProcessModeEnum.Disabled; + // _pool.Enqueue(p); } } \ No newline at end of file diff --git a/Scripts/Turrets/DragArea.cs b/Scripts/Turrets/DragArea.cs new file mode 100644 index 0000000..ec401f7 --- /dev/null +++ b/Scripts/Turrets/DragArea.cs @@ -0,0 +1,12 @@ +using Godot; + +public partial class DragArea : Area2D +{ + public override void _InputEvent(Viewport viewport, InputEvent @event, int shapeIdx) + { + if (@event is InputEventMouseButton mb && mb.Pressed) + { + GD.Print("Area clicked"); + } + } +} \ No newline at end of file diff --git a/Scripts/Turrets/DragArea.cs.uid b/Scripts/Turrets/DragArea.cs.uid new file mode 100644 index 0000000..0da5a7b --- /dev/null +++ b/Scripts/Turrets/DragArea.cs.uid @@ -0,0 +1 @@ +uid://bwgxw6ox8b1tq diff --git a/Scripts/Turrets/DragMover.cs b/Scripts/Turrets/DragMover.cs new file mode 100644 index 0000000..c77490c --- /dev/null +++ b/Scripts/Turrets/DragMover.cs @@ -0,0 +1,76 @@ +using Godot; + +public partial class DragMover : Node +{ + [Export] public Node2D Parent; // The node that will move + [Export] public Area2D DragArea; // Click detection + [Export] public Area2D CheckArea; // Overlap validation + [Export] public Area2D ShootArea; // This gets disabled while dragging + + private bool _dragging; + private Vector2 _dragOffset; + private Vector2 _originalPosition; + + private bool _canMove = true; + + public override void _Ready() + { + if (Parent == null || DragArea == null || CheckArea == null) + { + GD.PushError("DragMover exports are not assigned."); + return; + } + + DragArea.InputEvent += OnDragAreaInputEvent; + _originalPosition = Parent.GlobalPosition; + } + + private void OnDragAreaInputEvent(Node viewport, InputEvent @event, long shapeIdx) + { + if (!_canMove) return; + if (@event is not InputEventMouseButton mb) return; + if (mb.ButtonIndex != MouseButton.Left) return; + + if (mb.Pressed) + { + _dragging = true; + ShootArea.Monitoring = false; + _originalPosition = Parent.GlobalPosition; + + _dragOffset = Parent.GlobalPosition - Parent.GetGlobalMousePosition(); + } + else + { + _dragging = false; + ShootArea.Monitoring = true; + + // Check overlaps when released + if (CheckArea.HasOverlappingAreas() || CheckArea.HasOverlappingBodies()) + { + Parent.GlobalPosition = _originalPosition; + } + else + { + MovementDelay(); + } + } + } + + public override void _Process(double delta) + { + if (!_dragging) return; + + Parent.GlobalPosition = Parent.GetGlobalMousePosition() + _dragOffset; + } + + private async void MovementDelay() + { + ShootArea.Monitoring = false; + _canMove = false; + Parent.SetModulate(Color.FromHtml("ffffff20")); + await ToSignal(GetTree().CreateTimer(4), SceneTreeTimer.SignalName.Timeout); + Parent.SetModulate(Color.FromHtml("ffffffff")); + ShootArea.Monitoring = true; + _canMove = true; + } +} \ No newline at end of file diff --git a/Scripts/Turrets/DragMover.cs.uid b/Scripts/Turrets/DragMover.cs.uid new file mode 100644 index 0000000..ab86ead --- /dev/null +++ b/Scripts/Turrets/DragMover.cs.uid @@ -0,0 +1 @@ +uid://bpqof3jshxnug diff --git a/Scripts/Turrets/Turret.cs b/Scripts/Turrets/Turret.cs index 14ad467..cec777e 100644 --- a/Scripts/Turrets/Turret.cs +++ b/Scripts/Turrets/Turret.cs @@ -11,6 +11,7 @@ public partial class Turret : Node [Export] private float _fireRate; [Export] private Node2D _parent; [Export] private ProjectilePool _projectilePool; + [Export] private AudioStreamPlayer2D _audio; private float _fireTimer = 0f; private HashSet _enemiesInRange = new HashSet(); @@ -26,7 +27,6 @@ public partial class Turret : Node if (enemyHitBox is EnemyArea earea) { _enemiesInRange.Add(earea.Enemy); - GD.Print(earea.Name); } } @@ -35,7 +35,6 @@ public partial class Turret : Node if (enemyHitBox is EnemyArea earea) { _enemiesInRange.Remove(earea.Enemy); - GD.Print(earea.Name); } } @@ -45,6 +44,8 @@ public partial class Turret : Node _fireTimer += (float)delta; if (!(_fireTimer >= 1f / _fireRate)) return; _fireTimer = 0; + _audio?.SetPitchScale(RandomHelper.Float(0.8f, 1.2f)); + _audio?.Play(); var t = Helpers.GetClosest(_parent,_enemiesInRange.ToArray()); var dir = (t.GlobalPosition - _parent.GlobalPosition).Normalized(); var proj = _projectilePool.Get(); diff --git a/Scripts/Turrets/TurretController.cs b/Scripts/Turrets/TurretController.cs index 7ea1cf9..c614b86 100644 --- a/Scripts/Turrets/TurretController.cs +++ b/Scripts/Turrets/TurretController.cs @@ -1,8 +1,78 @@ +using System; using Godot; +using Godot.Collections; -namespace fgj26.Scripts.Turrets; +public enum TurretType +{ + Kitsune, + Oni, + Tengu +} public partial class TurretController : Node2D { - -} \ No newline at end of file + [Export] private Dictionary _typeToPrefab; + [Export] private Dictionary _typeToPlaceholder; + [Export] private Node2D _turretParent; + + [Signal] + public delegate void PlaceTurretEventHandler(TurretType t); + + private bool _placingTurret = false; + + private TurretPlaceholder _turretPlaceholder; + private TurretType _currentlyPlacingType; + + public override void _Ready() + { + PlaceTurret += StartPlaceingTurret; + } + + public override void _Input(InputEvent @event) + { + if (_turretPlaceholder == null) return; + if (!_placingTurret) return; + var mpos = GetGlobalMousePosition(); + _turretPlaceholder.GlobalPosition = mpos; + if (@event is InputEventMouseButton mb) + { + switch (mb.ButtonIndex) + { + case MouseButton.Left: + if (!_turretPlaceholder.CanPlace) return; + if (!GameController.Instance.TryRemoveCurrency(_turretPlaceholder.Cost)) return; + var newT = _typeToPrefab[_currentlyPlacingType].Instantiate() as Node2D; + _turretParent.AddChild(newT); + newT.GlobalPosition = mpos; + break; + case MouseButton.Right: + break; + default: + return; + } + StopPlacingTurret(); + } + } + + private void StartPlaceingTurret(TurretType t) + { + if (_turretPlaceholder != null) + { + _turretPlaceholder.GetParent()?.RemoveChild(_turretPlaceholder); + _turretPlaceholder.QueueFree(); + } + + _turretPlaceholder = _typeToPlaceholder[t].Instantiate() as TurretPlaceholder; + _turretParent.AddChild(_turretPlaceholder); + _currentlyPlacingType = t; + _placingTurret = true; + } + + private void StopPlacingTurret() + { + _turretPlaceholder.GetParent()?.RemoveChild(_turretPlaceholder); + _turretPlaceholder.QueueFree(); + _turretPlaceholder = null; + _placingTurret = false; + } +} diff --git a/Scripts/Turrets/TurretPlaceholder.cs b/Scripts/Turrets/TurretPlaceholder.cs new file mode 100644 index 0000000..6f6af77 --- /dev/null +++ b/Scripts/Turrets/TurretPlaceholder.cs @@ -0,0 +1,15 @@ +using Godot; + +public partial class TurretPlaceholder : Node2D +{ + [Export] private Area2D _placementChecker; + [Export] public int Cost = 75; + + public bool CanPlace { get; private set; } + + public override void _Process(double delta) + { + CanPlace = !_placementChecker.HasOverlappingAreas() && !_placementChecker.HasOverlappingBodies(); + SetModulate(CanPlace ? Color.FromHtml("ffffff80") : Color.FromHtml("ff000080")); + } +} \ No newline at end of file diff --git a/Scripts/Turrets/TurretPlaceholder.cs.uid b/Scripts/Turrets/TurretPlaceholder.cs.uid new file mode 100644 index 0000000..9878f95 --- /dev/null +++ b/Scripts/Turrets/TurretPlaceholder.cs.uid @@ -0,0 +1 @@ +uid://c4764ubjc3tan diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..5bfae49 --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,116 @@ +[preset.0] + +name="Windows Desktop" +platform="Windows Desktop" +runnable=true +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="Builds/Windows/kamenguardians.exe" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false +shader_baker/enabled=false +binary_format/architecture="x86_64" +codesign/enable=false +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=true +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" +application/export_angle=0 +application/export_d3d12=0 +application/d3d12_agility_sdk_multiarch=true +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' +$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' +$trigger = New-ScheduledTaskTrigger -Once -At 00:00 +$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries +$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings +Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true +Start-ScheduledTask -TaskName godot_remote_debug +while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" +ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue +Remove-Item -Recurse -Force '{temp_dir}'" +dotnet/include_scripts_content=false +dotnet/include_debug_symbols=true +dotnet/embed_build_outputs=false + +[preset.1] + +name="Linux" +platform="Linux" +runnable=true +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="Builds/Linux/kamenguardians.x86_64" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.1.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false +shader_baker/enabled=false +binary_format/architecture="x86_64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" +dotnet/include_scripts_content=false +dotnet/include_debug_symbols=true +dotnet/embed_build_outputs=false diff --git a/project.godot b/project.godot index dac1776..3ebd1a5 100644 --- a/project.godot +++ b/project.godot @@ -10,11 +10,20 @@ config_version=5 [application] -config/name="fgj26" +config/name="Kamen Guardians" +config/name_localized={ +"ja": "仮面の保護者" +} +config/version="0.0.1" run/main_scene="uid://csyk43kt3xbyx" config/features=PackedStringArray("4.5", "C#", "Forward Plus") +boot_splash/show_image=false config/icon="res://icon.svg" +[display] + +window/stretch/mode="viewport" + [dotnet] project/assembly_name="fgj26"