This commit is contained in:
redglow
2026-07-21 20:49:24 +02:00
parent c540b99eb6
commit e7dbb9cabb
31 changed files with 394 additions and 76 deletions
+3 -11
View File
@@ -1,21 +1,13 @@
using Godot;
using GodotHostTest.Helpers;
using GodotHostTest.Interfaces;
using Microsoft.Extensions.Logging;
using OwofGames.AetherBind;
using R3;
namespace GodotHostTest.Game.Projectile;
public partial class Projectile : Node2D
{
[Inject] private ILogger<Projectile> _logger = null!;
[Inject] private ITargetSpawner _targetSpawner = null!;
[Export] private float _speed = 100;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
public override void _PhysicsProcess(double delta)
{
_targetSpawner.TargetSpawned
.Subscribe(_ => _logger.LogInformation("Projectile got informed of target spawning")).AddTo(this);
Position += (float)delta * _speed * Vector2.Up.Rotated(Rotation);
}
}