Basic pathfinding working for crying ghosts
This commit is contained in:
|
Before Width: | Height: | Size: 194 B After Width: | Height: | Size: 194 B |
@@ -3,15 +3,15 @@
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://mesi0bfnca6y"
|
||||
path="res://.godot/imported/Fireball.png-86123da5fd3d9a12514f31908427d9dd.ctex"
|
||||
path="res://.godot/imported/Fireball.png-220a164c89b06ee48fdd7fb2e948e296.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Abilities/Fireball.png"
|
||||
dest_files=["res://.godot/imported/Fireball.png-86123da5fd3d9a12514f31908427d9dd.ctex"]
|
||||
source_file="res://Abilities/Fireball/Fireball.png"
|
||||
dest_files=["res://.godot/imported/Fireball.png-220a164c89b06ee48fdd7fb2e948e296.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bc7omt6pay1lx"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://tt0u7f0gemjo" path="res://Abilities/Fireball.cs" id="1_0kqim"]
|
||||
[ext_resource type="Texture2D" uid="uid://mesi0bfnca6y" path="res://Abilities/Fireball.png" id="2_rf7by"]
|
||||
[ext_resource type="Script" uid="uid://tt0u7f0gemjo" path="res://Abilities/Fireball/Fireball.cs" id="1_0kqim"]
|
||||
[ext_resource type="Texture2D" uid="uid://mesi0bfnca6y" path="res://Abilities/Fireball/Fireball.png" id="2_rf7by"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_nvq50"]
|
||||
radius = 6.0
|
||||
@@ -9,6 +9,7 @@ radius = 6.0
|
||||
[node name="Fireball" type="Area2D"]
|
||||
script = ExtResource("1_0kqim")
|
||||
Speed = 700.0
|
||||
Lifetime = 1.0
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_rf7by")
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dhobg02glafch"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c4cmav4r8i83e" path="res://Abilities/Fireballv2.cs" id="1_8mjwt"]
|
||||
[ext_resource type="Texture2D" uid="uid://mesi0bfnca6y" path="res://Abilities/Fireball.png" id="2_0w1e3"]
|
||||
[ext_resource type="Script" uid="uid://c4cmav4r8i83e" path="res://Abilities/Fireball/Fireballv2.cs" id="1_8mjwt"]
|
||||
[ext_resource type="Texture2D" uid="uid://mesi0bfnca6y" path="res://Abilities/Fireball/Fireball.png" id="2_0w1e3"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_nvq50"]
|
||||
radius = 6.0
|
||||
@@ -9,7 +9,9 @@ radius = 6.0
|
||||
[node name="Fireballv2" type="Area2D"]
|
||||
script = ExtResource("1_8mjwt")
|
||||
TurnRate = 8.0
|
||||
OrbitStrength = 1.0
|
||||
Speed = 500.0
|
||||
Lifetime = 1.0
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_0w1e3")
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://b2u2xirxjo68h"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bwwxti5v178gx" path="res://Abilities/Fireballv3.cs" id="1_8c7o3"]
|
||||
[ext_resource type="Texture2D" uid="uid://mesi0bfnca6y" path="res://Abilities/Fireball.png" id="2_aknci"]
|
||||
[ext_resource type="Script" uid="uid://bwwxti5v178gx" path="res://Abilities/Fireball/Fireballv3.cs" id="1_8c7o3"]
|
||||
[ext_resource type="Texture2D" uid="uid://mesi0bfnca6y" path="res://Abilities/Fireball/Fireball.png" id="2_aknci"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_nvq50"]
|
||||
radius = 6.0
|
||||
@@ -10,6 +10,7 @@ radius = 6.0
|
||||
script = ExtResource("1_8c7o3")
|
||||
TurnSpeed = 8.0
|
||||
Speed = 500.0
|
||||
Lifetime = 1.0
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_aknci")
|
||||
@@ -3,8 +3,10 @@ using Godot;
|
||||
public partial class ProjectileBase : Area2D
|
||||
{
|
||||
[Export] public float Speed { get; set; }
|
||||
[Export] public float Lifetime { get; set; }
|
||||
|
||||
protected CharacterBase? Character;
|
||||
protected float Age { get; private set; } = 0f;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
@@ -14,6 +16,16 @@ public partial class ProjectileBase : Area2D
|
||||
}
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
Age += (float)delta;
|
||||
|
||||
if (Age >= Lifetime)
|
||||
{
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
|
||||
void OnBodyEntered(Node body)
|
||||
{
|
||||
if (body == Character)
|
||||
|
||||
Reference in New Issue
Block a user