diff --git a/assets/.DS_Store b/assets/.DS_Store index 0e7aa53..4f8ab40 100644 Binary files a/assets/.DS_Store and b/assets/.DS_Store differ diff --git a/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_00.png b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_00.png new file mode 100644 index 0000000..06ecd23 Binary files /dev/null and b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_00.png differ diff --git a/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_00.png.import b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_00.png.import new file mode 100644 index 0000000..8826a31 --- /dev/null +++ b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_00.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b7o85cjwf4ufr" +path="res://.godot/imported/All_Fire_Bullet_Pixel_16x16_00.png-dd76ed3dd257fba4f4b9597e00d575ef.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_00.png" +dest_files=["res://.godot/imported/All_Fire_Bullet_Pixel_16x16_00.png-dd76ed3dd257fba4f4b9597e00d575ef.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/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_01.png b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_01.png new file mode 100644 index 0000000..47c9e18 Binary files /dev/null and b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_01.png differ diff --git a/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_01.png.import b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_01.png.import new file mode 100644 index 0000000..df3c591 --- /dev/null +++ b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_01.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cdktimg5axaxj" +path="res://.godot/imported/All_Fire_Bullet_Pixel_16x16_01.png-9623eb22cec002ae02ffc0151424fcba.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_01.png" +dest_files=["res://.godot/imported/All_Fire_Bullet_Pixel_16x16_01.png-9623eb22cec002ae02ffc0151424fcba.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/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_02.png b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_02.png new file mode 100644 index 0000000..562b1c4 Binary files /dev/null and b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_02.png differ diff --git a/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_02.png.import b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_02.png.import new file mode 100644 index 0000000..898ced5 --- /dev/null +++ b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_02.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dimo6wv81xev4" +path="res://.godot/imported/All_Fire_Bullet_Pixel_16x16_02.png-1b0c5a5d004c8c6cd81b4232eb7e86d6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_02.png" +dest_files=["res://.godot/imported/All_Fire_Bullet_Pixel_16x16_02.png-1b0c5a5d004c8c6cd81b4232eb7e86d6.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/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_03.png b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_03.png new file mode 100644 index 0000000..d5f1fa0 Binary files /dev/null and b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_03.png differ diff --git a/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_03.png.import b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_03.png.import new file mode 100644 index 0000000..0bc216f --- /dev/null +++ b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_03.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c6556wc8aeoon" +path="res://.godot/imported/All_Fire_Bullet_Pixel_16x16_03.png-6aea9439276c5079773bc5d83a19cea0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_03.png" +dest_files=["res://.godot/imported/All_Fire_Bullet_Pixel_16x16_03.png-6aea9439276c5079773bc5d83a19cea0.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/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_04.png b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_04.png new file mode 100644 index 0000000..3ed9b85 Binary files /dev/null and b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_04.png differ diff --git a/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_04.png.import b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_04.png.import new file mode 100644 index 0000000..0de1416 --- /dev/null +++ b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_04.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d2f3o70i2rrks" +path="res://.godot/imported/All_Fire_Bullet_Pixel_16x16_04.png-4309b475d9a08d509e7ca75b70029ea2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_04.png" +dest_files=["res://.godot/imported/All_Fire_Bullet_Pixel_16x16_04.png-4309b475d9a08d509e7ca75b70029ea2.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/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_05.png b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_05.png new file mode 100644 index 0000000..9577dff Binary files /dev/null and b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_05.png differ diff --git a/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_05.png.import b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_05.png.import new file mode 100644 index 0000000..1bb4ea7 --- /dev/null +++ b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_05.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dxox0vjihmukh" +path="res://.godot/imported/All_Fire_Bullet_Pixel_16x16_05.png-b897740a5baff95dab545f097bcfa906.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_05.png" +dest_files=["res://.godot/imported/All_Fire_Bullet_Pixel_16x16_05.png-b897740a5baff95dab545f097bcfa906.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/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_06.png b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_06.png new file mode 100644 index 0000000..806ac0e Binary files /dev/null and b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_06.png differ diff --git a/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_06.png.import b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_06.png.import new file mode 100644 index 0000000..cfb7556 --- /dev/null +++ b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_06.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://tplw7i2740ph" +path="res://.godot/imported/All_Fire_Bullet_Pixel_16x16_06.png-7182fe6d0c38ac43208e33a537b085d9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_06.png" +dest_files=["res://.godot/imported/All_Fire_Bullet_Pixel_16x16_06.png-7182fe6d0c38ac43208e33a537b085d9.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/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_07.png b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_07.png new file mode 100644 index 0000000..8998356 Binary files /dev/null and b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_07.png differ diff --git a/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_07.png.import b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_07.png.import new file mode 100644 index 0000000..d6c1942 --- /dev/null +++ b/assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_07.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dbmb6h77x0lnw" +path="res://.godot/imported/All_Fire_Bullet_Pixel_16x16_07.png-ab110ee837b254ed80e84d05e3dd8f43.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_07.png" +dest_files=["res://.godot/imported/All_Fire_Bullet_Pixel_16x16_07.png-ab110ee837b254ed80e84d05e3dd8f43.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/scenes/fireball.tscn b/scenes/fireball.tscn new file mode 100644 index 0000000..3ca25ec --- /dev/null +++ b/scenes/fireball.tscn @@ -0,0 +1,53 @@ +[gd_scene format=3 uid="uid://0ob28o8i2o8x"] + +[ext_resource type="Script" uid="uid://c8mvxbub3ollv" path="res://scripts/fireball.gd" id="1_1gl40"] +[ext_resource type="Texture2D" uid="uid://b7o85cjwf4ufr" path="res://assets/Fire Pixel Bullet 16x16/All_Fire_Bullet_Pixel_16x16_00.png" id="2_cb14k"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_7kba2"] +radius = 7.0 + +[sub_resource type="AtlasTexture" id="AtlasTexture_43lgj"] +atlas = ExtResource("2_cb14k") +region = Rect2(576, 1, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vqoxj"] +atlas = ExtResource("2_cb14k") +region = Rect2(592, 1, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_86oub"] +atlas = ExtResource("2_cb14k") +region = Rect2(608, 1, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qaphm"] +atlas = ExtResource("2_cb14k") +region = Rect2(624, 1, 16, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_mi4h5"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_43lgj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vqoxj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_86oub") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qaphm") +}], +"loop": true, +"name": &"default", +"speed": 10.0 +}] + +[node name="Fireball" type="Area2D" unique_id=2100779306] +script = ExtResource("1_1gl40") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=546945368] +shape = SubResource("CircleShape2D_7kba2") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1117029857] +sprite_frames = SubResource("SpriteFrames_mi4h5") +frame_progress = 0.02371424 diff --git a/scenes/slime.tscn b/scenes/slime.tscn index 56895cc..bc63989 100644 --- a/scenes/slime.tscn +++ b/scenes/slime.tscn @@ -10,7 +10,7 @@ [sub_resource type="Resource" id="Resource_gstla"] script = ExtResource("2_2npkn") drop = ExtResource("3_fd6lc") -chance = 1.0 +chance = 0.3 metadata/_custom_type_script = "uid://cjkaw7wqw4e30" [sub_resource type="AtlasTexture" id="AtlasTexture_v5wyi"] diff --git a/scenes/witch.tscn b/scenes/witch.tscn index 0bae16d..2ec769d 100644 --- a/scenes/witch.tscn +++ b/scenes/witch.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" uid="uid://lrvml2008cwk" path="res://scripts/witch.gd" id="1_b1vsk"] [ext_resource type="Texture2D" uid="uid://dw8pn36yok5jq" path="res://assets/Witch/PNG/24x32/witch-002-SWEN.png" id="1_hgjeu"] -[ext_resource type="Script" uid="uid://cmsa82hi6q552" path="res://cauldron_bar.gd" id="3_53435"] +[ext_resource type="Script" uid="uid://cmsa82hi6q552" path="res://scripts/cauldron_bar.gd" id="3_53435"] [ext_resource type="Texture2D" uid="uid://484stlylp2nk" path="res://assets/Cauldron's Brew/Equiptment.png" id="4_qrkn2"] [ext_resource type="Texture2D" uid="uid://c2sji04ufhh60" path="res://assets/Cauldron's Brew/Cauldron and Powder.png" id="5_vid1f"] diff --git a/scripts/ProjectileBase.gd b/scripts/ProjectileBase.gd new file mode 100644 index 0000000..e27ea10 --- /dev/null +++ b/scripts/ProjectileBase.gd @@ -0,0 +1,26 @@ +extends Area2D +class_name ProjectileBase + +@export var size: float +var speed = 200 +@export var element: String +var direction: Vector2 + +func _ready() -> void: + body_entered.connect(_on_body_entered) + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + position += direction * speed * delta + +func launch(target: Vector2): + direction = global_position.direction_to(target) + +func _on_body_entered(body: Node2D) -> void: + if body.is_in_group("enemies"): + body.die() + queue_free() +func _remove(): + queue_free() diff --git a/scripts/ProjectileBase.gd.uid b/scripts/ProjectileBase.gd.uid new file mode 100644 index 0000000..591cd09 --- /dev/null +++ b/scripts/ProjectileBase.gd.uid @@ -0,0 +1 @@ +uid://bc8v4tndw5t1l diff --git a/cauldron_bar.gd b/scripts/cauldron_bar.gd similarity index 100% rename from cauldron_bar.gd rename to scripts/cauldron_bar.gd diff --git a/cauldron_bar.gd.uid b/scripts/cauldron_bar.gd.uid similarity index 100% rename from cauldron_bar.gd.uid rename to scripts/cauldron_bar.gd.uid diff --git a/scripts/enemy_base.gd b/scripts/enemy_base.gd index 8643661..66fe4fc 100644 --- a/scripts/enemy_base.gd +++ b/scripts/enemy_base.gd @@ -18,7 +18,7 @@ func _ready() -> void: player = get_node("/root/Game/Player") pass # Replace with function body -func _die(): +func die(): is_dying = true collision_layer = 0 animated_sprite_2d.play("death") diff --git a/scripts/fireball.gd b/scripts/fireball.gd new file mode 100644 index 0000000..6b7ac59 --- /dev/null +++ b/scripts/fireball.gd @@ -0,0 +1,4 @@ +extends ProjectileBase + + +# Called when the node enters the scene tree for the first time. diff --git a/scripts/fireball.gd.uid b/scripts/fireball.gd.uid new file mode 100644 index 0000000..a612d03 --- /dev/null +++ b/scripts/fireball.gd.uid @@ -0,0 +1 @@ +uid://c8mvxbub3ollv diff --git a/scripts/slime.gd b/scripts/slime.gd index 56f1b30..520a4ef 100644 --- a/scripts/slime.gd +++ b/scripts/slime.gd @@ -6,7 +6,7 @@ extends EnemyBase # Called every frame. 'delta' is the elapsed time since the previous frame.+ func _ready() -> void: super() - speed = 0.04 + speed = 0.1 func _process(delta: float) -> void: if is_dying: @@ -18,5 +18,5 @@ func _on_area_2d_body_entered(body: Node2D) -> void: if is_dying: return if body == player: - _die() + die() pass # Replace with function body. diff --git a/scripts/witch.gd b/scripts/witch.gd index 379bfb8..3d0ab65 100644 --- a/scripts/witch.gd +++ b/scripts/witch.gd @@ -2,20 +2,33 @@ extends CharacterBody2D var camera var bar_progress = 0 - +var is_casting = false +var fireball = preload("res://scenes/fireball.tscn") func _ready() -> void: camera = get_node("/root/Game/Camera2D") + func _physics_process(delta: float) -> void: # Add the gravity. pass func _on_collect(DropsBase): - + if is_casting: + return $CauldronBar.change_texture(bar_progress,3) bar_progress += 1 if bar_progress == 3: - await $CauldronBar.ignite_cauldrons() - get_tree().call_group("enemies", "_die") - camera.shake(0.3,0.8) bar_progress = 0 + is_casting = true + await $CauldronBar.ignite_cauldrons() + shoot_fireballs() + camera.shake(0.3,0.8) $CauldronBar.reset_texture() + is_casting = false + +func shoot_fireballs(): + var enemies = get_tree().get_nodes_in_group("enemies") + for enemy in enemies: + var fb = fireball.instantiate() + fb.global_position = global_position + get_parent().add_child(fb) + fb.launch(enemy.global_position)