meh
This commit is contained in:
20
src/Gameplay/Nodules/Mitochondria.cs
Normal file
20
src/Gameplay/Nodules/Mitochondria.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Godot;
|
||||
|
||||
namespace Slimepire.Gameplay.Nodules;
|
||||
|
||||
[SceneTree]
|
||||
public partial class Mitochondria : Node2D
|
||||
{
|
||||
public float Energy { get; set; } = 0;
|
||||
public float MaxEnergy { get; set; } = 100;
|
||||
public float EnergyRegenRate { get; set; } = 1;
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (Energy < MaxEnergy)
|
||||
{
|
||||
Energy += EnergyRegenRate * (float)delta;
|
||||
}
|
||||
GPUParticles2D.Amount = (int)Energy;
|
||||
}
|
||||
}
|
||||
1
src/Gameplay/Nodules/Mitochondria.cs.uid
Normal file
1
src/Gameplay/Nodules/Mitochondria.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://h50qndjmmq4d
|
||||
36
src/Gameplay/Nodules/Mitochondria.tscn
Normal file
36
src/Gameplay/Nodules/Mitochondria.tscn
Normal file
File diff suppressed because one or more lines are too long
@@ -2,6 +2,7 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://cmpl0if164dba" path="res://src/Gameplay/Nodules/Nodule.cs" id="1_yembh"]
|
||||
[ext_resource type="Texture2D" uid="uid://cecg47efx7gw8" path="res://assets/Sprite-0001.png" id="2_7qt20"]
|
||||
[ext_resource type="PackedScene" uid="uid://c11xdoiv2ch3w" path="res://src/Gameplay/Nodules/Mitochondria.tscn" id="3_x44k2"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_7qt20"]
|
||||
radius = 15.0
|
||||
@@ -64,3 +65,5 @@ collision_mask = 2
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="TubeConnectionArea" unique_id=234655540]
|
||||
shape = SubResource("CircleShape2D_x44k2")
|
||||
debug_color = Color(0.38922516, 0.6054754, 0.25354394, 0.41960785)
|
||||
|
||||
[node name="Mitochondria" parent="." unique_id=954228490 instance=ExtResource("3_x44k2")]
|
||||
|
||||
Reference in New Issue
Block a user