Basic pathfinding working for crying ghosts

This commit is contained in:
2026-01-17 23:37:33 -06:00
parent dd4ce5fcf4
commit 3a63bb6709
46 changed files with 691 additions and 34 deletions

View File

@@ -0,0 +1,24 @@
using Godot;
using System;
public partial class Potato : CharacterBase
{
private AnimatedSprite2D? _animatedSprite;
public override void _Ready()
{
_animatedSprite = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
}
public override void _Process(double delta)
{
if (IsMoving)
{
_animatedSprite?.Play("walk");
}
else
{
_animatedSprite?.Stop();
}
}
}

View File

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

View File

@@ -0,0 +1,34 @@
[gd_resource type="SpriteFrames" load_steps=5 format=3 uid="uid://drrdnd1kwr7lj"]
[ext_resource type="Texture2D" uid="uid://bvs8vrofgjoag" path="res://Characters/Potato/potato.png" id="1_os4wu"]
[ext_resource type="Texture2D" uid="uid://cjs21sigvksdf" path="res://Characters/Potato/potato_walk.png" id="2_g3cha"]
[sub_resource type="AtlasTexture" id="AtlasTexture_cu4k2"]
atlas = ExtResource("2_g3cha")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_f5v2o"]
atlas = ExtResource("2_g3cha")
region = Rect2(16, 0, 16, 16)
[resource]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("1_os4wu")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_cu4k2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_f5v2o")
}],
"loop": true,
"name": &"walk",
"speed": 5.0
}]

View File

@@ -0,0 +1,21 @@
[gd_scene load_steps=4 format=3 uid="uid://bqbsh3mejgs18"]
[ext_resource type="Script" uid="uid://dq1dx56o8k7tg" path="res://Characters/Potato/Potato.cs" id="1_nwx1l"]
[ext_resource type="SpriteFrames" uid="uid://drrdnd1kwr7lj" path="res://Characters/Potato/Potato.tres" id="2_sw86o"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_sw86o"]
radius = 4.1781855
height = 15.565589
[node name="Potato" type="CharacterBody2D"]
script = ExtResource("1_nwx1l")
Speed = 100.0
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = ExtResource("2_sw86o")
animation = &"walk"
frame_progress = 0.988052
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = 0.61086524
shape = SubResource("CapsuleShape2D_sw86o")

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bvs8vrofgjoag"
path="res://.godot/imported/potato.png-8d8c005bc502d63f08b319ec956f9fa9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Potato/potato.png"
dest_files=["res://.godot/imported/potato.png-8d8c005bc502d63f08b319ec956f9fa9.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: 389 B

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cjs21sigvksdf"
path="res://.godot/imported/potato_walk.png-796309b1abb8d979328a6e8ba0383026.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Characters/Potato/potato_walk.png"
dest_files=["res://.godot/imported/potato_walk.png-796309b1abb8d979328a6e8ba0383026.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