Added Fireball mechanic

pull/1/head
Artur David 2026-04-14 12:00:32 +02:00
parent abb24b227e
commit b89d2cc64d
29 changed files with 428 additions and 10 deletions

BIN
assets/.DS_Store vendored

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -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

View File

@ -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

View File

@ -10,7 +10,7 @@
[sub_resource type="Resource" id="Resource_gstla"] [sub_resource type="Resource" id="Resource_gstla"]
script = ExtResource("2_2npkn") script = ExtResource("2_2npkn")
drop = ExtResource("3_fd6lc") drop = ExtResource("3_fd6lc")
chance = 1.0 chance = 0.3
metadata/_custom_type_script = "uid://cjkaw7wqw4e30" metadata/_custom_type_script = "uid://cjkaw7wqw4e30"
[sub_resource type="AtlasTexture" id="AtlasTexture_v5wyi"] [sub_resource type="AtlasTexture" id="AtlasTexture_v5wyi"]

View File

@ -2,7 +2,7 @@
[ext_resource type="Script" uid="uid://lrvml2008cwk" path="res://scripts/witch.gd" id="1_b1vsk"] [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="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://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"] [ext_resource type="Texture2D" uid="uid://c2sji04ufhh60" path="res://assets/Cauldron's Brew/Cauldron and Powder.png" id="5_vid1f"]

View File

@ -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()

View File

@ -0,0 +1 @@
uid://bc8v4tndw5t1l

View File

@ -18,7 +18,7 @@ func _ready() -> void:
player = get_node("/root/Game/Player") player = get_node("/root/Game/Player")
pass # Replace with function body pass # Replace with function body
func _die(): func die():
is_dying = true is_dying = true
collision_layer = 0 collision_layer = 0
animated_sprite_2d.play("death") animated_sprite_2d.play("death")

View File

@ -0,0 +1,4 @@
extends ProjectileBase
# Called when the node enters the scene tree for the first time.

View File

@ -0,0 +1 @@
uid://c8mvxbub3ollv

View File

@ -6,7 +6,7 @@ extends EnemyBase
# Called every frame. 'delta' is the elapsed time since the previous frame.+ # Called every frame. 'delta' is the elapsed time since the previous frame.+
func _ready() -> void: func _ready() -> void:
super() super()
speed = 0.04 speed = 0.1
func _process(delta: float) -> void: func _process(delta: float) -> void:
if is_dying: if is_dying:
@ -18,5 +18,5 @@ func _on_area_2d_body_entered(body: Node2D) -> void:
if is_dying: if is_dying:
return return
if body == player: if body == player:
_die() die()
pass # Replace with function body. pass # Replace with function body.

View File

@ -2,20 +2,33 @@ extends CharacterBody2D
var camera var camera
var bar_progress = 0 var bar_progress = 0
var is_casting = false
var fireball = preload("res://scenes/fireball.tscn")
func _ready() -> void: func _ready() -> void:
camera = get_node("/root/Game/Camera2D") camera = get_node("/root/Game/Camera2D")
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
# Add the gravity. # Add the gravity.
pass pass
func _on_collect(DropsBase): func _on_collect(DropsBase):
if is_casting:
return
$CauldronBar.change_texture(bar_progress,3) $CauldronBar.change_texture(bar_progress,3)
bar_progress += 1 bar_progress += 1
if bar_progress == 3: if bar_progress == 3:
await $CauldronBar.ignite_cauldrons()
get_tree().call_group("enemies", "_die")
camera.shake(0.3,0.8)
bar_progress = 0 bar_progress = 0
is_casting = true
await $CauldronBar.ignite_cauldrons()
shoot_fireballs()
camera.shake(0.3,0.8)
$CauldronBar.reset_texture() $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)