brand new start

This commit is contained in:
Rendo 2025-08-01 02:47:32 +05:00
commit f15f38bfc4
464 changed files with 5 additions and 20007 deletions

View file

@ -1,22 +0,0 @@
using Godot;
public partial class CompoundProjectile : Node2D
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
GetTree().ProcessFrame += ReleaseCompound;
}
public void ReleaseCompound()
{
GetTree().ProcessFrame -= ReleaseCompound;
foreach (var child in GetChildren())
{
child.Reparent(GetParent());
}
QueueFree();
}
}

View file

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

View file

@ -1,9 +0,0 @@
namespace Newlon.Projectiles;
//
// Base interface for entities
//
public interface IProjectile
{
public int Line { get; set; }
}

View file

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

View file

@ -1,48 +0,0 @@
using Godot;
using Newlon.Components.Level;
using Newlon.Systems.Effects;
using Newlon.Components;
namespace Newlon.Projectiles;
//
// Projectile that travels from left to right
//
public partial class LinearProjectile : Area2D, IProjectile
{
[Export(hintString: "suffix:tile/sec")]
private float _speed;
[Export]
private int _damage;
[Export]
private Effect _impactEffect;
[Export]
private PackedScene particles;
private int _line;
private bool used = false;
public int Line { get => _line; set { _line = value; } }
public override void _PhysicsProcess(double delta)
{
Translate(Transform.X * _speed * (float)delta * FieldParams.TileWidth);
}
public void OnAreaEntered(Area2D area)
{
if (used == true) return;
var entity = area.GetParent<Entity>();
if (entity != null)
{
entity.TakeDamage(_damage,this);
used = true;
if (_impactEffect != null)
entity.GiveEffect(_impactEffect);
PoolContainer.Instance.SpawnParticles(particles, GlobalPosition, GlobalRotation);
QueueFree();
}
}
}

View file

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

View file

@ -1,61 +0,0 @@
using Godot;
using Newlon.Components.GUI;
using Newlon.Components.Level;
namespace Newlon.Projectiles;
public partial class Sun : Area2D
{
[Export] public int amount = 25;
[Export] private Timer _deathTimer;
[Export] private AnimationPlayer _rotation;
[Export] private AnimationPlayer _fade;
private bool scoring;
public override void _Ready()
{
_rotation.SpeedScale = 1.0f + GD.Randf() / 2.0f;
}
public override void _InputEvent(Viewport viewport, InputEvent @event, int shapeIdx)
{
if (Settings.SunClick == false || scoring) return;
if (@event.IsActionPressed("primary_action"))
{
GetViewport().SetInputAsHandled();
ScoreSun();
}
}
public override void _Process(double delta)
{
if (scoring) return;
if (_deathTimer.TimeLeft / _deathTimer.WaitTime <= 0.25)
{
_fade.Play("main");
}
}
public override void _MouseEnter()
{
if (Settings.SunClick || scoring) return;
ScoreSun();
}
private void ScoreSun()
{
_fade.Stop();
scoring = true;
RuntimeLevelData.Instance.AddSun(amount,false);
GetNode<ChannelPlayer>("SunPlayer").Play();
var tween = CreateTween();
tween.TweenProperty(this, "global_position", GetCanvasTransform().AffineInverse() * (SunCounter.Instance.sunImage.GlobalPosition + SunCounter.Instance.sunImage.PivotOffset), 0.5).SetTrans(Tween.TransitionType.Cubic).SetEase(Tween.EaseType.Out);
tween.TweenCallback(Callable.From(() =>
{
SunCounter.Update();
QueueFree();
}));
}
}

View file

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