Texture files + final knockback fix

This commit is contained in:
RealMelwei 2025-09-17 16:43:44 +02:00
parent fae00cfe1f
commit 5410aa51e4
17 changed files with 192 additions and 32 deletions

View file

@ -35,4 +35,4 @@ func _on_death():
self.queue_free()
func _on_damage_taken(_damage : int, dir: Vector2):
current_knockback = dir * knockback_weight
current_knockback = - dir * knockback_weight

View file

@ -7,4 +7,4 @@ var direction = Vector2(1,0)
func _physics_process(delta: float) -> void:
self.position += delta * speed * direction
for area in get_overlapping_areas():
area.hurt(damage, direction)
area.hurt(damage, -3 * direction)

View file

@ -17,6 +17,6 @@ scale = Vector2(3.1, 3.1)
shape = SubResource("CircleShape2D_gllxn")
[node name="Sprite2D" type="Sprite2D" parent="."]
modulate = Color(1, 0, 1, 1)
modulate = Color(0, 1, 0, 1)
scale = Vector2(0.45, 0.45)
texture = ExtResource("2_gllxn")

View file

@ -1,14 +1,17 @@
[gd_scene load_steps=4 format=3 uid="uid://xj0of571aur1"]
[gd_scene load_steps=7 format=3 uid="uid://xj0of571aur1"]
[ext_resource type="Script" uid="uid://b8em61mqgdi58" path="res://items/item_spawn.gd" id="1_ms6tn"]
[ext_resource type="PackedScene" uid="uid://b00185vygcka1" path="res://items/heal_item.tscn" id="2_w6i8k"]
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="3_5pwuf"]
[ext_resource type="PackedScene" uid="uid://gwctb2xqsbj" path="res://items/healthup.tscn" id="3_yi7ag"]
[ext_resource type="PackedScene" uid="uid://ddn025xnjngko" path="res://items/bow.tscn" id="4_v0ua0"]
[ext_resource type="PackedScene" uid="uid://ewe36lqcjojk" path="res://items/updash.tscn" id="5_uitgx"]
[node name="ItemSpawn" type="Node2D"]
script = ExtResource("1_ms6tn")
common_items = Array[PackedScene]([ExtResource("2_w6i8k")])
rare_items = Array[PackedScene]([ExtResource("2_w6i8k")])
unique_items = Array[PackedScene]([ExtResource("2_w6i8k")])
common_items = Array[PackedScene]([ExtResource("2_w6i8k"), ExtResource("3_yi7ag"), ExtResource("5_uitgx"), ExtResource("4_v0ua0")])
rare_items = Array[PackedScene]([ExtResource("4_v0ua0")])
unique_items = Array[PackedScene]([ExtResource("5_uitgx")])
metadata/_custom_type_script = "uid://b8em61mqgdi58"
[node name="EarthAligner" parent="." instance=ExtResource("3_5pwuf")]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://cxo6bq26huau7"]
[gd_scene load_steps=8 format=3 uid="uid://cxo6bq26huau7"]
[ext_resource type="PackedScene" uid="uid://cmaovvr15b3qk" path="res://player/player.tscn" id="2_1bvp3"]
[ext_resource type="Script" uid="uid://vgxh2xdevat7" path="res://world/earth.gd" id="2_lquwl"]
@ -7,14 +7,17 @@
[ext_resource type="PackedScene" uid="uid://73g8y37skebh" path="res://item_ui/item_ui.tscn" id="6_4c57u"]
[ext_resource type="PackedScene" uid="uid://cjsrtswk4vgf2" path="res://healthbar/healthbar.tscn" id="6_7mycd"]
[ext_resource type="PackedScene" uid="uid://dpdn2php3ydsv" path="res://death_screen/death_screen.tscn" id="7_5vw27"]
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://utils/platform.tscn" id="7_272bh"]
[ext_resource type="PackedScene" uid="uid://ddn025xnjngko" path="res://items/bow.tscn" id="9_4c57u"]
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost.tscn" id="9_kek77"]
[ext_resource type="PackedScene" uid="uid://dfva4dhflxglr" path="res://items/arrow.tscn" id="10_4c57u"]
[ext_resource type="PackedScene" uid="uid://gwctb2xqsbj" path="res://items/healthup.tscn" id="11_efxa6"]
[node name="main" type="Node2D"]
[node name="Layer0" type="Parallax2D" parent="."]
[node name="Layer1" type="Parallax2D" parent="."]
[node name="Layer2" type="Parallax2D" parent="."]
[node name="Layer3" type="Parallax2D" parent="."]
[node name="Earth" parent="." instance=ExtResource("3_lquwl")]
unique_name_in_owner = true
script = ExtResource("2_lquwl")
@ -36,7 +39,7 @@ zoom = Vector2(0.12, 0.12)
script = ExtResource("4_1bvp3")
[node name="Timer" type="Timer" parent="Building Generator"]
wait_time = 5.0
wait_time = 0.8
autostart = true
[node name="CanvasLayer" type="CanvasLayer" parent="."]
@ -50,22 +53,6 @@ offset_bottom = 128.0
[node name="DeathScreen" parent="CanvasLayer" instance=ExtResource("7_5vw27")]
visible = false
[node name="Platform" parent="." instance=ExtResource("7_272bh")]
position = Vector2(900, -3000)
scale = Vector2(5, 3.1)
[node name="Ghost" parent="." instance=ExtResource("9_kek77")]
position = Vector2(0, -3000)
[node name="Arrow" parent="." instance=ExtResource("10_4c57u")]
position = Vector2(0, -3150)
[node name="HealthUp" parent="." instance=ExtResource("11_efxa6")]
position = Vector2(200, -3100)
[node name="Bow" parent="." instance=ExtResource("9_4c57u")]
position = Vector2(0, -3100)
[connection signal="health_changed" from="Player" to="CanvasLayer/Healthbar" method="_on_player_health_changed"]
[connection signal="max_hp_changed" from="Player" to="CanvasLayer/Healthbar" method="_on_player_max_hp_changed"]
[connection signal="player_died" from="Player" to="CanvasLayer/DeathScreen" method="_on_player_player_died"]

View file

@ -21,6 +21,6 @@ func _physics_process(delta: float) -> void:
if(slash_timer == 0):
anim_sprite.visible = false
for area in get_overlapping_areas():
area.hurt(damage, Vector2(-facing, 0))
area.hurt(damage, -get_parent().earth_aligner.global_from_local(Vector2(-facing, 0)))

View file

@ -16,7 +16,7 @@ func _physics_process(delta: float) -> void:
damage_target(target)
func damage_target(target: CollisionObject2D):
var dir = -(ball.global_position - target.global_position).normalized()
var dir = (ball.global_position - target.global_position).normalized()
if(target.get_collision_layer_value(3)):
target.hurt(player_damage, dir)
else:

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bk0lxjv2qjxnp"
path="res://.godot/imported/Background Prototype Layer 1.png-47bb54b6d20a1ded35cb94112bf217ac.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://world/Background Prototype/Background Prototype Layer 1.png"
dest_files=["res://.godot/imported/Background Prototype Layer 1.png-47bb54b6d20a1ded35cb94112bf217ac.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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: 12 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b6fkgig57ki5j"
path="res://.godot/imported/Background Prototype Layer 2.png-ab86220f0fff6116368732c43de3cd4a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://world/Background Prototype/Background Prototype Layer 2.png"
dest_files=["res://.godot/imported/Background Prototype Layer 2.png-ab86220f0fff6116368732c43de3cd4a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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: 13 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://tctuwr3rmof4"
path="res://.godot/imported/Background Prototype Layer 3.png-5a49ea16a5dc160131825028039c991b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://world/Background Prototype/Background Prototype Layer 3.png"
dest_files=["res://.godot/imported/Background Prototype Layer 3.png-5a49ea16a5dc160131825028039c991b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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: 14 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b3d276mpm5mqr"
path="res://.godot/imported/Background Prototype Layer 4.png-ee5791549e6767ad5445aec25f3260a1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://world/Background Prototype/Background Prototype Layer 4.png"
dest_files=["res://.godot/imported/Background Prototype Layer 4.png-ee5791549e6767ad5445aec25f3260a1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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: 16 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d3fpq76anm4t7"
path="res://.godot/imported/Background prototype.png-82410769bb8789c49aff3e49453fc3fe.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://world/Background prototype.png"
dest_files=["res://.godot/imported/Background prototype.png-82410769bb8789c49aff3e49453fc3fe.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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