diff --git a/Assets/Audio/Demons/wohoho.mp3 b/Assets/Audio/Demons/wohoho.mp3 new file mode 100644 index 0000000..6975623 Binary files /dev/null and b/Assets/Audio/Demons/wohoho.mp3 differ diff --git a/Assets/Audio/Demons/wohoho.mp3.import b/Assets/Audio/Demons/wohoho.mp3.import new file mode 100644 index 0000000..238956e --- /dev/null +++ b/Assets/Audio/Demons/wohoho.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://g78lo8s3varg" +path="res://.godot/imported/wohoho.mp3-c686d1b377ecc4b8214f6a0d5416f222.mp3str" + +[deps] + +source_file="res://Assets/Audio/Demons/wohoho.mp3" +dest_files=["res://.godot/imported/wohoho.mp3-c686d1b377ecc4b8214f6a0d5416f222.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Assets/Audio/Demons/wohoho2.mp3 b/Assets/Audio/Demons/wohoho2.mp3 new file mode 100644 index 0000000..0396c3a Binary files /dev/null and b/Assets/Audio/Demons/wohoho2.mp3 differ diff --git a/Assets/Audio/Demons/wohoho2.mp3.import b/Assets/Audio/Demons/wohoho2.mp3.import new file mode 100644 index 0000000..b4ad03f --- /dev/null +++ b/Assets/Audio/Demons/wohoho2.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://eddbr3wwhoi4" +path="res://.godot/imported/wohoho2.mp3-2d127fd3b88672e83c5cdecfd3337822.mp3str" + +[deps] + +source_file="res://Assets/Audio/Demons/wohoho2.mp3" +dest_files=["res://.godot/imported/wohoho2.mp3-2d127fd3b88672e83c5cdecfd3337822.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Assets/Audio/Demons/wohoho3.mp3 b/Assets/Audio/Demons/wohoho3.mp3 new file mode 100644 index 0000000..da44073 Binary files /dev/null and b/Assets/Audio/Demons/wohoho3.mp3 differ diff --git a/Assets/Audio/Demons/wohoho3.mp3.import b/Assets/Audio/Demons/wohoho3.mp3.import new file mode 100644 index 0000000..0ca140c --- /dev/null +++ b/Assets/Audio/Demons/wohoho3.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://bk2lhertq2t2h" +path="res://.godot/imported/wohoho3.mp3-f84ba635b9de35ea940649f48856107a.mp3str" + +[deps] + +source_file="res://Assets/Audio/Demons/wohoho3.mp3" +dest_files=["res://.godot/imported/wohoho3.mp3-f84ba635b9de35ea940649f48856107a.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Assets/Audio/Skeletons/skel1.mp3 b/Assets/Audio/Skeletons/skel1.mp3 new file mode 100644 index 0000000..22b9d0c Binary files /dev/null and b/Assets/Audio/Skeletons/skel1.mp3 differ diff --git a/Assets/Audio/Skeletons/skel1.mp3.import b/Assets/Audio/Skeletons/skel1.mp3.import new file mode 100644 index 0000000..2e468d1 --- /dev/null +++ b/Assets/Audio/Skeletons/skel1.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://b6je0ji5pdpj5" +path="res://.godot/imported/skel1.mp3-74ec5c9228e3bfa409594e10cc8c6735.mp3str" + +[deps] + +source_file="res://Assets/Audio/Skeletons/skel1.mp3" +dest_files=["res://.godot/imported/skel1.mp3-74ec5c9228e3bfa409594e10cc8c6735.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Assets/Audio/Skeletons/skel2.mp3 b/Assets/Audio/Skeletons/skel2.mp3 new file mode 100644 index 0000000..780b56b Binary files /dev/null and b/Assets/Audio/Skeletons/skel2.mp3 differ diff --git a/Assets/Audio/Skeletons/skel2.mp3.import b/Assets/Audio/Skeletons/skel2.mp3.import new file mode 100644 index 0000000..289576f --- /dev/null +++ b/Assets/Audio/Skeletons/skel2.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://brupxq7hfj8i4" +path="res://.godot/imported/skel2.mp3-e731eb92b2b6f2ce0f36134ac1bd23fa.mp3str" + +[deps] + +source_file="res://Assets/Audio/Skeletons/skel2.mp3" +dest_files=["res://.godot/imported/skel2.mp3-e731eb92b2b6f2ce0f36134ac1bd23fa.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Assets/Audio/Skeletons/skel3.mp3 b/Assets/Audio/Skeletons/skel3.mp3 new file mode 100644 index 0000000..dc9f8b7 Binary files /dev/null and b/Assets/Audio/Skeletons/skel3.mp3 differ diff --git a/Assets/Audio/Skeletons/skel3.mp3.import b/Assets/Audio/Skeletons/skel3.mp3.import new file mode 100644 index 0000000..d5e323a --- /dev/null +++ b/Assets/Audio/Skeletons/skel3.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://bsogb53c5uwgn" +path="res://.godot/imported/skel3.mp3-01ce8a79a24bed1a76e94fadb98e578a.mp3str" + +[deps] + +source_file="res://Assets/Audio/Skeletons/skel3.mp3" +dest_files=["res://.godot/imported/skel3.mp3-01ce8a79a24bed1a76e94fadb98e578a.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Assets/Audio/Skeletons/skel4.mp3 b/Assets/Audio/Skeletons/skel4.mp3 new file mode 100644 index 0000000..1a475b2 Binary files /dev/null and b/Assets/Audio/Skeletons/skel4.mp3 differ diff --git a/Assets/Audio/Skeletons/skel4.mp3.import b/Assets/Audio/Skeletons/skel4.mp3.import new file mode 100644 index 0000000..3d9513d --- /dev/null +++ b/Assets/Audio/Skeletons/skel4.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://b55uvfnjl7lbv" +path="res://.godot/imported/skel4.mp3-67f6f1bb57a9e364f6ef3d487643db29.mp3str" + +[deps] + +source_file="res://Assets/Audio/Skeletons/skel4.mp3" +dest_files=["res://.godot/imported/skel4.mp3-67f6f1bb57a9e364f6ef3d487643db29.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Assets/Audio/Wolves/mixkit-hellhound-monster-attack-dog-wolf-creature-3015.wav b/Assets/Audio/Wolves/mixkit-hellhound-monster-attack-dog-wolf-creature-3015.wav new file mode 100644 index 0000000..aeca13f Binary files /dev/null and b/Assets/Audio/Wolves/mixkit-hellhound-monster-attack-dog-wolf-creature-3015.wav differ diff --git a/Assets/Audio/Wolves/mixkit-hellhound-monster-attack-dog-wolf-creature-3015.wav.import b/Assets/Audio/Wolves/mixkit-hellhound-monster-attack-dog-wolf-creature-3015.wav.import new file mode 100644 index 0000000..8fbd4ea --- /dev/null +++ b/Assets/Audio/Wolves/mixkit-hellhound-monster-attack-dog-wolf-creature-3015.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://j1fxgwc22xsk" +path="res://.godot/imported/mixkit-hellhound-monster-attack-dog-wolf-creature-3015.wav-d4af4eef9fe00598d0249120fb4ddf48.sample" + +[deps] + +source_file="res://Assets/Audio/Wolves/mixkit-hellhound-monster-attack-dog-wolf-creature-3015.wav" +dest_files=["res://.godot/imported/mixkit-hellhound-monster-attack-dog-wolf-creature-3015.wav-d4af4eef9fe00598d0249120fb4ddf48.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=0 diff --git a/Assets/Audio/Wolves/mixkit-werewolf-roar-1730.mp3 b/Assets/Audio/Wolves/mixkit-werewolf-roar-1730.mp3 new file mode 100644 index 0000000..5bb23ff Binary files /dev/null and b/Assets/Audio/Wolves/mixkit-werewolf-roar-1730.mp3 differ diff --git a/Assets/Audio/Wolves/mixkit-werewolf-roar-1730.mp3.import b/Assets/Audio/Wolves/mixkit-werewolf-roar-1730.mp3.import new file mode 100644 index 0000000..cc729b8 --- /dev/null +++ b/Assets/Audio/Wolves/mixkit-werewolf-roar-1730.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://cvu0rfyj8amhi" +path="res://.godot/imported/mixkit-werewolf-roar-1730.mp3-0caa31d505b41e5558143fd7fb201f2a.mp3str" + +[deps] + +source_file="res://Assets/Audio/Wolves/mixkit-werewolf-roar-1730.mp3" +dest_files=["res://.godot/imported/mixkit-werewolf-roar-1730.mp3-0caa31d505b41e5558143fd7fb201f2a.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Assets/Audio/Wolves/mixkit-wolves-pack-howling-1776.wav b/Assets/Audio/Wolves/mixkit-wolves-pack-howling-1776.wav new file mode 100644 index 0000000..d932e12 Binary files /dev/null and b/Assets/Audio/Wolves/mixkit-wolves-pack-howling-1776.wav differ diff --git a/Assets/Audio/Wolves/mixkit-wolves-pack-howling-1776.wav.import b/Assets/Audio/Wolves/mixkit-wolves-pack-howling-1776.wav.import new file mode 100644 index 0000000..b8d7191 --- /dev/null +++ b/Assets/Audio/Wolves/mixkit-wolves-pack-howling-1776.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://beuuur3tlsjrp" +path="res://.godot/imported/mixkit-wolves-pack-howling-1776.wav-d747b7898a86acf89b0edf9ecb106da5.sample" + +[deps] + +source_file="res://Assets/Audio/Wolves/mixkit-wolves-pack-howling-1776.wav" +dest_files=["res://.godot/imported/mixkit-wolves-pack-howling-1776.wav-d747b7898a86acf89b0edf9ecb106da5.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=0 diff --git a/Assets/Audio/cave_ambience.mp3.import b/Assets/Audio/cave_ambience.mp3.import index 85060ed..42660a3 100644 --- a/Assets/Audio/cave_ambience.mp3.import +++ b/Assets/Audio/cave_ambience.mp3.import @@ -2,7 +2,7 @@ importer="mp3" type="AudioStreamMP3" -uid="uid://bdkt27mbfvuxs" +uid="uid://cehvi30d0pbnw" path="res://.godot/imported/cave_ambience.mp3-23c57d78230ea4df31beca4244197df4.mp3str" [deps] diff --git a/Scenes/Levels/level_1.tscn b/Scenes/Levels/level_1.tscn index 7d09f92..b288a14 100644 --- a/Scenes/Levels/level_1.tscn +++ b/Scenes/Levels/level_1.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" path="res://Scripts/level.gd" id="1_0nmok"] [ext_resource type="PackedScene" uid="uid://b8s2seg2lf7wo" path="res://Scenes/Tilemaps/tileset_1.tscn" id="1_4n82n"] [ext_resource type="PackedScene" uid="uid://cl7w6ndvons1a" path="res://Scenes/Props/candle_1.tscn" id="2_5hdq4"] -[ext_resource type="PackedScene" uid="uid://by2xmwcng01uy" path="res://Scenes/Props/candle_2.tscn" id="2_o33c4"] +[ext_resource type="PackedScene" uid="uid://cf7al5uln33rn" path="res://Scenes/Props/candle_2.tscn" id="2_o33c4"] [ext_resource type="PackedScene" uid="uid://b5lnjonlf4i1b" path="res://Scenes/enemy.tscn" id="4_g0oey"] [ext_resource type="PackedScene" uid="uid://0onqgygm832d" path="res://Scenes/Player/player.tscn" id="5_ik47y"] [ext_resource type="AudioStream" uid="uid://c3dy35dv368ft" path="res://Assets/Music/SisNeufPiDoozHuit.mp3" id="7_but47"] diff --git a/Scenes/Spawnables/bat_spawnable.tscn b/Scenes/Spawnables/bat_spawnable.tscn index 98e233e..0887499 100644 --- a/Scenes/Spawnables/bat_spawnable.tscn +++ b/Scenes/Spawnables/bat_spawnable.tscn @@ -1,8 +1,13 @@ -[gd_scene load_steps=5 format=3 uid="uid://brnx3xyyd0e71"] +[gd_scene load_steps=10 format=3 uid="uid://brnx3xyyd0e71"] [ext_resource type="PackedScene" uid="uid://kkfxguj0lr5a" path="res://Scenes/Spawnables/template_spawnable.tscn" id="1_verf7"] [ext_resource type="Texture2D" uid="uid://ddvr5ltbo8ome" path="res://Assets/Bat/noBKG_BatFlight_strip.png" id="2_0p8tq"] [ext_resource type="Script" path="res://Scenes/Spawnables/AIs/ai_bat.gd" id="2_x3ldf"] +[ext_resource type="AudioStream" uid="uid://cy210ijd2v1dt" path="res://Assets/Audio/Bats/bat_spawn1.mp3" id="4_23i1n"] +[ext_resource type="AudioStream" uid="uid://cgtd1h5ewkq5d" path="res://Assets/Audio/Bats/bat_spawn2.mp3" id="5_lxf0c"] +[ext_resource type="AudioStream" uid="uid://dbwrhm30srugh" path="res://Assets/Audio/Bats/bat_spawn3.mp3" id="6_i83i4"] +[ext_resource type="AudioStream" uid="uid://gd8crqxuiivn" path="res://Assets/Audio/Bats/bat_spawn4.mp3" id="7_hh1mb"] +[ext_resource type="AudioStream" uid="uid://dyl0goef8y6bu" path="res://Assets/Audio/Bats/bat_spawn5.mp3" id="8_o2d7p"] [sub_resource type="AtlasTexture" id="AtlasTexture_bnd0j"] atlas = ExtResource("2_0p8tq") @@ -26,3 +31,18 @@ frame_progress = 0.482614 [node name="AI" parent="." index="5"] script = ExtResource("2_x3ldf") + +[node name="Spawn1" parent="." index="8"] +stream = ExtResource("4_23i1n") + +[node name="Spawn2" parent="." index="9"] +stream = ExtResource("5_lxf0c") + +[node name="Spawn3" parent="." index="10"] +stream = ExtResource("6_i83i4") + +[node name="Spawn4" parent="." index="11"] +stream = ExtResource("7_hh1mb") + +[node name="Spawn5" parent="." index="12"] +stream = ExtResource("8_o2d7p") diff --git a/Scenes/Spawnables/template_spawnable.gd b/Scenes/Spawnables/template_spawnable.gd index ec00ee2..407b280 100644 --- a/Scenes/Spawnables/template_spawnable.gd +++ b/Scenes/Spawnables/template_spawnable.gd @@ -3,6 +3,8 @@ extends CharacterBody2D const ATTACK_COOLDOWN : float = 100 +var rng = RandomNumberGenerator.new() + @export var maxHp : int = 0 @export var attackSpeed : float = 0 @export var speed : float = 0 @@ -22,6 +24,9 @@ const ATTACK_COOLDOWN : float = 100 @onready var damageCollision : CollisionShape2D = $DamageArea/DamageCollision @onready var bodyCollision : CollisionShape2D = $BodyCollision @onready var spawnableUI : Control = $UIContainer/SpawnableUI +@onready var spawnSnd: Array = [ $Spawn1, $Spawn2, $Spawn3, $Spawn4, $Spawn5 ] +@onready var hitSnd: Array = [ $Hit1, $Hit2, $Hit3, $Hit4, $Hit5 ] +@onready var dieSnd: Array = [ $Die1, $Die2, $Die3, $Die4, $Die5 ] var isAlive : bool = true var isFacingLeft : bool = false @@ -88,6 +93,8 @@ func endAttack(): animatedSprite.play("default") func receive_damage(dmg): + if hitSnd: + hitSnd[rng.randi_range(0,4)].play(); if !isAlive: return if currentHp - dmg <= 0: @@ -98,6 +105,8 @@ func receive_damage(dmg): spawnableUI.setHP(currentHp, maxHp) func die(): + if dieSnd: + dieSnd[rng.randi_range(0,4)].play(); enemy.remove_foe(self) signal_death.emit(self) bodyCollision.disabled = true @@ -123,3 +132,9 @@ func clean(): func _on_damage_area_body_entered(body): if body == enemy: body.receive_damage(damage) + + +func _on_tree_entered(): + if spawnSnd: + spawnSnd[rng.randi_range(0,4)].play(); + diff --git a/Scenes/Spawnables/template_spawnable.tscn b/Scenes/Spawnables/template_spawnable.tscn index a54ba91..b4bdcb9 100644 --- a/Scenes/Spawnables/template_spawnable.tscn +++ b/Scenes/Spawnables/template_spawnable.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=39 format=3 uid="uid://kkfxguj0lr5a"] +[gd_scene load_steps=40 format=3 uid="uid://kkfxguj0lr5a"] [ext_resource type="Script" path="res://Scenes/Spawnables/template_spawnable.gd" id="1_rkej7"] [ext_resource type="Texture2D" uid="uid://f60ndepwmpj2" path="res://Assets/Bat/noBKG_BatAttack_strip.png" id="2_7ayi7"] [ext_resource type="Texture2D" uid="uid://bd74k1s6qdx2r" path="res://Assets/Bat/noBKG_BatDeath_strip.png" id="3_jipj7"] [ext_resource type="Texture2D" uid="uid://ddvr5ltbo8ome" path="res://Assets/Bat/noBKG_BatFlight_strip.png" id="4_u36ok"] [ext_resource type="PackedScene" uid="uid://fojbwshce7ah" path="res://Scenes/Spawnables/UI/SpawnableUI.tscn" id="5_c2blu"] +[ext_resource type="AudioStream" uid="uid://c5llasu6omp0p" path="res://Assets/Audio/punch-140236.mp3" id="6_jg6bm"] [sub_resource type="AtlasTexture" id="AtlasTexture_y0lcs"] atlas = ExtResource("2_7ayi7") @@ -289,4 +290,45 @@ debug_color = Color(0.639216, 0, 0.156863, 0.419608) [node name="LightOccluder2D" type="LightOccluder2D" parent="."] occluder = SubResource("OccluderPolygon2D_qtt12") +[node name="Spawn1" type="AudioStreamPlayer2D" parent="."] + +[node name="Spawn2" type="AudioStreamPlayer2D" parent="."] + +[node name="Spawn3" type="AudioStreamPlayer2D" parent="."] + +[node name="Spawn4" type="AudioStreamPlayer2D" parent="."] + +[node name="Spawn5" type="AudioStreamPlayer2D" parent="."] + +[node name="Hit1" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("6_jg6bm") +pitch_scale = 1.78 + +[node name="Hit2" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("6_jg6bm") +pitch_scale = 2.51 + +[node name="Hit3" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("6_jg6bm") +pitch_scale = 1.3 + +[node name="Hit4" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("6_jg6bm") +pitch_scale = 1.68 + +[node name="Hit5" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("6_jg6bm") +pitch_scale = 1.17 + +[node name="Die1" type="AudioStreamPlayer2D" parent="."] + +[node name="Die2" type="AudioStreamPlayer2D" parent="."] + +[node name="Die3" type="AudioStreamPlayer2D" parent="."] + +[node name="Die4" type="AudioStreamPlayer2D" parent="."] + +[node name="Die5" type="AudioStreamPlayer2D" parent="."] + +[connection signal="tree_entered" from="." to="." method="_on_tree_entered"] [connection signal="body_entered" from="DamageArea" to="." method="_on_damage_area_body_entered"] diff --git a/Scenes/Spawnables/wolf_spawnable.tscn b/Scenes/Spawnables/wolf_spawnable.tscn index c779855..7fefc11 100644 --- a/Scenes/Spawnables/wolf_spawnable.tscn +++ b/Scenes/Spawnables/wolf_spawnable.tscn @@ -1,11 +1,14 @@ -[gd_scene load_steps=55 format=3 uid="uid://35re5c6wyhp5"] +[gd_scene load_steps=58 format=3 uid="uid://cwlfq7dnrtgh7"] [ext_resource type="PackedScene" uid="uid://kkfxguj0lr5a" path="res://Scenes/Spawnables/template_spawnable.tscn" id="1_t7ryl"] [ext_resource type="Texture2D" uid="uid://bnch5lviqbpka" path="res://Assets/Wolf/noBKG_WolfRun_strip.png" id="2_35toa"] [ext_resource type="Texture2D" uid="uid://bvscc18reoyoo" path="res://Assets/Wolf/noBKG_WolfAttack_strip.png" id="2_arbvu"] [ext_resource type="Texture2D" uid="uid://dd1cbeyvlpn53" path="res://Assets/Wolf/noBKG_WolfIdle_strip.png" id="2_bk8d7"] [ext_resource type="Texture2D" uid="uid://cowhod231qvc7" path="res://Assets/Wolf/noBKG_WolfDeath_strip.png" id="3_tbpyw"] +[ext_resource type="AudioStream" uid="uid://j1fxgwc22xsk" path="res://Assets/Audio/Wolves/mixkit-hellhound-monster-attack-dog-wolf-creature-3015.wav" id="6_1imso"] [ext_resource type="Script" path="res://Scenes/Spawnables/AIs/ai_bat.gd" id="6_g2ost"] +[ext_resource type="AudioStream" uid="uid://cvu0rfyj8amhi" path="res://Assets/Audio/Wolves/mixkit-werewolf-roar-1730.mp3" id="7_brppl"] +[ext_resource type="AudioStream" uid="uid://beuuur3tlsjrp" path="res://Assets/Audio/Wolves/mixkit-wolves-pack-howling-1776.wav" id="8_k62ik"] [sub_resource type="AtlasTexture" id="AtlasTexture_n1jpo"] atlas = ExtResource("2_bk8d7") @@ -355,7 +358,7 @@ offset_bottom = 2.0 sprite_frames = SubResource("SpriteFrames_iknep") animation = &"default" frame = 0 -frame_progress = 0.398233 +frame_progress = 0.996176 [node name="BodyCollision" parent="." index="2"] shape = SubResource("CapsuleShape2D_oxc6d") @@ -374,3 +377,20 @@ script = ExtResource("6_g2ost") [node name="LightOccluder2D" parent="." index="7"] position = Vector2(3, 0) occluder = SubResource("OccluderPolygon2D_jmta4") + +[node name="Spawn1" parent="." index="8"] +stream = ExtResource("6_1imso") + +[node name="Spawn2" parent="." index="9"] +stream = ExtResource("7_brppl") + +[node name="Spawn3" parent="." index="10"] +stream = ExtResource("8_k62ik") + +[node name="Spawn4" parent="." index="11"] +stream = ExtResource("6_1imso") +pitch_scale = 0.83 + +[node name="Spawn5" parent="." index="12"] +stream = ExtResource("7_brppl") +pitch_scale = 0.8 diff --git a/Scenes/enemy.tscn b/Scenes/enemy.tscn index 97ff30e..081b990 100644 --- a/Scenes/enemy.tscn +++ b/Scenes/enemy.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=62 format=3 uid="uid://b5lnjonlf4i1b"] +[gd_scene load_steps=61 format=3 uid="uid://b5lnjonlf4i1b"] [ext_resource type="Script" path="res://Scripts/Enemy.gd" id="1_xj62t"] [ext_resource type="Texture2D" uid="uid://xn7yb3f5w17m" path="res://Assets/Knight/noBKG_KnightAttack_strip.png" id="2_dclcl"] @@ -11,9 +11,6 @@ [ext_resource type="AudioStream" uid="uid://dj7884l6tki3g" path="res://Assets/Audio/whoosh.ogg" id="8_ygdkj"] [ext_resource type="AudioStream" uid="uid://bmu622w5ea05y" path="res://Assets/Audio/mixkit-weak-fast-blow-2145.wav" id="9_myh6x"] -[sub_resource type="OccluderPolygon2D" id="OccluderPolygon2D_xq5nx"] -polygon = PackedVector2Array(-2, 11, 2, 2, 2, -7, 0, -18, -5, -18, -6, -7, -6, 1) - [sub_resource type="AtlasTexture" id="AtlasTexture_6gjg8"] atlas = ExtResource("2_dclcl") region = Rect2(1296, 0, 144, 64) @@ -382,10 +379,6 @@ position = Vector2(10, 10) collision_layer = 5 collision_mask = 5 script = ExtResource("1_xj62t") -maxhp = 50 - -[node name="LightOccluder2D" type="LightOccluder2D" parent="."] -occluder = SubResource("OccluderPolygon2D_xq5nx") [node name="Sprite" type="AnimatedSprite2D" parent="."] sprite_frames = SubResource("SpriteFrames_dqf8u") @@ -456,7 +449,6 @@ position = Vector2(0, -3) shape = SubResource("CapsuleShape2D_p2hkm") [node name="AttackArea" type="Area2D" parent="."] -visible = false collision_layer = 2 collision_mask = 2 diff --git a/Scripts/Enemy.gd b/Scripts/Enemy.gd index 5d96b42..3ba6567 100644 --- a/Scripts/Enemy.gd +++ b/Scripts/Enemy.gd @@ -15,7 +15,7 @@ extends CharacterBody2D @export var state: String = "Idle" @export var damage: int = 5 @export var maxAtks: int = 1 -@export var maxcooldown: float = 0.5 +@export var maxcooldown: float = 0.75 @onready var currentcooldown: float = 0 @onready var killcount: int = 0 @@ -102,30 +102,44 @@ func _process(delta): func processAI(objs): var vec: Vector2 = Vector2(0,0) + var skel = false var weight: int = 0 if hp <= 0: return vec for obj in objs: if !obj || !obj.isAlive: continue - if position.distance_to(obj.position) > 50: - weight = abs(obj.priority) * position.distance_to(obj.position) - vec += weight * position.direction_to(obj.position) - else: - weight = obj.priority * position.distance_to(obj.position) * ((maxhp + 1) / hp) + if position.distance_to(obj.position) < 25: + if obj.priority == 10: + vec += position.direction_to(obj.position) * 30 + if currentcooldown <= 0: + attack() + currentcooldown = maxcooldown + weight = obj.priority * position.distance_to(obj.position) * ((maxhp + 1) / hp) * 1.25 vec = weight * -position.direction_to(obj.position) if currentcooldown <= 0: attack() currentcooldown = maxcooldown + else: + if obj.priority == 10: + skel = true + vec = position.direction_to(obj.position) * 10 + if currentcooldown <= 0: + attack() + currentcooldown = maxcooldown + break + weight = abs(obj.priority) * position.distance_to(obj.position) + vec += weight * position.direction_to(obj.position) + - if vec.length() < 5 && objs.size() > 1: + if vec.length() < 5 && objs.size() > 1 && !skel: vec.y *= 3 - if velocity.length() < 95 && objs.size() > 1: + if velocity.length() < 95 && objs.size() > 1 && !skel: vec.y += 10 vec.x += 5 - return vec.normalized() * 100 + return vec.normalized() * 1000 func attack(): @@ -192,7 +206,7 @@ func setLevel(lvl): maxAtks = 2 maxhp += 5 - hp += 10 + hp += 5 * level + 5 if hp > maxhp: hp = maxhp diff --git a/Scripts/level.gd b/Scripts/level.gd index 1975d2b..fd67e8e 100644 --- a/Scripts/level.gd +++ b/Scripts/level.gd @@ -3,7 +3,7 @@ extends Node2D var length: int = 0 var time: int = 0 var countdown: float = 0 -@onready var player: Player = $Player +@onready var player:= $Player # Called when the node enters the scene tree for the first time. func _ready():