Meik Schürmann 2026-04-13 12:55:19 +02:00
commit 3b8216d5bf
14 changed files with 171 additions and 29 deletions

BIN
.DS_Store vendored 100644

Binary file not shown.

BIN
assets/.DS_Store vendored 100644

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d2pinnrigixnp"
path="res://.godot/imported/Pixel_Foods(ARTLİNE).png-65f9f1ff4f45b0c1e5e6cf5475527854.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/16x16 Pixelart Food Icons/Pixel_Foods(ARTLİNE).png"
dest_files=["res://.godot/imported/Pixel_Foods(ARTLİNE).png-65f9f1ff4f45b0c1e5e6cf5475527854.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: 16 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://biu6imiybx5s1"
path="res://.godot/imported/Pixel_Foods_01.png-1e4c8ccf5ba8e0ceaf9da7b24229890a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/16x16 Pixelart Food Icons/Pixel_Foods_01.png"
dest_files=["res://.godot/imported/Pixel_Foods_01.png-1e4c8ccf5ba8e0ceaf9da7b24229890a.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

20
scenes/apple.tscn 100644
View File

@ -0,0 +1,20 @@
[gd_scene format=3 uid="uid://dm6d2jg52vi41"]
[ext_resource type="Texture2D" uid="uid://d2pinnrigixnp" path="res://assets/16x16 Pixelart Food Icons/Pixel_Foods(ARTLİNE).png" id="1_h071m"]
[sub_resource type="AtlasTexture" id="AtlasTexture_7vr8k"]
atlas = ExtResource("1_h071m")
region = Rect2(1, 2, 16, 15)
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_3dmh2"]
radius = 9.0
height = 18.0
[node name="Apple" type="Area2D" unique_id=1121088527]
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1596918550]
texture_filter = 1
texture = SubResource("AtlasTexture_7vr8k")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1391308033]
shape = SubResource("CapsuleShape2D_3dmh2")

View File

@ -2381,4 +2381,6 @@ stream = ExtResource("9_0tnpc")
autoplay = true
bus = &"Music"
[node name="DropManager" type="Node2D" parent="." unique_id=1629996711]
[connection signal="timeout" from="SpawnTimer" to="SpawnControl" method="_on_spawn_timer_timeout"]

View File

@ -230,7 +230,7 @@ animations = [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_tyl0w")
}],
"loop": true,
"loop": false,
"name": &"death",
"speed": 10.0
}, {
@ -377,15 +377,25 @@ animations = [{
[sub_resource type="CircleShape2D" id="CircleShape2D_siike"]
radius = 7.071068
[sub_resource type="CircleShape2D" id="CircleShape2D_pjw23"]
radius = 8.062258
[node name="Slime" type="CharacterBody2D" unique_id=1684858295]
script = ExtResource("1_1a61f")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=752118449]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_cbi0b")
animation = &"walk_down"
frame_progress = 0.2693989
animation = &"death"
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=769710804]
position = Vector2(0, 1)
shape = SubResource("CircleShape2D_siike")
[node name="Area2D" type="Area2D" parent="." unique_id=1450702908]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=951963224]
position = Vector2(0, 1)
shape = SubResource("CircleShape2D_pjw23")
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]

View File

@ -0,0 +1,44 @@
class_name EnemyBase
extends CharacterBody2D
@onready var animated_sprite_2d: AnimatedSprite2D = $AnimatedSprite2D
var is_dying = false
var speed
var witch
var player
func _ready() -> void:
witch = get_node("/root/Game/Witch")
player = get_node("/root/Game/Player")
pass # Replace with function body
func _die():
is_dying = true
animated_sprite_2d.play("death")
await animated_sprite_2d.animation_finished
queue_free()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _chase_witch() -> void:
var direction = Vector2(witch.global_position - global_position)
velocity = direction * speed
velocity = direction * speed
if direction == Vector2.ZERO:
animated_sprite_2d.play("idle")
elif abs(direction.x) >= abs(direction.y):
if direction.x < 0:
animated_sprite_2d.play("walk_left")
else:
animated_sprite_2d.play("walk_right")
else:
if direction.y < 0:
animated_sprite_2d.play("walk_up")
else:
animated_sprite_2d.play("walk_down")
move_and_slide()

View File

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

View File

@ -1,35 +1,20 @@
extends CharacterBody2D
extends EnemyBase
@onready var animated_sprite_2d: AnimatedSprite2D = $AnimatedSprite2D
var speed = 0.04
var player
# Called when the node enters the scene tree for the first time.
# Called every frame. 'delta' is the elapsed time since the previous frame.+
func _ready() -> void:
player = get_node("/root/Game/Witch")
pass # Replace with function body.
super()
speed = 0.04
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if is_dying:
return
_chase_witch()
pass
func _chase_witch() -> void:
var direction = Vector2(player.global_position - global_position)
velocity = direction * speed
velocity = direction * speed
if direction == Vector2.ZERO:
animated_sprite_2d.play("idle")
elif abs(direction.x) >= abs(direction.y):
if direction.x < 0:
animated_sprite_2d.play("walk_left")
else:
animated_sprite_2d.play("walk_right")
else:
if direction.y < 0:
animated_sprite_2d.play("walk_up")
else:
animated_sprite_2d.play("walk_down")
move_and_slide()
func _on_area_2d_body_entered(body: Node2D) -> void:
if body == player:
_die()
pass # Replace with function body.