Basic pathfinding working for crying ghosts
This commit is contained in:
24
Characters/Alien/Alien.cs
Normal file
24
Characters/Alien/Alien.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class Alien : 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Characters/Alien/Alien.cs.uid
Normal file
1
Characters/Alien/Alien.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bi3skhkybwoa7
|
||||
37
Characters/Alien/Alien.tres
Normal file
37
Characters/Alien/Alien.tres
Normal file
@@ -0,0 +1,37 @@
|
||||
[gd_resource type="SpriteFrames" load_steps=5 format=3 uid="uid://bqy3twlyxmhx6"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://lja331o88abg" path="res://Characters/Alien/Sprite-0004.png" id="1_gpyw1"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ffiei"]
|
||||
atlas = ExtResource("1_gpyw1")
|
||||
region = Rect2(0, 0, 16, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_d4kv8"]
|
||||
atlas = ExtResource("1_gpyw1")
|
||||
region = Rect2(0, 0, 16, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_117nm"]
|
||||
atlas = ExtResource("1_gpyw1")
|
||||
region = Rect2(16, 0, 16, 32)
|
||||
|
||||
[resource]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ffiei")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_d4kv8")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_117nm")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 5.0
|
||||
}]
|
||||
20
Characters/Alien/Alien.tscn
Normal file
20
Characters/Alien/Alien.tscn
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://lfawbspot0vf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bi3skhkybwoa7" path="res://Characters/Alien/Alien.cs" id="1_h37a8"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://bqy3twlyxmhx6" path="res://Characters/Alien/Alien.tres" id="2_5lqdc"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_h37a8"]
|
||||
radius = 4.0
|
||||
height = 28.0
|
||||
|
||||
[node name="Alien" type="CharacterBody2D" groups=["Player"]]
|
||||
script = ExtResource("1_h37a8")
|
||||
Speed = 150.0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 1)
|
||||
shape = SubResource("CapsuleShape2D_h37a8")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
sprite_frames = ExtResource("2_5lqdc")
|
||||
animation = &"walk"
|
||||
BIN
Characters/Alien/Sprite-0004.png
Normal file
BIN
Characters/Alien/Sprite-0004.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 493 B |
40
Characters/Alien/Sprite-0004.png.import
Normal file
40
Characters/Alien/Sprite-0004.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://lja331o88abg"
|
||||
path="res://.godot/imported/Sprite-0004.png-e66795ad74755bd4c94f14c19c9ecbcb.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Characters/Alien/Sprite-0004.png"
|
||||
dest_files=["res://.godot/imported/Sprite-0004.png-e66795ad74755bd4c94f14c19c9ecbcb.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
|
||||
Reference in New Issue
Block a user